美文网首页
Ubuntu 20.04 更换 apt 源

Ubuntu 20.04 更换 apt 源

作者: JimHuang18 | 来源:发表于2021-03-07 12:02 被阅读0次
    1. 备份/etc/apt/sources.list 文件
    sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
    
    1. 编辑/etc/apt/sources.list文件, 我用的nano,也可以用别的编辑器编辑,比如vim
    sudo nano /etc/apt/sources.list
    
    1. 在文件前面添加下面的条目(阿里源)
    deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
    
    1. 更新
    sudo apt-get update
    

    如果如出现依赖问题

    sudo apt-get -f install
    

    相关文章

      网友评论

          本文标题:Ubuntu 20.04 更换 apt 源

          本文链接:https://www.haomeiwen.com/subject/yzaeqltx.html