標籤:extend utils rhel redhat produced 最新 新版本 cti 1.3
1.首先查看redhat 7.0系統本身所安裝的那些yum 軟體包:
rpm -qa | grep yum #列出所有已安裝的yum包
2.刪除這些包:
rpm -e *.rpm --nodeps #刪除所有以前的yum包
3.下載新的yum rpm包:(2016/12/8 最新版本rpm,如果404 NOT FOUND錯誤,自己進去網址,換成最新的rpm包的名字)
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-132.el7.centos.0.1.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-34.el7.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-updateonboot-1.1.31-34.el7.noarch.rpm
wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm
4.安裝下載的rpm包:
rpm -ivh yum-*
5.配置CentOS-Base.repo:(2016/12/8 最新源網址配置)
vim /etc/yum.repos.d/CentOS-Base.repo
[base]
name=CentOS-7-Base
baseurl=http://mirrors.sohu.com/centos/7/os/x86_64/
gpgcheck=1
#released updates
[updates]
name=CentOS-7- Updates
baseurl=http://mirrors.163.com/centos/7/updates/x86_64/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
#packages used/produced in the build but not released
[addons]
name=CentOS-7- Addons
baseurl=http://mirrors.163.com/centos/7/sclo/x86_64/sclo/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-7- Extras
baseurl=http://mirrors.163.com/centos/7/extras/x86_64/
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
baseurl=http://mirrors.163.com/centos/7/centosplus/x86_64/
gpgcheck=1
enabled=0
6.yum源配置完成:
yum clean all
7.測試yum是否成功:
yum update python
報錯:You have enabled checking of packages via GPG keys. This is a good thing. However, you do not have any GPG public keys installed. You need to download the keys for packages you wish to install and install them. You can do that by running the command.
rpm --import public.gpg.key
.........
經查,是key的錯誤,解決方案是:
cd /etc/pki/rpm-gpg/
ls #列出所有密鑰
匯入以 release 結尾的密鑰
rpm --import PRM-GPG-KEY-redhat-legacy-release
8.經測試,yum成功:
yum update python #順利使用yum
rhel 7.0 配置centos yum源(2016/12/8),成功!