Linux下安装yum工具

在 CentOS 操作系统中,用户尝试使用 yum 命令进行软件包安装和更新,但遇到了一系列错误。文章详细记录了从未注册 RHN 到成功安装和更新所需的 yum 相关包的过程,包括解决依赖问题、下载和安装特定 rpm 包等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

[root@localhost ~]# yum -y install fonts-chinese
Loading "rhnplugin" plugin
Loading "security" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Parsing package install arguments
No package fonts-chinese available.
Nothing to do
[root@localhost ~]# yum update
Loading "rhnplugin" plugin
Loading "security" plugin
This system is not registered with RHN.
RHN support will be disabled.
Skipping security plugin, no data
Setting up Update Process
Skipping security plugin, no data
Skipping security plugin, no data
No Packages marked for Update
[root@localhost ~]# yum install 
Loading "rhnplugin" plugin
Loading "security" plugin
This system is not registered with RHN.
RHN support will be disabled.
Error: Need to pass a list of pkgs to install
usage: yum [options] < grouplist, localinstall, groupinfo, localupdate, resolvedep, erase, deplist, groupremove, makecache, upgrade, list-security, provides, shell, install, whatprovides, groupinstall, update, repolist, groupupdate, info, search, check-update, list-sec, list, remove, info-sec, clean, info-security, grouperase >

options:
  -h, --help            show this help message and exit
  -t, --tolerant        be tolerant of errors
  -C                    run entirely from cache, don't update cache
  -c  [config file]     config file location
  -R  [minutes]         maximum command wait time
  -d  [debug level]     debugging output level
  -e  [error level]     error output level
  -q, --quiet           quiet operation
  -v, --verbose         verbose operation
  -y                    answer yes for all questions
  --version             show Yum version and exit
  --installroot=[path]  set install root
  --enablerepo=[repo]   enable one or more repositories (wildcards allowed)
  --disablerepo=[repo]  disable one or more repositories (wildcards allowed)
  -x [package], --exclude=[package]
                        exclude package(s) by name or glob
  --disableexcludes=[repo]
                        disable exclude from main, for a repo or for
                        everything
  --obsoletes           enable obsoletes processing during updates
  --noplugins           disable Yum plugins
  --nogpgcheck          disable gpg signature checking
  --disableplugin=[plugin]
                        disable plugins by name
  --security            Include security relevant packages
  --cve=CVE             Include packages needed to fix the given CVE
  --bz=BZ               Include packages needed to fix the given BZ
  --advisory=ADVISORY   Include packages needed to fix the given advisory
[root@localhost ~]# yum -versioin
Loading "rhnplugin" plugin
Loading "security" plugin
usage: yum [options] < grouplist, localinstall, groupinfo, localupdate, resolvedep, erase, deplist, groupremove, makecache, upgrade, provides, shell, install, whatprovides, groupinstall, update, repolist, groupupdate, info, search, check-update, list, remove, clean, grouperase >

Command line error: option -e: invalid integer value: 'rsioin'
[root@localhost ~]# yum -version
Loading "rhnplugin" plugin
Loading "security" plugin
usage: yum [options] < grouplist, localinstall, groupinfo, localupdate, resolvedep, erase, deplist, groupremove, makecache, upgrade, provides, shell, install, whatprovides, groupinstall, update, repolist, groupupdate, info, search, check-update, list, remove, clean, grouperase >

Command line error: option -e: invalid integer value: 'rsion'
[root@localhost ~]# yum install yum-fastestmirror
Loading "rhnplugin" plugin
Loading "security" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Parsing package install arguments
No package yum-fastestmirror available.
Nothing to do
[root@localhost ~]# yum install httpd
Loading "rhnplugin" plugin
Loading "security" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Parsing package install arguments
No package httpd available.
Nothing to do
[root@localhost ~]# rpm -qa|grep yum|xargs rpm -e --nodeps
[root@localhost ~]# rpm -qa |grep yum
[root@localhost ~]# wget   http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
--02:30:56--  http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.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... 404 Not Found
02:30:56 ERROR 404: Not Found.

