How to Use Yum source update in centos 6.2 (32-bit)

Source: Internet
Author: User
Tags gpg

Previously, Redhat EL5 server has been used as a server, but the RedHat Yum needs to be updated online, so it will be charged. Later I changed centos 6.2, but I want to use its Yum function, you also need to make some other changes. The specific content is as follows:

1. First, because the company needs to use a proxy to access the Internet, you need to configure Yum to connect to the Internet. The specific method is as follows:

Modify the/etc/yum. conf file and add the Proxy Server IP address and port to the end of the file. If there is a user name and password, add it as well. If there is no user name and password, then you don't need:

proxy=http://ip:portproxy_username=usernameproxy_password=password
2. Change the yum source. We use the centos image source of Netease:
# cd /etc/yum.repos.d/# wget  http://mirrors.163.com/.help/CentOS6-Base-163.repo# vi CentOS6-Base-163.repo

Sohu Yum Source: wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo

If Step 2 wget is unavailable, you can directly obtain the. Repo configuration file in the browser.
Edit the file, replace all the $ releasever in the file with the version number, that is, 6 is last saved! Or directly copy the following memory to the CentOS6-Base-163.repo file (modified ):

########################################################################## 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/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=6&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/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=6&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/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=6&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/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=6&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/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contribgpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#########################################################################
3. Clear Yum cache:

# Yum clean all
# Yum makecache # cache the software package information on the server to a local machine to speed up searching and installing software
# Yum install Vim * # test whether the domain name is available

Now, redhat6 can use centos Yum source to install software online!

4. Install the plug-in:

Finally, you can install a plug-in, yum install Yum-fastestmirror-y, which automatically selects the fast source.

If I put many sources in that directory, how can I know which one is currently used? If you haven't changed yum. conf, read the file starting with time in the/var/Cache/Yum/folder.

 

Related Article

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.