Ubuntu清理无用的软件包级更新源方法

来源:互联网 发布:汉王考勤软件下载 编辑:程序博客网 时间:2024/06/16 18:21
Ubuntu技巧之清理系统中无用的软件包
http://www.linuxidc.com/Linux/2008-01/10573.htm
如何清理Ubuntu系统中软件包


如果你频繁的在你的系统中安装/卸载,那么不时的清理一下你的系统是十分必要的。


在Ubuntu终端中执行如下命令:


sudo apt-get autoremove


屏幕输出是这个样子的:


Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
libcommoncpp2-1.5.3-0
The following packages will be REMOVED
libcommoncpp2-1.5.3-0
0 upgraded, 0 newly installed, 1 to remove and 29 not upgraded.
Need to get 0B of archives.
After unpacking 688kB disk space will be freed.
Do you want to continue [Y/n]?


输入“Y”就可以删除这些包。


-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

ubuntu 14.04下更新源方法
1.备份源
1
# cp /etc/apt/source.list /etc/apt/source.list.backup
2.编辑源
1
# vim /etc/apt/source.list
3.替换合适的源 (可以从后面选择)
4.刷新
1
# apt-get update
部分源地址
阿里云服务器(杭州电信/网通双网)
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
网易163服务器(广州电信/网通双网)
deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
搜狐服务器(山东网通)
deb http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse
10.04 将源中的trusty替换为 lucid 即可
12.04 将源中的trusty替换为 precise 即可

--------------------------------------------------------------------------------------------------------------------------------------

sudo cp /etc/apt/source.list /etc/apt/source_backup.list # 保存之前的源
使用vi 或gedit等工具打开 /etc/apt/source.list ,往其中增加新的源:
国内比较快的是网易163和搜狐的镜像。比如如下的source列表:


deb http://mirrors.163.com/ubuntu/ intrepid main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ intrepid-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ intrepid-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ intrepid-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ intrepid-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ intrepid main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ intrepid-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ intrepid-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ intrepid-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ intrepid-backports main restricted universe multiverse


deb http://ubuntu.cn99.com/ubuntu/ intrepid main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ intrepid-security main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ intrepid-updates main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ intrepid-proposed main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ intrepid-backports main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ intrepid main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ intrepid-security main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ intrepid-updates main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ intrepid-proposed main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ intrepid-backports main restricted universe multiverse


#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


#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


deb http://ubuntu.uestc.edu.cn/ubuntu/ intrepid main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ intrepid-backports main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ intrepid-proposed main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ intrepid-security main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ hardy-updates main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ intrepid main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ intrepid-backports main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ intrepid-proposed main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ intrepid-security main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ intrepid-updates main restricted universe multiverse


deb http://archive.ubuntu.org.cn/ubuntu-cn/ feisty main restricted universe multiverse


保存了source.list 之后,使用 sudo apt-get update 更新源,之后再遇到apt-get install 或者 upgrade的时候就会快很多,而不会就仅仅从欧洲官方的源下载了。

0 0