ubuntu命令行更换软件源

软件源的地址配置地址在/etc/apt/sources.list
1. 先备份之前的配置文件

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

  1. 修改配置文件

    sudo vim /etc/apt/sources.list

  2. 修改内容如下
    新手不会修改,可以参照以下步骤
    i进入插入模式,将之前的源删掉,注意这个文件夹中#是注释,复制以下内容粘贴,之后按Esc,之后按:进入命令模式,wq退出并保存

deb http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
  1. 更新
    sudo apt-get update

你可能感兴趣的:(Linux,LInux问题与环境配置)