美文网首页
Ubuntu 16.04 更换apt源

Ubuntu 16.04 更换apt源

作者: Jarkata | 来源:发表于2019-09-28 01:01 被阅读0次

    2020.10.25 update

    南大镜像源: https://mirrors.nju.edu.cn/ubuntu/
    使用手册: https://nju-mirror-help.njuer.org/ubuntu.html
    自己学校的镜像源用起来还是快很多
    =======================================

    更换apt-get数据源

    1. 输入:sudo -s切换为root超级管理员;
    2. 执行命令:vim /etc/apt/sources.list;(保险起见,建议先执行cp /etc/apt/sources.list /etc/apt/sources.list.bak进行备份)
    3. 使用命令:%d 清空所有内容;
    4. 清华数据源地址:https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/ 选择相应的版本复制内容,点击“i”键进入编辑文本模式,粘贴内容到vim编辑窗体,点击“ESC”键进入编辑模式,输入“:wq”保存离开;

    清华源(以Ubuntu 16.04为例)

    # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
    
    # 预发布软件源,不建议启用
    # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
    

    南大源(Ubuntu 16.04):

    # 默认注释了源码仓库,如有需要可自行取消注释
    deb https://mirrors.nju.edu.cn/ubuntu/ xenial main restricted universe multiverse
    # deb-src https://mirrors.nju.edu.cn/ubuntu/ xenial main restricted universe multiverse
    deb https://mirrors.nju.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
    # deb-src https://mirrors.nju.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
    deb https://mirrors.nju.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
    # deb-src https://mirrors.nju.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
    deb https://mirrors.nju.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
    # deb-src https://mirrors.nju.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
    
    # 预发布软件源,不建议启用
    # deb https://mirrors.nju.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
    # deb-src https://mirrors.nju.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
    
    1. 更新源:sudo apt-get update
    2. 更新软件:sudo apt-get upgrade

    BTW,阿里的镜像站:https://opsx.alibaba.com/
    清华镜像站:https://mirrors.tuna.tsinghua.edu.cn/

    相关文章

      网友评论

          本文标题:Ubuntu 16.04 更换apt源

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