当前位置: IT大杂烩 > Ubuntu  > ubuntu笔记

ubuntu笔记

www.someabcd.com  网友分享于:May 18, 2018 12:02:04 AM
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的官方源了。

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

  在这里要说明一下,关于有些人使用下面的源后,更新软件列表时提示下面这样的错误:

W: Failed to fetch http://debian.ustc.edu.cn/ubuntu/dists/raring-updates/restricted/binary-i386/Packages  404  Not Found [ip: 202.141.160.110 80]W: Failed to fetch http://debian.ustc.edu.cn/ubuntu/dists/raring-updates/universe/binary-i386/Packages  404  Not Found [IP: 202.141.160.110 80]W: Failed to fetch http://debian.ustc.edu.cn/ubuntu/dists/raring-updates/multiverse/binary-i386/Packages  404  Not Found [IP: 202.141.160.110 80]

  原因在于选用的源已经停止支持,大家要注意软件源列表中的信息,每一个版本都有对应的软件源,比如deb http://mirrors.163.com/ubuntu/ PRecise main restricted 是12.04的软件源,而deb http://mirrors.163.com/ubuntu/ raring main universe restricted multiverse是13.04的软件源,建议大家尽量选用长期支持版的软件源,当然更建议大家使用长期支持版的系统。

  如果下面的源和你的版本不匹配也没关系,把precise替换成相应的版本号就好,不过有些非长期支持版可能还是不能用,提示404错误,我也是突然发现我使用了13.04的源,而且网易和中科大的源都不能用了才发现这一点。

  下面这个是网易的12.04的源。具体大家可以参考网易的手册:http://mirrors.163.com/.help/ubuntu.html

