关于Ubuntu无法更新源问题

在ubuntu上课堂练习时总是遇到无法更新源问题,求解决方法!

切换到root用户:su root
输入密码
备份文件:cp /etc/apt/sources.list /etc/apt/sources.list.bak
修改sources.list文件:vim /etc/apt/sources.list

在文件中加入如下的内容:

deb http://mirrors.sohu.com/ubuntu/ precise-updates main restricted
deb-src http://mirrors.sohu.com/ubuntu/ precise-updates main restricted
deb http://mirrors.sohu.com/ubuntu/ precise universe
deb-src http://mirrors.sohu.com/ubuntu/ precise universe
deb http://mirrors.sohu.com/ubuntu/ precise-updates universe
deb-src http://mirrors.sohu.com/ubuntu/ precise-updates universe
deb http://mirrors.sohu.com/ubuntu/ precise multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-updates multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-updates multiverse
deb http://mirrors.sohu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ precise-backports main restricted universe multiverse

保存文件。

sudo apt-get update
sudo apt-get upgrade

问题解决了,谢谢班主任的答疑解惑

关于Ubuntu的Unable to locate package无法更新源问题解决方案_refreshing software cache_远山那棵树的博客-CSDN博客

这个帖子也可以参考