zoukankan      html  css  js  c++  java
  • Linux CentOS 6不能使用yum安装命令

    1. 当前CenOS 系统是2.6版本的, 在安装python-requests模块时,报错:

    [root@tester pluginconf.d]# uname -a
    Linux tester 2.6.32-431.23.3.el6.x86_64 #1 SMP Thu Jul 31 17:20:51 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

    root@tester yum.repos.d]# yum install python-requests -y
    Loaded plugins: security
    Setting up Install Process
    Repository rabbitmq_erlang is listed more than once in the configuration
    Repository rabbitmq_erlang-source is listed more than once in the configuration
    http://mirrors.aliyun.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    To address this issue please refer to the below wiki article

    https://wiki.centos.org/yum-errors

    If above article doesn't help to resolve this issue please use https://bugs.centos.org/.

    http://mirrors.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://mirrors.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: (28, 'connect() timed out!')
    Trying other mirror.
    http://mirrors.cloud.aliyuncs.com/centos/6/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.
    Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
    [root@tester yum.repos.d]#

    2. 百度说 2020年12月2号之后,CentOS 6更新包下架了,导致找不到更新软件而失败。

    3. 备份下面2个文件

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

    4. 到阿里云上下载CenOS 7的 CentOS-Base.repo文件和

    阿里云网址:https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.3e221b11sjf0dJ 下载CentOS-Base.repo
    wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

    阿里云网址:https://developer.aliyun.com/mirror/epel?spm=a2c6h.13651102.0.0.3e221b11p0e5G5下载epel.report
    wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo



    然后使用vi编辑器,将CentOS-Base.repo文件中$releasever全部改成7, 因为这个参数获得的是当前系统的版本6

    cd /etc/yum.repos.d
    vi CentOS-Base.repo
    :%s/$releasever/7/g #将文件中$releasever全部改成7

    5. 清除缓存:
    [root@tester yum.repos.d]# yum clean all
    [root@tester yum.repos.d]# yum makecache

    6. 再运行yum install python-requsts -y 就可以执行了, 不过最后出现了其它的安装错误,信息如下, 搞不定了

    --> Processing Dependency: python(abi) = 2.6 for package: python-iwlib-0.1-1.2.el6.x86_64
    ---> Package python-libs.x86_64 0:2.6.6-52.el6 will be updated
    --> Processing Dependency: libpython2.6.so.1.0()(64bit) for package: python-iwlib-0.1-1.2.el6.x86_64
    ---> Package upstart.x86_64 0:0.6.5-13.el6_5.3 will be obsoleted
    --> Processing Dependency: upstart for package: 1:readahead-1.5.6-2.el6.x86_64
    ---> Package zabbix-agent.x86_64 0:3.4.15-1.el6 will be an update
    --> Processing Dependency: libpcre.so.0()(64bit) for package: zabbix-agent-3.4.15-1.el6.x86_64
    --> Processing Dependency: /sbin/new-kernel-pkg for package: kernel-2.6.32-431.23.3.el6.x86_64
    --> Restarting Dependency Resolution with new changes.
    Error: Depsolving loop limit reached.
    Error: Package: python-iwlib-0.1-1.2.el6.x86_64 (@anaconda-CentOS-201311291202.x86_64/6.5)
    Requires: python(abi) = 2.6
    Removing: python-2.6.6-52.el6.x86_64 (@updates)
    python(abi) = 2.6
    Updated By: python-2.7.5-90.el7.x86_64 (updates)
    python(abi) = 2.7
    python(abi) = 2.7
    Available: python-2.7.5-89.el7.x86_64 (base)
    python(abi) = 2.7
    python(abi) = 2.7
    Available: python3-3.6.8-17.el7.i686 (base)
    python(abi) = 3.6
    python(abi) = 3.6
    Available: python3-3.6.8-18.el7.i686 (updates)
    python(abi) = 3.6
    python(abi) = 3.6
    Available: python34-3.4.10-7.el7.x86_64 (epel)
    python(abi) = 3.4
    Error: Package: ppl-0.10.2-11.el6.x86_64 (@anaconda-CentOS-201311291202.x86_64/6.5)
    Requires: libgmp.so.3()(64bit)
    Removing: gmp-4.3.1-7.el6_2.2.x86_64 (@anaconda-CentOS-201311291202.x86_64/6.5)
    libgmp.so.3()(64bit)
    Updated By: 1:gmp-6.0.0-15.el7.x86_64 (base)
    Not found
    Error: Package: cloog-ppl-0.15.7-1.2.el6.x86_64 (@anaconda-CentOS-201311291202.x86_64/6.5)
    Requires: libgmp.so.3()(64bit)
    Removing: gmp-4.3.1-7.el6_2.2.x86_64 (@anaconda-CentOS-201311291202.x86_64/6.5)
    libgmp.so.3()(64bit)
    Updated By: 1:gmp-6.0.0-15.el7.x86_64 (base)
    Not found
    Error: Package: hal-info-20090716-3.1.el6.noarch (@anaconda-CentOS-201311291202.x86_64/6.5)
    Requires: hal >= 0.5.10
    Removing: hal-0.5.14-11.el6.x86_64 (@anaconda-CentOS-201311291202.x86_64/6.5)
    hal = 0.5.14-11.el6
    Obsoleted By: systemd-219-78.el7_9.3.x86_64 (updates)
    Not found
    Error: Package: 2:postfix-2.10.1-9.el7.x86_64 (base)
    Requires: libmysqlclient.so.18(libmysqlclient_18)(64bit)
    Available: 1:mariadb-libs-5.5.68-1.el7.x86_64 (base)
    libmysqlclient.so.18(libmysqlclient_18)(64bit)
    Error: Package: python-iwlib-0.1-1.2.el6.x86_64 (@anaconda-CentOS-201311291202.x86_64/6.5)
    Requires: libpython2.6.so.1.0()(64bit)
    Removing: python-libs-2.6.6-52.el6.x86_64 (@updates)
    libpython2.6.so.1.0()(64bit)
    Updated By: python-libs-2.7.5-90.el7.x86_64 (updates)
    Not found
    Error: Package: 1:readahead-1.5.6-2.el6.x86_64 (@anaconda-CentOS-201311291202.x86_64/6.5)
    Requires: upstart
    Removing: upstart-0.6.5-13.el6_5.3.x86_64 (@updates)
    upstart = 0.6.5-13.el6_5.3
    Obsoleted By: systemd-219-78.el7_9.3.x86_64 (updates)
    Not found
    Error: Package: libgcj-4.4.7-4.el6.x86_64 (@anaconda-CentOS-201311291202.x86_64/6.5)
    Requires: libgmp.so.3()(64bit)
    Removing: gmp-4.3.1-7.el6_2.2.x86_64 (@anaconda-CentOS-201311291202.x86_64/6.5)
    libgmp.so.3()(64bit)
    Updated By: 1:gmp-6.0.0-15.el7.x86_64 (base)
    Not found
    Error: Package: 2:postfix-2.10.1-9.el7.x86_64 (base)
    Requires: libmysqlclient.so.18()(64bit)
    Available: 1:mariadb-libs-5.5.68-1.el7.x86_64 (base)
    libmysqlclient.so.18()(64bit)
    Error: Package: mysql-community-server-5.7.33-1.el6.x86_64 (mysql57-community)
    Requires: libsasl2.so.2()(64bit)
    Removing: cyrus-sasl-lib-2.1.23-13.el6_3.1.x86_64 (@anaconda-CentOS-201311291202.x86_64/6.5)
    libsasl2.so.2()(64bit)
    Updated By: cyrus-sasl-lib-2.1.26-23.el7.x86_64 (base)
    Not found
    Error: Package: zabbix-agent-3.4.15-1.el6.x86_64 (zabbix)
    Requires: libpcre.so.0()(64bit)
    Removing: pcre-7.8-7.el6.x86_64 (@base)
    libpcre.so.0()(64bit)
    Updated By: pcre-8.32-17.el7.x86_64 (base)
    Not found

    You could try using --skip-broken to work around the problem
    ** Found 2 pre-existing rpmdb problem(s), 'yum check' output follows:
    2:postfix-2.6.6-6.el6_5.x86_64 has missing requires of libmysqlclient.so.16()(64bit)
    2:postfix-2.6.6-6.el6_5.x86_64 has missing requires of libmysqlclient.so.16(libmysqlclient_16)(64bit)

    ********重大好消息*********: 最终用自己生成的 CentOS-Base.repo , epel.repo 文件,使用搜狐的镜像,可以成功更新了:

    (1)先备份原先的 CentOS-Base.repo , epel.repo ,用vi编辑器生成下面内容的两个文件,

    [root@tester yum.repos.d]# cat CentOS-Base.repo
    [base]
    name=CentOS-6
    failovermethod=priority
    baseurl=https://vault.centos.org/6.9/os/x86_64/
    url=http://mirrors.sohu.com/centos/6.10/os/x86_64/
    gpgcheck=1

    [root@tester yum.repos.d]# cat epel.repo
    [epel]
    name=sohu-epel
    baseurl=http://mirrors.sohu.com/fedora-epel/6/$basearch
    failovermethod=priority
    enabled=1
    gpgcheck=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
    [root@tester yum.repos.d]#

    (2)然后执行:  yum clean all   

                              yum makecache

    (3) 再执行yum install python-requests -y 安装命令就可以顺利执行完了。

    感谢 这些链接的 同学们:

    https://blog.51cto.com/hcymysql/2567297  建议用搜狐的源来下载  ,目前国内 搜狐的镜像源还有CentOS 6的下载文件。

    https://www.xmpan.com/944.html

    https://www.cnblogs.com/binbingg/p/14082610.html

    https://vault.centos.org/6.9/os/x86_64/

        The contents of this directory have been moved to our archives available at:

        http://archives.fedoraproject.org/pub/archive/epel/     ===这里的镜像源文件可用

    If you are having troubles finding something there please stop by #epel on irc.freenode.net

     
  • 相关阅读:
    Java的错误类型
    交换两个变量的值
    变量的自增、自减、自乘、自除运算
    通过Scanner从控制台获取数据
    通过args数组获取数据
    int类型与char类型的转换
    大类型向小类型转换
    小类型向大类型转换
    6 高级2 自连接 视图
    5 高级 关系 连接
  • 原文地址:https://www.cnblogs.com/tonyxiao/p/14420564.html
Copyright © 2011-2022 走看看