美文网首页
更换Ubuntu源(sources.list)

更换Ubuntu源(sources.list)

作者: zhujunhua | 来源:发表于2020-10-16 13:56 被阅读0次

    更换Ubuntu的源为阿里源。

    先备份原来的源sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

    替换/etc/apt/sources.list

    各个版本 sources模板 (更换TODO为ubuntu版本,lsb_release -a 可以查看ubuntu版本)

    deb http://mirrors.aliyun.com/ubuntu/ TODO main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ TODO main restricted universe multiverse
    
    deb http://mirrors.aliyun.com/ubuntu/ TODO-security main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ TODO-security main restricted universe multiverse
    
    deb http://mirrors.aliyun.com/ubuntu/ TODO-updates main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ TODO-updates main restricted universe multiverse
    
    deb http://mirrors.aliyun.com/ubuntu/ TODO-proposed main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ TODO-proposed main restricted universe multiverse
    
    deb http://mirrors.aliyun.com/ubuntu/ TODO-backports main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ TODO-backports main restricted universe multiverse
    

    20.0.4 版本代号 focal, sources.list如下

    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
    

    更新缓存和升级

    sudo apt-get update
    sudo apt-get upgrade
    

    参考:
    Ubuntu 20.04换阿里源

    相关文章

      网友评论

          本文标题:更换Ubuntu源(sources.list)

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