CentOS update system

Source: Internet
Author: User
After CentOS is installed, you must first modify the update source and upgrade it to the latest system. Domestic faster update source, I recommend: http://mirrors.163.com NetEase update source, just found, the speed is OK. First we have to back up the system's previous profile CentOS-Base.repo: sudocp/etc/yum. repos. d/CentOS-Base.repo/etc/yum. repos. d

After CentOS is installed, you must first modify the update source and upgrade it to the latest system.
Domestic fast update sources, I recommend:
Http://mirrors.163.com NetEase update source, just found, the speed can also.

First we have to back up the system's previous profile CentOS-Base.repo:
Sudo cp/etc/yum. repos. d/CentOS-Base.repo/etc/yum. repos. d/CentOS-Base.repo.bak
Edit The yum configuration file:
Sudo vi/etc/yum. repos. d/CentOS-Base.repo

Comment out the comment list in the file in CenOS-Base-repo, remove the comment before baseurl, and change the source address to NetEase's

The configuration file content is:

[Base]
Name = CentOS-$ releasever-Base
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = OS
Baseurl = http://mirrors.163.com/centos/?releasever/ OS /?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

# Released updates
[Updates]
Name = CentOS-$ releasever-Updates
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = updates
Baseurl = http://mirrors.163.com/centos/?releasever/updates/?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

# Packages used/produced in the build but not released
[Addons]
Name = CentOS-$ releasever-Addons
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = addons
Baseurl = http://mirrors.163.com/centos/?releasever/addons/?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

# Additional packages that may be useful
[Extras]
Name = CentOS-$ releasever-Extras
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = extras
Baseurl = http://mirrors.163.com/centos/?releasever/extras/?basearch/
Gpgcheck = 1
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

# Additional packages that extend functionality of existing packages
[Centosplus]
Name = CentOS-$ releasever-Plus
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = centosplus
Baseurl = http://mirrors.163.com/centos/?releasever/centosplus/?basearch/
Gpgcheck = 1
Enabled = 0
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

# Contrib-packages by Centos Users
[Contrib]
Name = CentOS-$ releasever-Contrib
# Items list = http://mirrorlist.centos.org /? Release = $ releasever & arch = $ basearch & repo = contrib
Baseurl = http://mirrors.163.com/centos/?releasever/contrib/?basearch/
Gpgcheck = 1
Enabled = 0
Gpgkey = http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

Where:

Repositoryid: Used to specify a repository

Name: specifies the name of a readable repository.

Baseurl: specifies the URL of the repository. it can be of the following three types, such as http, ftp, and file.

Repository list: specifies the image site of the repository.

Enable: Specifies whether to use this repository. the default value is 1.

Gpgcheck: Used to specify whether to check the GPG signature of the software package.

Gpgkey: Used to specify the URL of the GPG signature file.

I usually use root superuser

 

If you are a common user, add sudo at the beginning of the command.

Run the following command:

Rpm -- import/etc/pki/rpm-gpg/RPM-GPG-KEY *

Yum update

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.