1 备份原来的更新源
cp /etc/apt/sources.list /etc/apt/sources.list.backup
如果提示权限不够就输入下面两行,先进入到超级用户,再备份
sudo -s cp /etc/apt/sources.list /etc/apt/sources.list.backup
2 修改更新源
打开sources.list (这就是存放更新源的文件)
gedit /etc/apt/sources.list
将下面所有内容复制,粘贴并覆盖sources.list文件中的所有内容
# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universe deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universe deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universe deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse
3 让更新源生效
sudo apt-get update
4 其他问题
*** Error in `appstreamcli': double free or corruption (fasttop): 0x000000000237b000 ***
该问题需要执行如下命令才能解决:
或将源改回来再试删除并重新更换更新源
sudo apt-get purge libappstream3
执行完后再次执行 sudo apt-get update 命令就正常了。