Ubuntu 8.04 Hardy LTS 软件源设置


写在前面:小F浏览了很多国内外的网站,看了很多关于软件源(Software Sources)设置的文章,发现有很多文章中对软件源的设置存在误解,为了让新人能顺利进入Ubuntu的大家庭,小F特地作此文,详细地介绍下软件源的设置。

1、软件源(Software Sources)是什么?

在Ubuntu中,软件源是指一个由可以获得软件的地址组成的集合,这个地址可以是网站、光盘,或者是硬盘上的一个目录。软件源上有“软件仓库”,软件 仓库中存储着各种各样的软件。当你需要用到一个软件的时候,就可以通过工具(新立得synaptic 、 apt-get 或者 aptitude 等),自动地下载并自动地安装。

2、软件源(Software Sources)设置好了,我可以获得哪些便利?

日常的软件安装或者更新都是采用从软件源获取软件包的方式。设置好软件源可以让你及时获取重要的安全更新,解决安全隐患;或者修复已知的问题,让使用更顺手。设置好软件源同样可以加快以上操作的速度,节约你宝贵的时间。

3、我是新手,我不会设置,有简单的图形化界面的设置方法吗?

Ubuntu的系统(System)-系统管理(Administration)菜单里提供了图形化界面的软件源设置(Software Sources)程序,不过小F提醒一下大家,只使用这个是不够的!(具体设置方法请继续往下看)

4、正确的设置方法!

在开始修改设置之前,先备份一下原来的设置。这一步看似多余,其实是一种很好的习惯,有利于配置错误时的恢复。备份方法是:按Alt+F2,然后输入 gksu cp /etc/apt/sources.list /etc/apt/sources.list-backup。回车后输入你的密码。

然后打开设置程序:系统(System)-系统管理(Administration)-软件源设置(Software Sources)。在第一个标签页上,单击“下载自(Download From)”右边的菜单,选择“其他…(Others…)”。然后在弹出的窗口中单击“选择最佳服务器(Select Best Server)”。下面系统会自动ping官方服务器列表中的服务器,并选择最快的!

再按Alt+F2打开“运行程序(Run Application)”,输入 gksu gedit /etc/apt/sources.list。回车后如果有提示输入密码,输入你的密码。把光标调到文件的最后。

(1)电信用户加入下面的内容:

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
deb http://ubuntu.cn99.com/ubuntu-cn hardy main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ hardy main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy restricted main universe
deb http://us.archive.ubuntu.com/ubuntu/ hardy universe
deb http://us.archive.ubuntu.com/ubuntu/ hardy-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy-updates universe
deb http://archive.ubuntu.com/ubuntu/ hardy main restricted
deb-src http://archive.ubuntu.com/ubuntu/ hardy restricted main universe
deb http://archive.ubuntu.com/ubuntu/ hardy universe
deb http://archive.ubuntu.com/ubuntu/ hardy-updates universe
deb-src http://archive.ubuntu.com/ubuntu/ hardy-updates universe #Added by software-properties
deb http://security.ubuntu.com/ubuntu hardy-security main restricted
deb-src http://security.ubuntu.com/ubuntu hardy-security restricted main universe
deb http://security.ubuntu.com/ubuntu hardy-security universe
(2)网通/教育网用户加入下面的内容:

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
deb http://ubuntu.cn99.com/ubuntu-cn hardy main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ hardy main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy restricted main universe
deb http://us.archive.ubuntu.com/ubuntu/ hardy universe
deb http://us.archive.ubuntu.com/ubuntu/ hardy-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ hardy-updates universe
deb http://archive.ubuntu.com/ubuntu/ hardy main restricted
deb-src http://archive.ubuntu.com/ubuntu/ hardy restricted main universe
deb http://archive.ubuntu.com/ubuntu/ hardy universe
deb http://archive.ubuntu.com/ubuntu/ hardy-updates universe
deb-src http://archive.ubuntu.com/ubuntu/ hardy-updates universe #Added by software-properties
deb http://security.ubuntu.com/ubuntu hardy-security main restricted
deb-src http://security.ubuntu.com/ubuntu hardy-security restricted main universe
deb http://security.ubuntu.com/ubuntu hardy-security universe
然后按Ctrl+S保存文档,关掉这个窗口。

5、为什么我要设置这么多国外源?

Ubuntu的项目是由世界各地的爱好者共同维护的,因此服务器端文件的更新很难做到同步。由于Ubuntu的主服务器在欧洲,项目小组在挪威国,而英 语是Ubuntu用户中使用最广的语言,因此最新的更新版本很快被发布到Ubuntu的欧洲主源和美国源。同时国内的Ubuntu更新源经常存在软件包缺 失的问题,因此小F推荐大家设置欧洲和美国的官方源。

6、源越多速度越快吗?

很不幸,Ubuntu的软件管理程序没 有自动判断最快源的功能。因此无论你设置了多少源,Ubuntu只按照源列表的顺序,找到第一个提供相应软件包下载的源并连接下载。因此我们在设置的时候 让Ubuntu先自动找最快的源,然后把可能作为补充的源加在后面。相反地,设置的源过多,反而会降低更新 (apt-get update)的速度

本文作者:
« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3