適用于剛剛安裝的系統(tǒng),這個時候原本的yum是沒法用的,所以現在要做的是先清空溃槐!
cd /etc/rpm/
rm -rf ./m*
下載yum 源
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-9.el7.noarch.rpm
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-3.4.3-161.el7.centos.noarch.rpm
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm
wget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-50.el7.noarch.rpm
如果要安裝肯定是要一個一個去安裝這些yum帅矗,那么如何批量安裝當前目錄下的偎肃?
rpm -ivh yum* --force --nodeps #-force --nodeps參數為忽略依賴檢測的強制安裝
檢查下是否已經安裝了
rpm -qa | grep yum
下載yum源文件,因為centos 和redhat7基本是一樣的浑此,所以下載的一致就行
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
我們可以先看下當前的yum文件修改CentOS-Base.repo文件
cd /etc/yum.repos.d/
ls
vim CentOS-Base.repo
執(zhí)行:%s/$releasever/7/g快速替換
重載yum源
yum clean all
yum update