CentOS yum source configuration

Last updated:2021-08-03 18:56:33

Shift Kingsoft Cloud yum source to the system-provided source

  1. Enter the directory of the yum source configuration file.

    cd  /etc/yum.repos.d/
    ls
    

  2. Back up the yum source configuration file of Kingsoft Cloud.

    mv CentOS.repo CentOS_repo
    
  3. Copy the system-provided yum source file to the current directory.

    cp backup/CentOS-Base.repo .          
    ls
    

  4. Update the system.

    yum update
    

Shift the system-provided source to Kingsoft Cloud yum source

  1. Enter the directory of the yum source configuration file.

    cd  /etc/yum.repos.d/
    ls
    
  2. Delete the system-provided yum source configuration file and use the file provided by Kingsoft Cloud.

    rm -f CentOS-Base.repo
    mv CentOS_repo CentOS.repo
    

  3. Update the system.

    yum update
    

Change the Linux yum source

  1. Enter the directory of the yum source configuration file.

    cd /etc/yum.repos.d/
    
  2. Back up the current yum source configuration file.

    mv CentOS-Base.repo CentOS-Base_repo_bak
    
  3. Download the new configuration file. The following uses the yum source provided by NetEase as an example.

    wget [http://mirrors.163.com/.help/CentOS6-Base-163.repo](http://mirrors.163.com/.help/CentOS6-Base-163.repo)
    
  4. Rename the configuration file according to the file requirement. The following uses “CentOS6-Base-163.repo” as an example.

    mv CentOS6-Base-163.repo CentOS-Base.repo
    
  5. Update the system.

    yum update
    

Did you find the above information helpful?

Unhelpful
Mostly Unhelpful
A little helpful
Helpful
Very helpful

What might be the problems?

Insufficient
Outdated
Unclear or awkward
Redundant or clumsy
Lack of context for the complex system or functionality

More suggestions

0/200

Please give us your feedback.

Submitted

Thank you for your feedback.

问题反馈