RedHat(小紅帽)下 yum用不了的解決辦法
阿新 • • 發佈:2018-12-27
由於RedHat是商業版的,通常由於沒有註冊,導致yum程式無法使用(linux下面,yum是個安裝軟體的“神器”)。此時可用CentOS的地址進行替換。下面將一步步說明如何處理:
一、刪除RedHat自帶的yum相關檔案
1、檔案位置:/etc/yum.conf和/etc/yum.repo.d/rhel-debuginfo.repo;
2、可以通過FTP方式刪除,或者直接採用命令。
二、重新配置yum相關檔案
1、配置yum.conf,建立yum.conf檔案,再進行編輯即可;
yum.conf內容,可直接拷貝,如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 | [main] cachedir=/var/cache/yum keepcache=1 debuglevel=2 logfile=/var/log/yum.log pkgpolicy=newest distroverpkg=redhat-release tolerant=1 exactarch=1 obsoletes=1 gpgcheck=1 plugins=1 metadata_expire=1800 |
貼上完成後,儲存後即可。可通過命令檢視,是否一致。
2、配置rhel-debuginfo.repo,建立rhel-debuginfo.repo檔案,再進行編輯即可(本文以CentOS5 64位地址為準);
具體操作,同1,這裡只把內容展示如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
[ base ]
name=centos-5
- Base
baseurl=http: //centos.ustc.edu.cn/centos/5/os/x86_64/
#
the other site: #
you can find more site in: ?id=13
enabled=1
gpgcheck=1
gpgkey=http: //centos.ustc.edu.cn/centos/5/os/x86_64/RPM-GPG-KEY-CentOS-5
#released
updates
[update]
name=CentOS-5
- Updates
baseurl=http: //mirror.centos.org/centos/5/updates/x86_64/
gpgcheck=1
gpgkey=http: //centos.ustc.edu.cn/centos/5/os/x86_64/RPM-GPG-KEY-CentOS-5
#packages
used/produced in the build but not released
[addons]
name=CentOS-5
- Addons
baseurl=http: //mirror.centos.org/centos/5/addons/$basearch/
gpgcheck=1
gpgkey=http: //centos.ustc.edu.cn/centos/5/os/x86_64/RPM-GPG-KEY-CentOS-5
#additional
packages that may be useful
[extras]
name=CentOS-5
- Extras
baseurl=http: //mirror.centos.org/centos/5/extras/$basearch/
gpgcheck=1
gpgkey=http: //mirror.centos.org/centos/RPM-GPG-KEY-centos4
#additional
packages that extend functionality of existing packages
[centosplus]
name=CentOS-5
- Plus
baseurl=http: //mirror.centos.org/centos/5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http: //centos.ustc.edu.cn/centos/5/os/x86_64/RPM-GPG-KEY-CentOS-5
#contrib
- packages by Centos Users
[contrib]
name=CentOS-5
- Contrib
baseurl=http: //mirror.centos.org/centos/5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http: //centos.ustc.edu.cn/centos/5/os/x86_64/RPM-GPG-KEY-CentOS-5
#packages
in testing
[testing]
name=CentOS-5
- Testing
baseurl=http: //mirror.centos.org/centos/5/testing/$basearch/
gpgcheck=1
enabled=0
gpgkey=http: //centos.ustc.edu.cn/centos/5/os/x86_64/RPM-GPG-KEY-CentOS-5
|