树莓派 添加国内源

转载:http://www.cnblogs.com/xy888/p/5477883.html

E: Package <packagename> has no installation candidate错误,于是便开始google,寻找原因。但苦苦追寻,能查到的都是
一些叫我们输入指令的语句 如sudo apt-get update等之类的命令,但该命令不管用。这是因为在我们的/etc/apt/sources.list
文件下,拥有的是只是一些系统初装的源,后期的一些源还是得自己添加的,不然网上的很多资源包都是无法使用的。下面我就贴上
我在网站上找到的各种源。

sources.list(源)

位置:/etc/apt/sources.list

 

常见的源:

1 中国科技大学源

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

 

2 北京交大源

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

 

3 台湾大学源

deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ hardy main restricted universe multiverse
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ hardy main restricted universe multiverse
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ hardy-updates main restricted universe multiverse
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ hardy-updates main restricted universe multiverse
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ hardy-backports main restricted universe multiverse
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ hardy-backports main restricted universe multiverse
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ hardy-security main restricted universe multiverse
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ hardy-security main restricted universe multiverse
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ hardy-proposed main multiverse restricted universe
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ hardy-proposed main restricted universe multiverse

4 CN99源

deb http://Ubuntu.cn99.com/ubuntu/ hardy main restricted universe multiverse
deb http://Ubuntu.cn99.com/ubuntu/ hardy-security main restricted universe multiverse
deb http://Ubuntu.cn99.com/ubuntu/ hardy-updates main restricted universe multiverse
deb http://Ubuntu.cn99.com/ubuntu/ hardy-proposed main restricted universe multiverse
deb http://Ubuntu.cn99.com/ubuntu/ hardy-backports main restricted universe multiverse
deb-src http://Ubuntu.cn99.com/ubuntu/ hardy main restricted universe multiverse
deb-src http://Ubuntu.cn99.com/ubuntu/ hardy-security main restricted universe multiverse
deb-src http://Ubuntu.cn99.com/ubuntu/ hardy-updates main restricted universe multiverse
deb-src http://Ubuntu.cn99.com/ubuntu/ hardy-proposed main restricted universe multiverse
deb-src http://Ubuntu.cn99.com/ubuntu/ hardy-backports main restricted universe multiverse

 

5 Lupaworld源

deb http://mirror.lupaworld.com/ubuntu hardy main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu hardy-security main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu hardy-updates main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu hardy-backports main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu hardy-proposed main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu hardy main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu hardy-security main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu hardy-updates main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu hardy-backports main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu hardy-proposed main restricted universe multiverse

(注释:deb代表的是我们需要的deb软件包,deb-src 是指下载源代码得指示。之后是包的来源地址,再在后面是系统的标记。之后的main代表的是主要软件包,universe是不被官方支持的自由软件。)

 

  如何更改源呢?为了方便,首先安装vim

sudo apt-get update
sudo apt-get install vim

1首先备份Ubuntu 8.04 的当前更新源列表(以备不测)

      sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup (备份下当前的源列表)

2、修改更新源
     sudo vim /etc/apt/sources.list
3在里面我选择在后面添加源;

4、通知Ubuntu 11.10 启用新的更新源
     sudo apt-get update

 

 

我的终端命令如图:

root@ubuntu:~# sudo apt-get update

 

posted @ 2016-09-09 23:37  极客先锋  阅读(873)  评论(0编辑  收藏  举报