准備工具

共享給linux
共享給linux,自己建一個文件夾/home/yuan/myfile放進去,如下圖:

安裝
按順序裝
rpm -ivh python-iniparse-0.4-9.el7.noarch\ -.rpm
rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64\ .rpm
rpm -ivh --nodeps --force yum-3.4.3-163.el7.centos.noarch.rpm
rpm -ivh --nodeps --force yum-plugin-fastestmirror-1.1.31-52.el7.noarch\ .rpm
修改鏡像
下一步是修改yum源,首先是切換到這個文件,然后去一個地址下載新的yum.repos.d代替現在的yum.repos.d
去這里下載:
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
我已經下載好了,接着在linux上找到163的鏡像,直接替換當前的yum鏡像即可,(任何需要被替換的文件,都要提前備份)。
cp CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo
CentOS-Base.repo內容
| # CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-7 - Base - 163.com #mirrorlist=http://centos.ustc.edu.cn/?release=7&arch=$basearch&repo=os baseurl=http://mirrors.163.com/centos/7/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
#released updates [updates] name=CentOS-7 - Updates - 163.com #mirrorlist=http://centos.ustc.edu.cn/?release=7&arch=$basearch&repo=updates baseurl=http://mirrors.163.com/centos/7/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful [extras] name=CentOS-7 - Extras - 163.com #mirrorlist=http://centos.ustc.edu.cn/?release=7&arch=$basearch&repo=extras baseurl=http://mirrors.163.com/centos/7/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages [centosplus] name=CentOS-7 - Plus - 163.com baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 |
將原文件修改為成當前文件的內容,將修改文中的&releasever改成你的Centos對應版本號,將源mirrorlist.centos.org改為centos.ustc.edu.cn 。
當然直接復制我的文件即可。
附加圖片一張同上文
|
保存配置
ECS>:wq!>Enter
並清理yum緩存
yum clean all
生成緩存
yum makecache
測試
yum grouplist

