Ubuntu12.04使用apt-get出错——更新软件源

本来打算在Ubuntu上用apt-get安装vsftpd(very secure ftp daemon,ftp服务器),于是输入如下命令: # apt-get install vsftpd 但是出现如下提示: Reading package lists… DoneBuilding dependency tree Reading state information…

  本来打算在Ubuntu上用apt-get安装vsftpd(very secure ftp daemon,ftp服务器),于是输入如下命令:

# apt-get install vsftpd

  但是出现如下提示:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package vsftpd is not available,but is referred to by another package.
This may mean that the package is missing,has been obsoleted,or
is only available from another source
E: Package 'vsftpd' has no installation candidate

  大概就是说找不到 vsftpd,没有 vsftpd 的安装候选。找到相关的问题 http://askubuntu.com/questions/14685/what-does-package-package-has-no-installation-candidate-mean,应该是要 # apt-get update 一下。但是尴尬的事情又来了,update 出现如下错误:

......
Reading package lists... Done
W: Failed to fetch http://hk.archive.ubuntu.com/ubuntu/dists/precise/InRelease  
W: Failed to fetch http://hk.archive.ubuntu.com/ubuntu/dists/precise-updates/InRelease  
W: Failed to fetch http://hk.archive.ubuntu.com/ubuntu/dists/precise-backports/InRelease  
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/InRelease  
W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/precise/InRelease  
W: Failed to fetch 
......
W: Some index files failed to download. They have been ignored,or old ones used instead.

  于是我又查了关于“Failed to fetch”的相关问题,参考 http://askubuntu.com/questions/298177/a-failed-to-fetch-error-occurs-when-apt-get-update-is-run-how-do-i-fix-this 和 http://www.voidcn.com/article/p-vguoxhjn-bh.html 。提到跟 DNS 配置有关,于是我做了相应修改后发现依然无效(我装的是 Ubuntu 12.04 Server)。
  然后我就开始尝试修改软件源了,我的 Ubuntu 没有图形界面,相关操作如下:
  1、保险起见,备份 Ubuntu12.04 源列表

# cp /etc/apt/sources.list /etc/apt/sources.list.backup

  2、修改源列表文件

# vi /etc/apt/sources.list

  3、把里面的列表替换成下面的列表
【163源】

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

【sohu源】

deb http://mirrors.sohu.com/ubuntu/ precise main restricted
 deb-src http://mirrors.sohu.com/ubuntu/ precise main restricted
 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
 deb http://mirrors.sohu.com/ubuntu/ precise-security main restricted
 deb-src http://mirrors.sohu.com/ubuntu/ precise-security main restricted
 deb http://mirrors.sohu.com/ubuntu/ precise-security universe
 deb-src http://mirrors.sohu.com/ubuntu/ precise-security universe
 deb http://mirrors.sohu.com/ubuntu/ precise-security multiverse
 deb-src http://mirrors.sohu.com/ubuntu/ precise-security multiverse
 deb http://extras.ubuntu.com/ubuntu precise main
 deb-src http://extras.ubuntu.com/ubuntu precise main

【ubuntu.cn99.com源】

deb http://ubuntu.cn99.com/ubuntu/ precise main restricted universe multiverse
 deb http://ubuntu.cn99.com/ubuntu/ precise-updates main restricted universe multiverse
 deb http://ubuntu.cn99.com/ubuntu/ precise-security main restricted universe multiverse
 deb http://ubuntu.cn99.com/ubuntu/ precise-backports main restricted universe multiverse
 deb http://ubuntu.cn99.com/ubuntu-cn/ precise main restricted universe multiverse

【电子科技大学】

deb http://ubuntu.uestc.edu.cn/ubuntu/ precise main restricted universe multiverse
 deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
 deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
 deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-security main restricted universe multiverse
 deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse
 deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise main restricted universe multiverse
 deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
 deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
 deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-security main restricted universe multiverse
 deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse

【中国科技大学】

deb http://debian.ustc.edu.cn/ubuntu/ precise main restricted universe multiverse
 deb http://debian.ustc.edu.cn/ubuntu/ precise-backports restricted universe multiverse
 deb http://debian.ustc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
 deb http://debian.ustc.edu.cn/ubuntu/ precise-security main restricted universe multiverse
 deb http://debian.ustc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse
 deb-src http://debian.ustc.edu.cn/ubuntu/ precise main restricted universe multiverse
 deb-src http://debian.ustc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
 deb-src http://debian.ustc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
 deb-src http://debian.ustc.edu.cn/ubuntu/ precise-security main restricted universe multiverse
 deb-src http://debian.ustc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse

【北京理工大学】

deb http://mirror.bjtu.edu.cn/ubuntu/ precise main multiverse restricted universe
 deb http://mirror.bjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe
 deb http://mirror.bjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe
 deb http://mirror.bjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe
 deb http://mirror.bjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe
 deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise main multiverse restricted universe
 deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe
 deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe
 deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe
 deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe

  4、更新软件源

# apt-get update

作者: dawei

【声明】:永州站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。

为您推荐

联系我们

联系我们

0577-28828765

在线咨询: QQ交谈

邮箱: xwei067@foxmail.com

工作时间:周一至周五,9:00-17:30,节假日休息

返回顶部