apt源更新方法

来源:互联网 发布:轻量级c语言ide 编辑:程序博客网 时间:2024/04/30 13:30

apt源更新方法

(摘自http://blog.163.com/clevertanglei900@126/blog/static/1113522592011060446344/)

使用sudo apt-get instal安装软件包时会出现“无法找到软件包”的情况,出现这种情况除了敲错包名外很可能就是需要更新apt源,

更新apt源分为如下两个步骤:

1. 备份当前源列表  sudo cp /etc/apt/sources.list sources.list.bk

 

2. 编辑源列表 sudo gedit /etc/apt/sources.list,源列表的内容可以上网查询,以ubuntu 10.04为例有如下源列表可用:
台湾
代码:

deb http://tw.archive.ubuntu.com/ubuntu/ lucid main universe restricted multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid main universe restricted multiverse
deb http://tw.archive.ubuntu.com/ubuntu/ lucid-security universe main multiverse restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid-security universe main multiverse restricted
deb http://tw.archive.ubuntu.com/ubuntu/ lucid-updates universe main multiverse restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid-updates universe main multiverse restricted


SRT Sources
代码:
deb http://ubuntu.srt.cn/ubuntu/ lucid main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ lucid-security main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ lucid-updates main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ lucid-proposed main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ lucid-backports main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ lucid main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ lucid-security main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ lucid-updates main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ lucid-proposed main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ lucid-backports main restricted universe multiverse

网易(速度很快)
代码:
deb http://mirrors.163.com/ubuntu/ lucid main universe restricted multiverse
deb-src http://mirrors.163.com/ubuntu/ lucid main universe restricted multiverse
deb http://mirrors.163.com/ubuntu/ lucid-security universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ lucid-security universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ lucid-updates universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ lucid-proposed universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ lucid-proposed universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ lucid-updates universe main multiverse restricted

ubuntu官方上海源,提供 Kernel,Hiweed,ubuntu
代码:
deb http://mirror.rootguide.org/ubuntu/ lucid main universe restricted multiverse
deb-src http://mirror.rootguide.org/ubuntu/ lucid main universe restricted multiverse
deb http://mirror.rootguide.org/ubuntu/ lucid-security universe main multiverse restricted
deb-src http://mirror.rootguide.org/ubuntu/ lucid-security universe main multiverse restricted
deb http://mirror.rootguide.org/ubuntu/ lucid-updates universe main multiverse restricted
deb http://mirror.rootguide.org/ubuntu/ lucid-proposed universe main multiverse restricted
deb-src http://mirror.rootguide.org/ubuntu/ lucid-proposed universe main multiverse restricted
deb http://mirror.rootguide.org/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://mirror.rootguide.org/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://mirror.rootguide.org/ubuntu/ lucid-updates universe main multiverse restricted

搜狐
代码:
deb http://mirrors.shlug.org/ubuntu/ lucid main universe restricted multiverse
deb-src http://mirrors.shlug.org/ubuntu/ lucid main universe restricted multiverse
deb http://mirrors.shlug.org/ubuntu/ lucid-security universe main multiverse restricted
deb-src http://mirrors.shlug.org/ubuntu/ lucid-security universe main multiverse restricted
deb http://mirrors.shlug.org/ubuntu/ lucid-updates universe main multiverse restricted
deb http://mirrors.shlug.org/ubuntu/ lucid-proposed universe main multiverse restricted
deb-src http://mirrors.shlug.org/ubuntu/ lucid-proposed universe main multiverse restricted
deb http://mirrors.shlug.org/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://mirrors.shlug.org/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://mirrors.shlug.org/ubuntu/ lucid-updates universe main multiverse restricted

  骨头源,骨头源是bones7456架设的一个Ubuntu源 ,提供ubuntu,deepin
代码:
deb http://ubuntu.srt.cn/ubuntu/ lucid main universe restricted multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ lucid main universe restricted multiverse
deb http://ubuntu.srt.cn/ubuntu/ lucid-security universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ lucid-security universe main multiverse restricted
deb http://ubuntu.srt.cn/ubuntu/ lucid-updates universe main multiverse restricted
deb http://ubuntu.srt.cn/ubuntu/ lucid-proposed universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ lucid-proposed universe main multiverse restricted
deb http://ubuntu.srt.cn/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://ubuntu.srt.cn/ubuntu/ lucid-updates universe main multiverse restricted
需要注意的是不同版本的ubuntu有不同的源10.04的版本代号是lucid

 

3. 更新完列表之后用如下命令更新软件列表:

       sudo apt-get update

       sudo apt-get dist-upgrade 更新系统


ubuntu从10.04升级到10.10

(摘自http://wowubuntu.com/upgrade-1010.html)

以 --devl-release方式运行update-manager如下:

sudo update-manager -d  出现升级提示后按步骤操作


如果在升级的过程中提示/var目录空间不足,则需要使用

sudo apt-get clean (全部清除在/var/apt中的软件包备份)或

sudo apt-get autoclean (删除过时软件包)

来释放空间


 

配置ADSL网络 

对于一直在线的用户,网络配置很容易,这里不作赘述,下面介绍一下ADSL上网的要点。 
在控制台执行 
sudo pppoeconf 
然后按着它的提示一步一步操作即可,需要注意的是在输入ADSL帐户的时候,输入框里面缺省的有几个字,先把它们删掉再输入。后面它会提示你是不是开机自动连接上网,如果你的ADSL是按时收费,一定要选择no。 
以后如果要上网,只需执行 
pon dsl-provider 
如果要断开连接,执行 
poff 

 

 

原创粉丝点击