zoukankan      html  css  js  c++  java
  • yum命令不能使用的相关错误

    yum (Yellowdog Updater Modified)是一个集与查找,安装,更新和删除程序的Linux软件。它运行在RPM包兼容的Linux发行版本上,如:RedHat, Fedora, SUSE, CentOS, Mandriva。

    最近安装了CentOS5.5操作系统,在使用yum命令安装的时候出现如下错误:


    一、yum 安装软件时,报错:No package XXX available.

    [root@localhost ~]# yum -y install redis
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * addons: mirrors.163.com
     * base: mirrors.163.com
     * extras: mirrors.163.com
     * updates: mirrors.163.com
    Setting up Install Process
    No package redis available.
    Nothing to do

    解决方法:

    1).先去更新一下yum仓库:
    #yum -y update


    2).如果还是不行,可能是你安装的时候包名不够详细,可以通过yum的查找参数来列出对应软件的相关包名,拿vim的安装为例:

    # yum search vim
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    * base: mirror.hosting90.cz
    * extras: mirror.hosting90.cz
    * updates: mirror.hosting90.cz
    ===================== Matched: vim ===================
    vim-X11.x86_64 : The VIM version of the vi editor for the X Window System.
    vim-common.x86_64 : The common files needed by any version of the VIM editor.
    vim-enhanced.x86_64 : A version of the VIM editor which includes recent
    : enhancements.

    vim-minimal.x86_64 : A minimal version of the VIM editor.

    找到包名后,执行以下命令即可:

    #yum -y install vim-enhanced.x86_64
    以上命令就能执行成功了。

    其他程序也同样可以先进行yum查找,再通过匹配详细包名来进行安装,就不会出现上述错误了。


    3)如果还是不行,应该是 EPEL未被启动,且指示的 rpm包不可用
    具体原因:使用yum搜索某些rpm包,找不到包是因为CentOS是RedHat企业版编译过来的,去掉了所有关于版权问题的东西。安装EPEL后可以很好的解决这个问题。EPEL(Extra Packages for Enterprise Linux )即企业版Linux的扩展包,提供了很多可共Centos使用的组件,安装完这个以后基本常用的rpm都可以找到。
    下载与安装EPEL的rpm文件包
    1.下载:
    #wget http://mirrors.ustc.edu.cn/fedora/epel/5/i386/epel-release-5-4.noarch.rpm
    2.安装:
    #rpm -ivh epel-release-5-4.noarch.rpm
    安装完毕后,可以使用yum安装软件。

    注意:

    1. epel的版本要与centos的版本相对应,否则安装失败,即centos5版本要对应epel5版本。

    2. rpm安装完后,rpm -ql  epel*,确提示未安装,此时要导入rpm的签名信息

    #rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 (root身份执行)


    二、YUM 提示 Segmentation fault (段错误)
    本来用得好好的yum命令,突然不能用了,报出:Segmentation fault (段错误)。
    通过一番查找,原因终于找到:是有人在服务器上安装了新版本的zlib包,正巧我执行过”#yum clean all”命令。
    解决办法:
    #vi /etc/ld.so.conf,注释掉对应的行:/usr/local/zlib/lib
    #ldconfig
    #yum update
    yum完全恢复正常。

    说明:yum使用的是老版本的 zlib 库。如果有用户再一次清除了 yum 缓存,那么再使用yum安装软件时依然会报段错误。


    三、执行yum update,报如下错误:
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
    14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"

    Error: Cannot find a valid baseurl for repo: base

    原因是:DNS未配置好;
    解决方案:重新配置DNS;
    #vi /etc/resolv.conf
    编辑文件内容为:
    search localdomain
    nameserver 202.101.172.35
    nameserver 202.101.172.47  
    保存并退出;
    #service network restart   

    重启网卡。

  • 相关阅读:
    SpringMVC源码阅读-通过画图理解初始化(十一)
    通过Stratus 服务器在Flash Player中使用RTMFP 开发P2P应用
    Lucene 学习资料
    LIRe 源代码分析 3:基本接口(ImageSearcher)
    LIRe 源代码分析 2:基本接口(DocumentBuilder)
    LIRe 源代码分析 1:整体结构
    Media Player Classic
    ffdshow 源代码分析 5: 位图覆盖滤镜(总结)
    ITU-T Technical Paper: 测量QoS的基本网络模型
    ITU-T Technical Paper: QoS 测量 (目标,方法,协议)
  • 原文地址:https://www.cnblogs.com/xiaoxu6/p/6694097.html
Copyright © 2011-2022 走看看