aptitude与apt-get
源# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://archive.ubuntu.com/ubuntu/ groovy main restricted # deb-src http://archive.ubuntu.com/ubuntu/ groovy main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://archive.ubuntu.com/ubuntu/ groovy-updates main restricted # deb-src http://archive.ubuntu.com/ubuntu/ groovy-updates main restricted ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team. Also, please note that software in universe WILL NOT receive any ## review or updates from the Ubuntu security team. deb http://archive.ubuntu.com/ubuntu/ groovy universe # deb-src http://archive.ubuntu.com/ubuntu/ groovy universe deb http://archive.ubuntu.com/ubuntu/ groovy-updates universe # deb-src http://archive.ubuntu.com/ubuntu/ groovy-updates universe ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://archive.ubuntu.com/ubuntu/ groovy multiverse # deb-src http://archive.ubuntu.com/ubuntu/ groovy multiverse deb http://archive.ubuntu.com/ubuntu/ groovy-updates multiverse # deb-src http://archive.ubuntu.com/ubuntu/ groovy-updates multiverse ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. deb http://archive.ubuntu.com/ubuntu/ groovy-backports main restricted universe multiverse # deb-src http://archive.ubuntu.com/ubuntu/ groovy-backports main restricted universe multiverse ## Uncomment the following two lines to add software from Canonical's ## 'partner' repository. ## This software is not part of Ubuntu, but is offered by Canonical and the ## respective vendors as a service to Ubuntu users. # deb http://archive.canonical.com/ubuntu groovy partner # deb-src http://archive.canonical.com/ubuntu groovy partner deb http://security.ubuntu.com/ubuntu/ groovy-security main restricted # deb-src http://security.ubuntu.com/ubuntu/ groovy-security main restricted deb http://security.ubuntu.com/ubuntu/ groovy-security universe # deb-src http://security.ubuntu.com/ubuntu/ groovy-security universe deb http://security.ubuntu.com/ubuntu/ groovy-security multiverse # deb-src http://security.ubuntu.com/ubuntu/ groovy-security multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
aptitude 与 apt-get 一样,是 Debian 及其衍生系统中功能极其强大的包管理工具。与 apt-get 不同的是,aptitude 在处理依赖问题上更佳一些。举例来说,aptitude 在删除一个包时,会同时删除本身所依赖的包。这样,系统中不会残留无用的包,整个系统更为干净。
以下是笔者总结的一些常用 aptitude 命令,仅供参考。
命令 作用
aptitude update 更新可用的包列表
aptitude upgrade 升级可用的包
aptitude dist-upgrade 将系统升级到新的发行版
aptitude install pkgname 安装包
aptitude remove pkgname 删除包
aptitude purge pkgname 删除包及其配置文件
aptitude search string 搜索包
aptitude show pkgname 显示包的详细信息
aptitude clean 删除下载的包文件
aptitude autoclean 仅删除过期的包文件
有的问题 apt-get 解决不了,必须使用 aptitude 解决,有的问题,用 aptitude 解决不了,必须使用apt-get.
aptitude 解决得更好的地方: install, remove, reinstall(apt-get无此功能), show(apt-get无此功能), search(apt-get无此功能), hold(apt-get无此功能), unhold(apt-get无此功能),
apt-get 解决得更好的地方: source(aptitude无此功能), build-dep (低版本的aptitude没有build-dep功能)
apt-get 跟 aptitude 没什么区别的地方:update, upgrade (apt-get upgrade=aptitude safe-upgrade, apt-get dist-upgrade=aptitude full-upgrgade)