#网易163的源,ubuntu12.04,更新很快deb http://mirrors.163.com/ubuntu/ precise main restricteddeb-src http://mirrors.163.com/ubuntu/ precise main restricteddeb http://mirrors.163.com/ubuntu/ precise-updates main restricteddeb-src http://mirrors.163.com/ubuntu/ precise-updates main restricteddeb http://mirrors.163.com/ubuntu/ precise-updates universedeb-src http://mirrors.163.com/ubuntu/ precise-updates universedeb http://mirrors.163.com/ubuntu/ precise multiversedeb-src http://mirrors.163.com/ubuntu/ precise multiversedeb http://mirrors.163.com/ubuntu/ precise-updates multiversedeb-src http://mirrors.163.com/ubuntu/ precise-updates multiversedeb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiversedeb-src http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiversedeb http://mirrors.163.com/ubuntu/ precise-security main restricteddeb-src http://mirrors.163.com/ubuntu/ precise-security main restricteddeb http://mirrors.163.com/ubuntu/ precise-security universedeb-src http://mirrors.163.com/ubuntu/ precise-security universedeb http://mirrors.163.com/ubuntu/ precise-security multiversedeb-src http://mirrors.163.com/ubuntu/ precise-security multiversedeb http://extras.ubuntu.com/ubuntu precise maindeb-src http://extras.ubuntu.com/ubuntu precise main
#中国科学技术大学,我一直用,真的很快deb http://debian.ustc.edu.cn/ubuntu/ precise main restricted universe multiversedeb http://debian.ustc.edu.cn/ubuntu/ precise-backports restricted universe multiversedeb http://debian.ustc.edu.cn/ubuntu/ precise-proposed main restricted universe multiversedeb http://debian.ustc.edu.cn/ubuntu/ precise-security main restricted universe multiversedeb http://debian.ustc.edu.cn/ubuntu/ precise-updates main restricted universe multiversedeb-src http://debian.ustc.edu.cn/ubuntu/ precise main restricted universe multiversedeb-src http://debian.ustc.edu.cn/ubuntu/ precise-backports main restricted universe multiversedeb-src http://debian.ustc.edu.cn/ubuntu/ precise-proposed main restricted universe multiversedeb-src http://debian.ustc.edu.cn/ubuntu/ precise-security main restricted universe multiversedeb-src http://debian.ustc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse
#台湾源deb http://tw.archive.ubuntu.com/ubuntu/ precise main universe restricted multiversedeb-src http://tw.archive.ubuntu.com/ubuntu/ precise main universe restricted multiversedeb http://tw.archive.ubuntu.com/ubuntu/ precise-security universe main multiverse restricteddeb-src http://tw.archive.ubuntu.com/ubuntu/ precise-security universe main multiverse restricteddeb http://tw.archive.ubuntu.com/ubuntu/ precise-updates universe main multiverse restricteddeb-src http://tw.archive.ubuntu.com/ubuntu/ precise-updates universe main multiverse restricted
#骨头源,骨头源是bones7456架设的一个Ubuntu源 ,提供ubuntu,deepin deb http://ubuntu.srt.cn/ubuntu/ precise main universe restricted multiverse deb-src http://ubuntu.srt.cn/ubuntu/ precise main universe restricted multiverse deb http://ubuntu.srt.cn/ubuntu/ precise-security universe main multiverse restricteddeb-src http://ubuntu.srt.cn/ubuntu/ precise-security universe main multiverse restricteddeb http://ubuntu.srt.cn/ubuntu/ precise-updates universe main multiverse restricteddeb http://ubuntu.srt.cn/ubuntu/ precise-proposed universe main multiverse restricteddeb-src http://ubuntu.srt.cn/ubuntu/ precise-proposed universe main multiverse restricteddeb http://ubuntu.srt.cn/ubuntu/ precise-backports universe main multiverse restricteddeb-src http://ubuntu.srt.cn/ubuntu/ precise-backports universe main multiverse restricteddeb-src http://ubuntu.srt.cn/ubuntu/ precise-updates universe main multiverse restricted
#mirror.lupaworld.com的源,速度很快deb http://mirror.lupaworld.com/ubuntu/archive/ precise main restricted universe multiversedeb http://mirror.lupaworld.com/ubuntu/archive/ precise-security main restricted universe multiversedeb http://mirror.lupaworld.com/ubuntu/archive/ precise-updates main restricted universe multiversedeb http://mirror.lupaworld.com/ubuntu/archive/ precise-backports main restricted universe multiversedeb http://mirror.lupaworld.com/ubuntu/ubuntu-cn/ precise main restricted universe multiverse
#ubuntu.cn99.com源(推荐):deb http://ubuntu.cn99.com/ubuntu/ precise main restricted universe multiversedeb http://ubuntu.cn99.com/ubuntu/ precise-updates main restricted universe multiversedeb http://ubuntu.cn99.com/ubuntu/ precise-security main restricted universe multiversedeb http://ubuntu.cn99.com/ubuntu/ precise-backports main restricted universe multiversedeb http://ubuntu.cn99.com/ubuntu-cn/ precise main restricted universe multiverse
#电子科技大学 deb http://ubuntu.uestc.edu.cn/ubuntu/ precise main restricted universe multiversedeb http://ubuntu.uestc.edu.cn/ubuntu/ precise-backports main restricted universe multiversedeb http://ubuntu.uestc.edu.cn/ubuntu/ precise-proposed main restricted universe multiversedeb http://ubuntu.uestc.edu.cn/ubuntu/ precise-security main restricted universe multiversedeb http://ubuntu.uestc.edu.cn/ubuntu/ precise-updates main restricted universe multiversedeb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise main restricted universe multiversedeb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-backports main restricted universe multiversedeb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-proposed main restricted universe multiversedeb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-security main restricted universe multiversedeb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse
#北京理工大学 deb http://mirror.bjtu.edu.cn/ubuntu/ precise main multiverse restricted universedeb http://mirror.bjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universedeb http://mirror.bjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universedeb http://mirror.bjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universedeb http://mirror.bjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universedeb-src http://mirror.bjtu.edu.cn/ubuntu/ precise main multiverse restricted universedeb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universedeb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universedeb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universedeb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe
#上海交通大学 deb http://ftp.sjtu.edu.cn/ubuntu/ precise main multiverse restricted universe deb http://ftp.sjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universedeb http://ftp.sjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universedeb http://ftp.sjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universedeb http://ftp.sjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universedeb http://ftp.sjtu.edu.cn/ubuntu-cn/ precise main multiverse restricted universedeb-src http://ftp.sjtu.edu.cn/ubuntu/ precise main multiverse restricted universedeb-src http://ftp.sjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universedeb-src http://ftp.sjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universedeb-src http://ftp.sjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universedeb-src http://ftp.sjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe
#兰州大学 deb ftp://mirror.lzu.edu.cn/ubuntu/ precise main multiverse restricted universe deb ftp://mirror.lzu.edu.cn/ubuntu/ precise-backports main multiverse restricted universedeb ftp://mirror.lzu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universedeb ftp://mirror.lzu.edu.cn/ubuntu/ precise-security main multiverse restricted universedeb ftp://mirror.lzu.edu.cn/ubuntu/ precise-updates main multiverse restricted universedeb ftp://mirror.lzu.edu.cn/ubuntu-cn/ precise main multiverse restricted universe



发布此文章仅为传递网友分享,不代表本站观点,若侵权请联系我们删除,本站将不对此承担任何责任。
Copyright ©2018  IT大杂烩  版权所有  京ICP备11030978号-1 网站地图