ubuntu apt-get update失败
1.出现错误:E:Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
出现这个问题的原因可能是有另外一个程序正在运行,导致资源被锁不可用。而导致资源被锁的原因,可能是上次安装时没正常完成,而导致出现此状况。
解决方法:把 /var/lib/apt/lists 中的文件全部删掉
输入以下命令
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
之后再安装想装的包,即可解决
2.出现错误:E: Some index files failed to download. They have been ignored, or old ones used instead.
解决方法:
To upgrade a really old Ubuntu release, we first need to edit our sources.list and change all(xx.)archive.ubuntu.com to old-releases.ubuntu.com.
$ sudo emacs /etc/apt/sources.list
So your lines should instead of
deb http://archive.ubuntu.com/ubuntu jaunty main restricted universe
look like
deb http://old-releases.ubuntu.com/ubuntu jaunty main restricted universe
In this example I use jaunty release. But it works the same on other releases.
Now update the repos
$ sudo apt-get update
原文出自:http://blog.sina.com.cn/s/blog_afeac1330101bm2c.html