由于rhel需要注册才能使用yum源,所以会更换成centos源。
接下来就用rhce的系统,安装centos源。
需要包的地址:http://mirrors.163.com/centos/7/os/x86_64/Packages/
1.安装wget:
1 [[email protected] centosyum]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/wget-1.14-13.el7.x86_64.rpm 2 3 [[email protected] centosyum]# rpm -ivh wget-1.14-13.el7.x86_64.rpm
2.卸载yum:
1 [[email protected] centosyum]# rpm -qa | grep yum | xargs rpm -e --nodeps 2 warning: /etc/yum/pluginconf.d/langpacks.conf saved as /etc/yum/pluginconf.d/langpacks.conf.rpmsave 3 [[email protected] centosyum]# rpm -qa yum
3.下载centos的yum安装包:
1 [[email protected] centosyum]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm 2 [[email protected] centosyum]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-150.el7.centos.noarch.rpm 3 [[email protected] centosyum]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm 4 [[email protected] centosyum]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm
4.安装包:最后两个一起装,因为会检测依赖性。
1 [[email protected] centosyum]# rpm -ivh python-iniparse-0.4-9.el7.noarch.rpm 2 [[email protected] centosyum]# rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm 3 [[email protected] centosyum]# rpm -ivh yum-3.4.3-150.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm //这两个一起安装
5.创建repo,参考:
1 # CentOS-Base.repo 2 # 3 # The mirror system uses the connecting IP address of the client and the 4 # update status of each mirror to pick mirrors that are updated to and 5 # geographically close to the client. You should use this for CentOS updates 6 # unless you are manually picking other mirrors. 7 # 8 # If the mirrorlist= does not work for you, as a fall back you can try the 9 # remarked out baseurl= line instead. 10 # 11 # 12 [base] 13 name=CentOS-7 - Base - 163.com 14 #mirrorlist=http://mirrorlist.centos.org/?release=7&arch=$basearch&repo=os 15 baseurl=http://mirrors.163.com/centos/7/os/$basearch/ 16 gpgcheck=1 17 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 18 #released updates 19 [updates] 20 name=CentOS-7 - Updates - 163.com 21 #mirrorlist=http://mirrorlist.centos.org/?release=7&arch=$basearch&repo=updates 22 baseurl=http://mirrors.163.com/centos/7/updates/$basearch/ 23 gpgcheck=1 24 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 25 #additional packages that may be useful 26 [extras] 27 name=CentOS-7 - Extras - 163.com 28 #mirrorlist=http://mirrorlist.centos.org/?release=7&arch=$basearch&repo=extras 29 baseurl=http://mirrors.163.com/centos/7/extras/$basearch/ 30 gpgcheck=1 31 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 32 #additional packages that extend functionality of existing packages 33 [centosplus] 34 name=CentOS-7 - Plus - 163.com 35 baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/ 36 gpgcheck=1 37 enabled=0 38 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
6.
1 yum clean all 2 yum makecache //这条执行会较慢 3 yum repolist
时间: 2024-10-18 09:18:17