您好,登錄后才能下訂單哦!
本篇內容介紹了“redhat中使用yum進行包管理時出現報錯怎么辦”的有關知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領大家學習一下如何處理這些情況吧!希望大家仔細閱讀,能夠學有所成!
在redhat中使用yum進行包管理時, 遇到以下錯誤:
[root@localhost Server]# yum install sudo
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
No package sudo available.
Nothing to do
解決方案:
1. 卸載redhat的yum包
[root@localhost Server]# rpm -qa | grep yum
yum-updatesd-0.9-2.el5
yum-security-1.1.16-13.el5
yum-metadata-parser-1.1.2-3.el5
yum-3.2.22-20.el5
yum-rhn-plugin-0.5.4-13.el5
[root@localhost Server]# rpm -e --nodeps yum-updatesd-0.9-2.el5 yum-security-1.1.16-13.el5 yum-metadata-parser-1.1.2-3.el5 yum-3.2.22-20.el5 yum-rhn-plugin-0.5.4-13.el5
2. 切換到要yum包保存的目錄中
[root@localhost Server]# cd /software/share
3. 下載centos的yum包
[root@localhost share]# wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm
--2013-11-15 04:35:16-- http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm
Resolving centos.ustc.edu.cn... 202.141.160.110, 2001:da8:d800:95::110
Connecting to centos.ustc.edu.cn|202.141.160.110|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1034960 (1011K) [application/x-redhat-package-manager]
Saving to: `yum-3.2.22-40.el5.centos.noarch.rpm'
100%[====================================================================>] 1,034,960 1.54M/s in 0.6s
2013-11-15 04:35:16 (1.54 MB/s) - `yum-3.2.22-40.el5.centos.noarch.rpm' saved [1034960/1034960]
[root@localhost share]# wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
--2013-11-15 04:37:16-- http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
Resolving centos.ustc.edu.cn... 202.141.160.110, 2001:da8:d800:95::110
Connecting to centos.ustc.edu.cn|202.141.160.110|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 21033 (21K) [application/x-redhat-package-manager]
Saving to: `yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm'
100%[====================================================================>] 21,033 --.-K/s in 0.03s
2013-11-15 04:37:16 (709 KB/s) - `yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm' saved [21033/21033]
[root@localhost share]# wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-4.el5.i386.rpm
--2013-11-15 04:38:08-- http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-4.el5.i386.rpm
Resolving centos.ustc.edu.cn... 202.141.160.110, 2001:da8:d800:95::110
Connecting to centos.ustc.edu.cn|202.141.160.110|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 26164 (26K) [application/x-redhat-package-manager]
Saving to: `yum-metadata-parser-1.1.2-4.el5.i386.rpm'
100%[====================================================================>] 26,164 --.-K/s in 0.04s
2013-11-15 04:38:08 (575 KB/s) - `yum-metadata-parser-1.1.2-4.el5.i386.rpm' saved [26164/26164]
4.安裝centos的yum包
[root@localhost share]# rpm -ivh yum-*
warning: yum-3.2.22-40.el5.centos.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:yum-metadata-parser ########################################### [ 33%]
2:yum-fastestmirror ########################################### [ 67%]
3:yum ########################################### [100%]
5.下載CentOS-Base.repo
[root@localhost share]# wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
--2013-11-15 04:41:48-- http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
Resolving docs.linuxtone.org... 117.79.157.57
Connecting to docs.linuxtone.org|117.79.157.57|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1426 (1.4K) [application/octet-stream]
Saving to: `CentOS-Base.repo'
100%[================================================================================>] 1,426 --.-K/s in 0s
2013-11-15 04:41:49 (133 MB/s) - `CentOS-Base.repo' saved [1426/1426]
6.將repo移動到相應的目錄
[root@localhost share]# mv CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo
7.制作緩存
[root@localhost share]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
addons | 1.9 kB 00:00
addons/filelists_db | 574 B 00:00
addons/other_db | 550 B 00:00
addons/primary_db | 1.1 kB 00:00
base | 1.1 kB 00:00
base/filelists | 3.1 MB 00:01
base/other | 11 MB 00:08
base/group | 1.1 MB 00:00
base/primary | 995 kB 00:00
extras | 2.1 kB 00:00
extras/filelists_db | 211 kB 00:00
extras/other_db | 431 kB 00:00
extras/group | 9.7 kB 00:00
extras/primary_db | 164 kB 00:00
update | 1.9 kB 00:00
update/filelists_db | 522 kB 00:00
update/other_db | 2.5 MB 00:01
update/primary_db | 109 kB 00:00
base 2789/2789
base 2789/2789
base 2789/2789
Metadata Cache Created
8. 至此, 可以正常使用yum進行install操作了
[root@localhost share]# yum install sudo
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package sudo.i386 0:1.7.2p1-28.el5 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
==========================================================================================================================
Package Arch Version Repository Size
==========================================================================================================================
Installing:
sudo i386 1.7.2p1-28.el5 base 357 k
Transaction Summary
==========================================================================================================================
Install 1 Package(s)
Upgrade 0 Package(s)
Total download size: 357 k
Is this ok [y/N]: y
Downloading Packages:
sudo-1.7.2p1-28.el5.i386.rpm | 357 kB 00:00
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897
base/gpgkey | 1.5 kB 00:00
Importing GPG key 0xE8562897 "CentOS-5 Key (CentOS 5 Official Signing Key) <centos-5-key@centos.org>" from http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : sudo 1/1
Installed:
sudo.i386 0:1.7.2p1-28.el5
Complete!
“redhat中使用yum進行包管理時出現報錯怎么辦”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業相關的知識可以關注億速云網站,小編將為大家輸出更多高質量的實用文章!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。