Configure YUM in Linux and yum in linux

Source: Internet
Author: User
Tags install perl

Configure YUM in Linux and yum in linux

Overview

This article mainly introduces how to configure the yum source. Although there are many methods on the internet, each of them has more or less problems, so I will write my own configuration process.

Directory

  • Overview
  • Procedure
    • Download the installation package
    • Uninstall the yum
    • Install the yum package
    • Add yum
  • Summary
Download the installation package

My current server version is redhat6, so the downloaded installation package should also correspond to the installation package of linux6. Here, the yum source of 163 is configured.

 

wget http://mirrors.163.com/centos/6/os/i386/Packages/yum-3.2.29-69.el6.centos.noarch.rpmwget http://mirrors.163.com/centos/6/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpmwget http://mirrors.163.com/centos/6/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpmwget http://mirrors.163.com/centos/6/os/i386/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
Uninstall the yum
rpm -aq|grep yum|xargs rpm -e --nodeps
Install the yum package

Attention Sequence

Rpm-ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm rpm-ivh yum-metadata-parser-1.1.2-16.el6.i686.rpm -- note that the next two install the rpm-ivh yum-3.2.29-69.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm together

 

Add yum

Switch path

cd /etc/yum.repos.d/

Download files

wget  http://mirrors.163.com/.help/CentOS6-Base-163.repo

Edit File

vim CentOS6-Base-163.repo

The content is as follows:

# CentOS-Base.repo## The mirror system uses the connecting IP address of the client and the# update status of each mirror to pick mirrors that are updated to and# geographically close to the client.  You should use this for CentOS updates# unless you are manually picking other mirrors.## If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead.##[base]name=CentOS-6 - Base - 163.combaseurl=http://mirrors.163.com/centos/6/os/i386/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=osgpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#released updates [updates]name=CentOS-6 - Updates - 163.combaseurl=http://mirrors.163.com/centos/6/updates/i386/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updatesgpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#additional packages that may be useful[extras]name=CentOS-6 - Extras - 163.combaseurl=http://mirrors.163.com/centos/6/extras/i386/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extrasgpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#additional packages that extend functionality of existing packages[centosplus]name=CentOS-6 - Plus - 163.combaseurl=http://mirrors.163.com/centos/6/centosplus/i386/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplusgpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#contrib - packages by Centos Users[contrib]name=CentOS-6 - Contrib - 163.combaseurl=http://mirrors.163.com/centos/6/contrib/i386/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contribgpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

Test whether the installation is successful

yum install perl-DBI

 

Summary

The installation method is not difficult. Note that you need to select the correct version when downloading the rpm package, and may encounter some troubles when configuring repo later, but it is easy to solve.

 

If the article is helpful to you, please recommend it. Thank you !!!

 

Note:

Author: pursuer. chen

Blog: http://www.cnblogs.com/chenmh

All essays on this site are original. You are welcome to repost them. However, you must indicate the source of the article and clearly provide the link at the beginning of the article. Otherwise, you will be held accountable.

Welcome to discussion

 

--- Restore content end ---

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.