准备工具
共享给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