First, yum change domestic source
First of all
cd /etc/yum.repos.d/rm -f dvd.repo
Delete the previously added local repository and restore the original warehouse back
cp /etc/yum.repos.d.bak/* /etc/yum.repos.d/cp ../yum.repos.d.bak/* .
The above two commands are all possible, the second one is used under practice: And.
LS View file list, delete Centos-base.repo
rm -rf CentOS-Base.repo
Create a domestic source
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
Since the wget was not installed, Yum could not be used to install wget because the Yum source was deleted.
You can install a new source with the following command
curl -O http://mirrors.163.com/.help/CentOS7-Base-163.repo`
Yum List
Yum Install zsh
If you change the name of Centos7-base-163.repo, the Yum command will not work.
Execute Yum repolist all
will find that all RPM packages are not available
Linux Learning Notes (22) Yum change domestic source, yum download rpm package, source package installation