• linux centos&Ubuntu&RedHat更换软件源


    linux三大版本更换软件源

    前排提示,有的源可能已经失效,如果发现请留言或自行寻找其他源。

    1.centos

    mv /etc/yum.repos.d/CentOS-Base.repo [--path]
    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
    yum clean all
    yum makecache

    2.Ubuntu

    备份原有软件源sudo cp /etc/apt/sources.list <路径>
    sudo vi /etc/apt/sources.list
    修改为以下:

    deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

    deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

    deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

    deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

    deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

    deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

    执行更新源sudo apt update

    如果有其他错误,可以执行 

    sudo rm -rf /var/lib/dpkg/info
    sudo mkdir /var/lib/dpkg/info

    3.RedHat(红帽)更换yum源。

    鉴于红帽的软件源需要注册,可以更换为centos的yum。

    删除自带的yum

    rpm -aq | grep yum | xargs rpm -e –nodeps 

    wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm 

    wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm

    wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm

    wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-updateonboot-1.1.30-41.el6.noarch.rpm

    wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

    wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-utils-1.1.30-41.el6.noarch.rpm

    rpm -Uvh python-urlgrabber-3.9.1-11.el6.noarch.rpm

    rpm -ivh yum-*

    cd /etc/yum.repos.d/ 

    wget  http://mirrors.163.com/.help/CentOS6-Base-163.repo

    vi CentOS6-Base-163.repo

    :%s/$releasever/6/g

    保存退出后

    yum clean all

    yum makecache

    验证

    yum install telnet

  • 相关阅读:
    《Linux命令行与shell脚本编程大全 第3版》Linux命令行---57
    《Linux命令行与shell脚本编程大全 第3版》Linux命令行---56
    《Linux命令行与shell脚本编程大全 第3版》Linux命令行---55
    《Linux命令行与shell脚本编程大全 第3版》Linux命令行---54
    《Linux命令行与shell脚本编程大全 第3版》Linux命令行---53
    《Linux命令行与shell脚本编程大全 第3版》Linux命令行---51
    activity-启动动画的设定(下面弹出出现,弹入下面消失)
    TextView-显示自己添加的字体样式
    visibility-控件的显示跟隐藏设置
    RelativeLayout-属性大全
  • 原文地址:https://www.cnblogs.com/chxwkx/p/10945373.html
Copyright © 2020-2023  润新知