首页 > 代码库 > ubuntu笔记 - 修改软件源

ubuntu笔记 - 修改软件源

        Ubuntu软件源的修改比较简单,一种方法是直接修改软件软列表:只需要把所需的软件源添加到或直接替换原来的系统源列表就可以,列表文件就是/etc/apt/sources.list 
在终端执行以下命令:

#进入所在目录:cd /etc/apt/#备份源列表:sudo cp sources.list sources.list.bak#编辑源列表:sudo gedit /etc/apt/sources.list

        如果希望把某一个软件源添加到列表,则只需要一个命令就好,比如在Ubuntu上安装搜狗输入法的时候,可能需要更新Fcitx,需要通过下面的命令添加其软件源:

sudo add-apt-repository ppa:fcitx-team/nightly

        最后面的就是Fcitx的官方源了。

        下面是一些国内比较好的源,请按照第一种方法添加。从以下各服务器列表内容中选择一段替换文件中的所有内容,也可以加在后面或前面,甚至可以添加多个。请根据自己网络环境设置更新服务器,以达到最快的速度。

  经过测试下面这些源都可用,之前又一次重装系统由于不是长期支持版本官方源不可用了,从网上找了三个源都不能用,每次都提示404错误,换了下面的源就没问题了。另外,挑其中一两个就好,都加进去更新也比较慢。

