RedHat yum source configuration Ali

  • System version as follows uanme -a:
Linux localhost 2.6.32-431.20.3.el6.x86_64 #1 SMP Thu Jun 26 11:55:21 ICT 2014 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# yum update
Loaded plugins: axtu-plugin, security
Please register, or you can not connect to Asianux Update Server!
Setting up Update Process
No Packages marked for Update

1. Uninstall comes yum source

[root@localhost ~]# rpm -aq | grep yum | xargs rpm -e --nodeps
[root@localhost ~]# whereis yum
yum: /etc/yum
[root@localhost ~]# rm -rf /etc/yum

2. Download Ali yum install package

  • Here used CentOS6: Download
  • Execute commands, download the installation package (Updated 2019/07/22):
wget https://mirrors.aliyun.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm --no-check-certificate
wget https://mirrors.aliyun.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm --no-check-certificate
wget https://mirrors.aliyun.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm --no-check-certificate
wget https://mirrors.aliyun.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm --no-check-certificate

3. Installation Related rpm package yum

  • installationpython*
[root@localhost ~]# rpm -ivh python*
warning: python-iniparse-0.3.1-2.1.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
   1:python-iniparse        ########################################### [100%]
  • Installation yum*, if the following error
[root@localhost ~]#  rpm -ivh yum*
warning: yum-3.2.29-81.el6.centos.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
error: Failed dependencies:
    python-urlgrabber >= 3.9.1-10 is needed by yum-3.2.29-81.el6.centos.noarch

View system python information is below 3.9.1-19,

[root@localhost ~]# rpm -qa|grep python-url
python-urlgrabber-3.9.1-9.AXS4.noarch

Uninstallpython-urlgrabber-3.9.1-9.AXS4.noarch

[root@localhost ~]# rpm -e python-urlgrabber-3.9.1-9.el6.noarch
error: package python-urlgrabber-3.9.1-9.el6.noarch is not installed

download again

wget https://mirrors.aliyun.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm --no-check-certificate

Installation python-urlgrabber-3.9.1-11.el6.noarch.rpmif the following message appears:

[root@localhost ~]#rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm # 使用此方法安装可能会有如下提示信息
    file /usr/lib/python2.6/site-packages/urlgrabber/grabber.py from install of python-urlgrabber-3.9.1-11.el6.noarch conflicts with file from package python-urlgrabber-3.9.1-9.AXS4.noarch

You need to use to force the installation:

[root@localhost ~]# rpm -ivh --force python-urlgrabber-3.9.1-11.el6.noarch.rpm
warning: python-urlgrabber-3.9.1-11.el6.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
   1:python-urlgrabber      ########################################### [100%]
  • After completing the re-runrpm -ivh yum*
[root@localhost ~]# rpm -ivh yum*
warning: yum-3.2.29-81.el6.centos.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
   1:yum-metadata-parser    ########################################### [ 33%]
   2:yum-plugin-fastestmirro########################################### [ 67%]
   3:yum                    ########################################### [100%]

Ali cloud configure yum source

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
  • If yum listappears 404, then CentOS-Base.repothe $releaseverentire system is replaced with a version value
[root@localhost yum.repos.d]# sed -i 's/$releasever/6/g' /etc/yum.repos.d/CentOS-Base.repo
[root@localhost]# yum clean all
[root@localhost]# yum list

Reference links

Replace the Red Flag Linux: Asianux yum source of NetEase source
linux - rhel install yum

Guess you like

Origin www.cnblogs.com/zy37275/p/11300682.html