rhel 7.0 配置centos yum源(2016/12/8),成功!

來源:互聯網
上載者:User

標籤: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),成功!

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.