RedHat之yum解决办法

使用场景:

在未注册的linux上学习相关操作时,有时基于yum来安装软件依赖环境等非常便捷,因此特提供此处理方式。仅限于个人学习使用,特此声明!

1.卸载redhat自带的yum组件

rpm -qa|grep yum|xargs rpm -e --nodeps

2.安装centos的yum包

wget  http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm

[[email protected] opt]# rpm -ivh yum-3.2.22-40.el5.centos.noarch.rpm

warning: yum-3.2.22-40.el5.centos.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897

error: Failed dependencies:

yum-fastestmirror is needed by yum-3.2.22-40.el5.centos.noarch

yum-metadata-parser >= 1.1.0 is needed by yum-3.2.22-40.el5.centos.noarch

需要安装依赖包,因此分别下载并安装依赖包

[[email protected] opt]# wget  http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-4.el5.x86_64.rpm

[[email protected] opt]# wget  http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm

两个包相互依赖,一并安装解决

[[email protected] opt]# rpm -ivh yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm  yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm

warning: yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897

error: Failed dependencies:

yum >= 3.0 is needed by yum-fastestmirror-1.1.16-21.el5.centos.noarch

[[email protected] opt]# rpm -ivh yum-3.2.22-40.el5.centos.noarch.rpm yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm

warning: yum-3.2.22-40.el5.centos.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897

Preparing...                ########################################### [100%]

1:yum-fastestmirror      ########################################### [ 50%]

2:yum                    ########################################### [100%]

3. 下载更新源,并存放在系统目录中

wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo

mv CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo

4. 更新yum 资源库

yum makecache

[[email protected] opt]# yum makecache

Loaded plugins: fastestmirror, product-id, subscription-manager

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Determining fastest mirrors

addons                                                   | 1.9 kB     00:00

addons/filelists_db                                      |  570 B     00:00

addons/other_db                                          |  554 B     00:00

addons/primary_db                                        | 1.1 kB     00:00

base                                                     | 1.1 kB     00:00

base/filelists                                           | 3.7 MB     00:20

base/other                                               |  14 MB     01:14

base/group                                               | 1.1 MB     00:06

base/primary                                             | 1.3 MB     00:07

extras                                                   | 2.1 kB     00:00

extras/filelists_db                                      | 224 kB     00:01

extras/other_db                                          | 442 kB     00:02

extras/group                                             | 9.7 kB     00:00

extras/primary_db                                        | 173 kB     00:00

update                                                   | 1.9 kB     00:00

update/filelists_db                                      | 1.1 MB     00:06

update/other_db                                          | 6.3 MB     00:34

update/primary_db                                        | 282 kB     00:01

base                                                                  3667/3667

base                                                                  3667/3667

base                                                                  3667/3667

Metadata Cache Created

5.有需要可以yum -y update

时间: 2024-08-05 13:43:23

RedHat之yum解决办法的相关文章

No module named yum解决办法

(1)错误提示: [[email protected] ~]# yum -y install kernel-debuginfo-common-2.6.18-238.el5 There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: No module named yum Please install a package whi

telnet到RedHat Linux失败--解决办法

失败原因: 1.telnet包未安装,检查telnet包是否安装: [[email protected] root]# rpm -qa telnet telnet-0.17-25 表示已安装 2.telnet包已安装,telnet-server未安装,检查telnet-server包是否安装: [[email protected] root]# rpm -qa telnet-server telnet-server-0.17-25 表示已安装 3.telnet配置文件问题: [[email pr

转:CentOS系统yum源配置修改、yum安装软件包源码包出错解决办法!

yum安装包时报错: Could not retrieve mirrorlist http://mirrorlist.repoforge.org/el6/mirrors-rpmforge error was 14: PYCURL ERROR 7 - "couldn't connect to host" http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/repodata/repomd.xml: [Errno 14] PYCURL ERROR 7

yum报错:This system is not registered to Red Hat Subscription Management.解决办法

使用yum安装软件,报错如下: [[email protected] ~]# yum -y install mariadbLoaded plugins: langpacks, product-id, subscription-managerThis system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.No package mariadb

YUM安装提示PYCURL ERROR 6 - "Couldn't错误的解决办法

当编译PHP时出现如下错误时,找不到头绪 这时,打开DNS   vim /etc/resolv.conf   添加一行nameserver 192.168.1.1 完成上一步,则解决该问题 YUM安装提示PYCURL ERROR 6 - "Couldn't错误的解决办法

Centos6.3不能使用yum install安装gcc编辑器解决办法

mv /var/lib/rpm/__db* /tmp rpm --rebuilddb yum clean all Centos6.3不能使用yum install安装gcc编辑器解决办法,布布扣,bubuko.com

误删libgcc导致yum或rpm无法操作的解决办法

误删libgcc,导致yum或者rpm: error while loading shared libraries: libgcc_s.so.1: cannot open shared object file: No such file or directory 解决办法 uname -a  ##查看你的系统是32位还是64 scp /lib64/libgcc_s-4.4.6-20110824.so.1 10.10.10.10:/lib64/  ##假设你的系统是64位 cd /lib64/  

CentOS yum时出现“Could not retrieve mirrorlist ”的解决办法——resolv.conf的配置

原因:没有配置resolv.conf 解决方法: 到/etc目录下配置resolv.conf加入nameserver IP,如: nameserver 8.8.8.8 nameserver 8.8.4.4 search localdomain 保存再次运行上面命令就可以. 关键一点  serach那一行要在nameserver的后面 CentOS yum时出现"Could not retrieve mirrorlist "的解决办法--resolv.conf的配置,布布扣,bubuko

No module named yum错误的解决办法

今天用yum安装软件的时候出现如下错误: There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: No module named yum Please install a package which provides this module, or verify that the module is installed c