软件源就是一个应用程序安装库,很多很多的应用软件都在这个库里面。他可以是网络服务器,是光盘,甚至是硬盘上的一个目录。作为debian系的ubuntu,继承了debian的deb和apt系统,只要设定好软件源,就能很方便的安装软件了。
ubuntu是基于debian的,debian使用的是一种後缀名为.deb的安装软件包。ubuntu的源,也就是一个个装着无数deb安装包的软件库。新立得和添加/删除就是一种帮我们找到所需要的deb包的方法。有时候,我们也会根据需要自己安装deb包。先下载deb包,然後双击,按提示输入密码,就可以轻轻松松的安装软件了。
默认的中国源速度非常不错,为了保证源内软件的齐全,建议电信用户添加cn99或台湾大学的源,建议网通用户添加UBNTU官方或台湾大学的源。
在终端输入并运行
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup (备份当前的源列表,以便日後需要时恢复)
vi /etc/apt/sources.list (修改sources.list文件中源的列表)
sources.lis t文件中注释原有的并添加
#cn99.com 源更新服务器(江苏省常州市电信,推荐电信用户使用): deb http://ubuntu.cn99.com/ubuntu/ gutsy main restricted universe multiverse deb http://ubuntu.cn99.com/ubuntu/ gutsy-security main restricted universe multiverse deb http://ubuntu.cn99.com/ubuntu/ gutsy-updates main restricted universe multiverse deb http://ubuntu.cn99.com/ubuntu/ gutsy-proposed main restricted universe multiverse deb http://ubuntu.cn99.com/ubuntu/ gutsy-backports main restricted universe multiverse deb-src http://ubuntu.cn99.com/ubuntu/ gutsy main restricted universe multiverse deb-src http://ubuntu.cn99.com/ubuntu/ gutsy-security main restricted universe multiverse deb-src http://ubuntu.cn99.com/ubuntu/ gutsy-updates main restricted universe multiverse deb-src http://ubuntu.cn99.com/ubuntu/ gutsy-proposed main restricted universe multiverse deb-src http://ubuntu.cn99.com/ubuntu/ gutsy-backports main restricted universe multiverse #Mirror.lupaworld.com 源更新服务器(浙江省杭州市双线服务器,网通同电信都可以用,亚洲地区官方更新服务器): deb http://mirror.lupaworld.com/ubuntu gutsy main restricted universe multiverse deb http://mirror.lupaworld.com/ubuntu gutsy-security main restricted universe multiverse deb http://mirror.lupaworld.com/ubuntu gutsy-updates main restricted universe multiverse deb http://mirror.lupaworld.com/ubuntu gutsy-backports main restricted universe multiverse deb-src http://mirror.lupaworld.com/ubuntu gutsy main restricted universe multiverse deb-src http://mirror.lupaworld.com/ubuntu gutsy-security main restricted universe multiverse deb-src http://mirror.lupaworld.com/ubuntu gutsy-updates main restricted universe multiverse deb-src http://mirror.lupaworld.com/ubuntu gutsy-backports main restricted universe multiverse #Ubuntu 官方源 deb http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse #台湾的官方源 deb http://tw.archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse deb http://tw.archive.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse deb http://tw.archive.ubuntu.com/ubuntu gutsy-updates main restricted universe multiverse deb http://tw.archive.ubuntu.com/ubuntu gutsy-backports main restricted universe multiverse deb http://tw.archive.ubuntu.com/ubuntu gutsy-proposed main restricted universe multiverse deb-src http://tw.archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse deb-src http://tw.archive.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse deb-src http://tw.archive.ubuntu.com/ubuntu gutsy-updates main restricted universe multiverse deb-src http://tw.archive.ubuntu.com/ubuntu gutsy-backports main restricted universe multiverse deb-src http://tw.archive.ubuntu.com/ubuntu gutsy-proposed main restricted universe multiverse
防止非官方源中软件包不全的问题,请在sources.list文件中尾部添加下面这个官方源。 deb http://archive.ubuntu.org.cn/ubuntu-cn/ feisty main restricted universe multiverse
然后 保存编辑好的文件,执行以下命令更新。
sudo apt-get update #这一步是更新你的源列表,换源後必须执行 (如果更新速度非常慢请更换源 sudo gedit /etc/apt/sources.list )
sudo apt-get dist-upgrade #这一步是更新软件
更新完软件后,再继续设置吧。
有时你可能需要使用:
sudo apt-get -f install 修复安装