Today, when I helped a friend mount a data disk to an Alibaba Cloud ECS server and install the LNMP environment, screen is not installed by default, so I started to install yum directly and found that there is no data source, therefore, no source is found when you prepare all update updates. This problem also exists, so the old Left is ready to re-update the yum source.
1. Back up original image files
The code is as follows: |
Copy code |
Mv/etc/yum. repos. d/CentOS-Base.repo/etc/yum. repos. d/CentOS-Base.repo.backup
|
Here, we will back up the original image first, otherwise we can recover it if we make a mistake.
2. Update the source directory for download
A-CentOS 5
The code is as follows: |
Copy code |
Wget-O/etc/yum. repos. d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
|
B-CentOS 6
The code is as follows: |
Copy code |
Wget-O/etc/yum. repos. d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
|
Log on to the SSH server and download the Alibaba Cloud image source.
Third, update generation
The code is as follows: |
Copy code |
Yum clean all
Yum makecache
|
Execute the command and install it.
Then, when we run the yum update-y command, there is no problem. I have shared this before updating the yum source for debian mitigation.