[root@localhost ~]# wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-4.el5.x86_64.rpm
--02:33:37--  http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-4.el5.x86_64.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: 26027 (25K) [application/x-redhat-package-manager]
Saving to: `yum-metadata-parser-1.1.2-4.el5.x86_64.rpm'

100%[=======================================>] 26,027      --.-K/s   in 0.06s  

02:33:37 (406 KB/s) - `yum-metadata-parser-1.1.2-4.el5.x86_64.rpm' saved [26027/26027]

[root@localhost ~]# wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
--02:34:30--  http://centos.ustc.edu.cn/centos/5/os/x86_64/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.06s  

02:34:30 (332 KB/s) - `yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm' saved [21033/21033]

[root@localhost ~]# wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm
--02:34:57--  http://centos.ustc.edu.cn/centos/5/os/x86_64/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    848K/s   in 1.2s   

02:34:58 (848 KB/s) - `yum-3.2.22-40.el5.centos.noarch.rpm' saved [1034960/1034960]

[root@localhost ~]# rpm -ivh yum-*
warning: yum-3.2.22-40.el5.centos.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
error: Failed dependencies:
        libc.so.6()(64bit) is needed by yum-metadata-parser-1.1.2-4.el5.x86_64
        libc.so.6(GLIBC_2.2.5)(64bit) is needed by yum-metadata-parser-1.1.2-4.el5.x86_64
        libglib-2.0.so.0()(64bit) is needed by yum-metadata-parser-1.1.2-4.el5.x86_64
        libm.so.6()(64bit) is needed by yum-metadata-parser-1.1.2-4.el5.x86_64
        libpthread.so.0()(64bit) is needed by yum-metadata-parser-1.1.2-4.el5.x86_64
        libsqlite3.so.0()(64bit) is needed by yum-metadata-parser-1.1.2-4.el5.x86_64
        libxml2.so.2()(64bit) is needed by yum-metadata-parser-1.1.2-4.el5.x86_64
        libz.so.1()(64bit) is needed by yum-metadata-parser-1.1.2-4.el5.x86_64
[root@localhost ~]#  file /bin/ls
/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped
[root@localhost ~]# rpm -qa|grep yum
[root@localhost ~]# ls
anaconda-ks.cfg     yum-3.2.22-40.el5.centos.noarch.rpm
Desktop             yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
install.log         yum-metadata-parser-1.1.2-4.el5.x86_64.rpm
install.log.syslog
[root@localhost ~]# rim yum-*.rpm
bash: rim: command not found
[root@localhost ~]# rm yum-*.rpm
rm: remove regular file `yum-3.2.22-40.el5.centos.noarch.rpm'? y
rm: remove regular file `yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm'? y
rm: remove regular file `yum-metadata-parser-1.1.2-4.el5.x86_64.rpm'? y
[root@localhost ~]# ls
anaconda-ks.cfg  Desktop  install.log  install.log.syslog
[root@localhost ~]# wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm
--02:38:42--  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.07M/s   in 0.9s   

02:38:43 (1.07 MB/s) - `yum-3.2.22-40.el5.centos.noarch.rpm' saved [1034960/1034960]

[root@localhost ~]# wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-4.el5.i386.rpm
--02:38:59--  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.06s  

02:38:59 (453 KB/s) - `yum-metadata-parser-1.1.2-4.el5.i386.rpm' saved [26164/26164]

[root@localhost ~]# wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
--02:39:18--  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.06s  

02:39:19 (331 KB/s) - `yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm' saved [21033/21033]

[root@localhost ~]# pm -ivh yum-*
bash: pm: command not found
[root@localhost ~]# 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%]
[root@localhost ~]# wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
--02:40:08--  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     

02:40:09 (192 MB/s) - `CentOS-Base.repo' saved [1426/1426]

[root@localhost ~]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
Metadata Cache Created


 

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值