#网易的源(163源,无论是不是教育网,速度都很快,维护比较及时)deb http://mirrors.163.com/ubuntu/ raring main universe restricted multiversedeb-src http://mirrors.163.com/ubuntu/ raring main universe restricted multiversedeb http://mirrors.163.com/ubuntu/ raring-security universe main multiverse restricteddeb-src http://mirrors.163.com/ubuntu/ raring-security universe main multiverse restricteddeb http://mirrors.163.com/ubuntu/ raring-updates universe main multiverse restricteddeb http://mirrors.163.com/ubuntu/ raring-proposed universe main multiverse restricteddeb-src http://mirrors.163.com/ubuntu/ raring-proposed universe main multiverse restricteddeb http://mirrors.163.com/ubuntu/ raring-backports universe main multiverse restricteddeb-src http://mirrors.163.com/ubuntu/ raring-backports universe main multiverse restricteddeb-src http://mirrors.163.com/ubuntu/ raring-updates universe main multiverse restricted#搜狐的源deb http://mirrors.sohu.com/ubuntu/ raring main restricteddeb-src http://mirrors.sohu.com/ubuntu/ raring main restricteddeb http://mirrors.sohu.com/ubuntu/ raring-updates main restricteddeb-src http://mirrors.sohu.com/ubuntu/ raring-updates main restricteddeb http://mirrors.sohu.com/ubuntu/ raring universedeb-src http://mirrors.sohu.com/ubuntu/ raring universedeb http://mirrors.sohu.com/ubuntu/ raring-updates universedeb-src http://mirrors.sohu.com/ubuntu/ raring-updates universedeb http://mirrors.sohu.com/ubuntu/ raring multiversedeb-src http://mirrors.sohu.com/ubuntu/ raring multiversedeb http://mirrors.sohu.com/ubuntu/ raring-updates multiversedeb-src http://mirrors.sohu.com/ubuntu/ raring-updates multiversedeb http://mirrors.sohu.com/ubuntu/ raring-backports main restricted universe multiversedeb-src http://mirrors.sohu.com/ubuntu/ raring-backports main restricted universe multiversedeb http://mirrors.sohu.com/ubuntu/ raring-security main restricteddeb-src http://mirrors.sohu.com/ubuntu/ raring-security main restricteddeb http://mirrors.sohu.com/ubuntu/ raring-security universedeb-src http://mirrors.sohu.com/ubuntu/ raring-security universedeb http://mirrors.sohu.com/ubuntu/ raring-security multiversedeb-src http://mirrors.sohu.com/ubuntu/ raring-security multiversedeb http://extras.ubuntu.com/ubuntu raring maindeb-src http://extras.ubuntu.com/ubuntu raring main#台湾源(台湾的ubuntu 更新源还是很给力的,大陆用户可能会有点慢)deb http://tw.archive.ubuntu.com/ubuntu/ raring main universe restricted multiversedeb-src http://tw.archive.ubuntu.com/ubuntu/ raring main universe restricted multiversedeb http://tw.archive.ubuntu.com/ubuntu/ raring-security universe main multiverse restricteddeb-src http://tw.archive.ubuntu.com/ubuntu/ raring-security universe main multiverse restricteddeb http://tw.archive.ubuntu.com/ubuntu/ raring-updates universe main multiverse restricteddeb-src http://tw.archive.ubuntu.com/ubuntu/ raring-updates universe main multiverse restricted#ubuntu.cn99.com源(推荐):deb http://ubuntu.cn99.com/ubuntu/ raring main restricted universe multiversedeb http://ubuntu.cn99.com/ubuntu/ raring-updates main restricted universe multiversedeb http://ubuntu.cn99.com/ubuntu/ raring-security main restricted universe multiversedeb http://ubuntu.cn99.com/ubuntu/ raring-backports main restricted universe multiversedeb http://ubuntu.cn99.com/ubuntu-cn/ raring main restricted universe multiverse#教育网源#电子科技大学deb http://ubuntu.uestc.edu.cn/ubuntu/ raring main restricted universe multiversedeb http://ubuntu.uestc.edu.cn/ubuntu/ raring-backports main restricted universe multiversedeb http://ubuntu.uestc.edu.cn/ubuntu/ raring-proposed main restricted universe multiversedeb http://ubuntu.uestc.edu.cn/ubuntu/ raring-security main restricted universe multiversedeb http://ubuntu.uestc.edu.cn/ubuntu/ raring-updates main restricted universe multiversedeb-src http://ubuntu.uestc.edu.cn/ubuntu/ raring main restricted universe multiversedeb-src http://ubuntu.uestc.edu.cn/ubuntu/ raring-backports main restricted universe multiversedeb-src http://ubuntu.uestc.edu.cn/ubuntu/ raring-proposed main restricted universe multiversedeb-src http://ubuntu.uestc.edu.cn/ubuntu/ raring-security main restricted universe multiversedeb-src http://ubuntu.uestc.edu.cn/ubuntu/ raring-updates main restricted universe multiverse#中国科技大学deb http://debian.ustc.edu.cn/ubuntu/ raring main restricted universe multiversedeb http://debian.ustc.edu.cn/ubuntu/ raring-backports restricted universe multiversedeb http://debian.ustc.edu.cn/ubuntu/ raring-proposed main restricted universe multiversedeb http://debian.ustc.edu.cn/ubuntu/ raring-security main restricted universe multiversedeb http://debian.ustc.edu.cn/ubuntu/ raring-updates main restricted universe multiversedeb-src http://debian.ustc.edu.cn/ubuntu/ raring main restricted universe multiversedeb-src http://debian.ustc.edu.cn/ubuntu/ raring-backports main restricted universe multiversedeb-src http://debian.ustc.edu.cn/ubuntu/ raring-proposed main restricted universe multiversedeb-src http://debian.ustc.edu.cn/ubuntu/ raring-security main restricted universe multiversedeb-src http://debian.ustc.edu.cn/ubuntu/ raring-updates main restricted universe multiverse#北京理工大学deb http://mirror.bjtu.edu.cn/ubuntu/ raring main multiverse restricted universedeb http://mirror.bjtu.edu.cn/ubuntu/ raring-backports main multiverse restricted universedeb http://mirror.bjtu.edu.cn/ubuntu/ raring-proposed main multiverse restricted universedeb http://mirror.bjtu.edu.cn/ubuntu/ raring-security main multiverse restricted universedeb http://mirror.bjtu.edu.cn/ubuntu/ raring-updates main multiverse restricted universedeb-src http://mirror.bjtu.edu.cn/ubuntu/ raring main multiverse restricted universedeb-src http://mirror.bjtu.edu.cn/ubuntu/ raring-backports main multiverse restricted universedeb-src http://mirror.bjtu.edu.cn/ubuntu/ raring-proposed main multiverse restricted universedeb-src http://mirror.bjtu.edu.cn/ubuntu/ raring-security main multiverse restricted universedeb-src http://mirror.bjtu.edu.cn/ubuntu/ raring-updates main multiverse restricted universe#兰州大学deb ftp://mirror.lzu.edu.cn/ubuntu/ raring main multiverse restricted universedeb ftp://mirror.lzu.edu.cn/ubuntu/ raring-backports main multiverse restricted universedeb ftp://mirror.lzu.edu.cn/ubuntu/ raring-proposed main multiverse restricted universedeb ftp://mirror.lzu.edu.cn/ubuntu/ raring-security main multiverse restricted universedeb ftp://mirror.lzu.edu.cn/ubuntu/ raring-updates main multiverse restricted universedeb ftp://mirror.lzu.edu.cn/ubuntu-cn/ raring main multiverse restricted universe#上海交通大学(上海交大源,教育网的速度不用说了)deb http://ftp.sjtu.edu.cn/ubuntu/ raring main multiverse restricted universedeb http://ftp.sjtu.edu.cn/ubuntu/ raring-backports main multiverse restricted universedeb http://ftp.sjtu.edu.cn/ubuntu/ raring-proposed main multiverse restricted universedeb http://ftp.sjtu.edu.cn/ubuntu/ raring-security main multiverse restricted universedeb http://ftp.sjtu.edu.cn/ubuntu/ raring-updates main multiverse restricted universedeb http://ftp.sjtu.edu.cn/ubuntu-cn/ raring main multiverse restricted universedeb-src http://ftp.sjtu.edu.cn/ubuntu/ raring main multiverse restricted universedeb-src http://ftp.sjtu.edu.cn/ubuntu/ raring-backports main multiverse restricted universedeb-src http://ftp.sjtu.edu.cn/ubuntu/ raring-proposed main multiverse restricted universedeb-src http://ftp.sjtu.edu.cn/ubuntu/ raring-security main multiverse restricted universedeb-src http://ftp.sjtu.edu.cn/ubuntu/ raring-updates main multiverse restricted universe