背景:
1. 错误信息: E: Unable to locate package
2. linux 使用 apt-get 管理 各种软件 ,其使用 /etc/apt/sources.list 作为软件源,当某些源 不可用的时候 就会出现 apt-get install ERROR的 问题。
3. 所以 源 不可用的时候, 就要更新 sources.list 文件。
操作步骤:
一、备份原sources.list文件 (good habit)
–
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bakup
二、网上找一些可用的 源, 替换该文件,见 附录一
三、更新启用新的源
sudo apt-get update
附录一:
测试可用的:
deb http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb http://cn.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty universe
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb http://cn.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main
网上的未测试的源:
网易 Ubuntu 11.10 源(速度很快)
deb http://mirrors.163.com/ubuntu/ oneiric main universe restricted multiverse
deb-src http://mirrors.163.com/ubuntu/ oneiric main universe restricted multiverse
deb http://mirrors.163.com/ubuntu/ oneiric-security universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ oneiric-security universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ oneiric-updates universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ oneiric-proposed universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ oneiric-proposed universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ oneiric-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ oneiric-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ oneiric-updates universe main multiverse restricted
骨头源,骨头源是bones7456架设的一个Ubuntu源 ,提供ubuntu,deepin
deb http://ubuntu.srt.cn/ubuntu/ oneiric main universe restricted multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric main universe restricted multiverse
deb http://ubuntu.srt.cn/ubuntu/ oneiric-security universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-security universe main multiverse restricted
deb http://ubuntu.srt.cn/ubuntu/ oneiric-updates universe main multiverse restricted
deb http://ubuntu.srt.cn/ubuntu/ oneiric-proposed universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-proposed universe main multiverse restricted
deb http://ubuntu.srt.cn/ubuntu/ oneiric-backports universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-backports universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ oneiric-updates universe main multiverse restricted
mirror.lupaworld.com的源,速度很快
deb http://mirror.lupaworld.com/ubuntu/archive/ oneiric main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ oneiric-security main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ oneiric-updates main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/archive/ oneiric-backports main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu/ubuntu-cn/ oneiric main restricted universe multiverse
这里你也可以直接使用更快速的ubuntu.cn99.com的源(推荐):
deb http://ubuntu.cn99.com/ubuntu/ oneiric main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ oneiric-updates main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ oneiric-security main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ oneiric-backports main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu-cn/ oneiric main restricted universe multiverse
//教育网源
如果大家是在校大学生,可以使用校园网/教育网,就是用教育网的资源吧,中科大,兰大、厦门大学都有很多资源,尤其是支持ipv6的,那更新速度就按兆算了。
中科大:http://mirrors.ustc.edu.cn/
厦门大学:http://mirrors.xmu.edu.cn/howto/
大家可以自己根据自己的版本设置一下,不一定局限于ubuntu 11.10,下面列出一些校内更新源。
电子科技大学
deb http://ubuntu.uestc.edu.cn/ubuntu/ oneiric main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-backports main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-proposed main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-security main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-updates main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ oneiric main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-backports main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-proposed main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-security main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ oneiric-updates main restricted universe multiverse
中国科技大学
deb http://mirrors.ustc.edu.cn/ubuntu/ oneiric main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ oneiric-backports restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ oneiric-proposed main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ oneiric-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ oneiric-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ oneiric main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ oneiric-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ oneiric-proposed main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ oneiric-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ oneiric-updates main restricted universe multiverse
北京理工大学
deb http://mirror.bjtu.edu.cn/ubuntu/ oneiric main multiverse restricted universe
deb http://mirror.bjtu.edu.cn/ubuntu/ oneiric-backports main multiverse restricted universe
deb http://mirror.bjtu.edu.cn/ubuntu/ oneiric-proposed main multiverse restricted universe
deb http://mirror.bjtu.edu.cn/ubuntu/ oneiric-security main multiverse restricted universe
deb http://mirror.bjtu.edu.cn/ubuntu/ oneiric-updates main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ oneiric main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ oneiric-backports main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ oneiric-proposed main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ oneiric-security main multiverse restricted universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ oneiric-updates main multiverse restricted universe
兰州大学
deb ftp://mirror.lzu.edu.cn/ubuntu/ oneiric main multiverse restricted universe
deb ftp://mirror.lzu.edu.cn/ubuntu/ oneiric-backports main multiverse restricted universe
deb ftp://mirror.lzu.edu.cn/ubuntu/ oneiric-proposed main multiverse restricted universe
deb ftp://mirror.lzu.edu.cn/ubuntu/ oneiric-security main multiverse restricted universe
deb ftp://mirror.lzu.edu.cn/ubuntu/ oneiric-updates main multiverse restricted universe
deb ftp://mirror.lzu.edu.cn/ubuntu-cn/ oneiric main multiverse restricted universe
上海交通大学
deb http://ftp.sjtu.edu.cn/ubuntu/ oneiric main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ oneiric-backports main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ oneiric-proposed main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ oneiric-security main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu/ oneiric-updates main multiverse restricted universe
deb http://ftp.sjtu.edu.cn/ubuntu-cn/ oneiric main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ oneiric main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ oneiric-backports main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ oneiric-proposed main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ oneiric-security main multiverse restricted universe
deb-src http://ftp.sjtu.edu.cn/ubuntu/ oneiric-updates main multiverse restricted universe