redhat中使用yum进行包管理时出现报错怎么办
本篇内容介绍了“redhat中使用yum进行包管理时出现报错怎么办”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!
创新互联是一家专业提供博山企业网站建设,专注与网站制作、成都网站建设、H5页面制作、小程序制作等业务。10年已为博山众多企业、政府机构等服务。创新互联专业网站建设公司优惠进行中。
在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)
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进行包管理时出现报错怎么办”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注创新互联网站,小编将为大家输出更多高质量的实用文章!
当前文章:redhat中使用yum进行包管理时出现报错怎么办
转载来于:http://cdiso.cn/article/gjshji.html