ubuntu包管理 dpkg apt-get aptitude ppa

1 包管理基础

ubuntu包管理系统继承于Debian

包文件扩展名.deb

基本工具:dpkg, apt-get, aptitude

2 dpkg

deb是debian linux的安装格式,跟red hat的rpm非常相似,最基本的安装命令是:dpkg -i file.deb

dpkg 是Debian Package的简写,是为Debian 专门开发的套件管理系统,方便软件的安装、更新及移除。所有源自Debian的Linux发行版都使用dpkg,例如Ubuntu、Knoppix 等。

dpkg -i <package.deb>    安装一个 Debian 软件包,如你手动下载的文件。
dpkg -c <package.deb>    列出 <package.deb> 的内容。
dpkg -I <package.deb>    从 <package.deb> 中提取包裹信息。
dpkg -r <package>    移除一个已安装的包裹。
dpkg -P <package>    完全清除一个已安装的包裹。和remove不同的是,remove只是删掉数据和可执行文件,purge另外还删除所有的配制文件。
dpkg -L <package>    列出 <package> 安装的所有文件清单。同时请看 dpkg -c 来检查一个.deb文件的内容。
dpkg -s <package>    显示已安装包裹的信息。同时请看 apt-cache 显示Debian存档中的包裹信息,以及 dpkg -I来显示从一个.deb 文件中提取的包裹信息
dpkg-reconfigure <package>    重新配制一个已经安装的包裹,如果它使用的是debconf (debconf为包裹安装提供了一个统一的配制界面)。

3 apt-get

The apt-get command is a powerful command-line tool, which works with Ubuntu'sAdvanced
Packaging Tool(APT)
performing such functions as installation of new software packages, upgrade
of existing software packages, updating of the package list index, and even upgrading the entire
Ubuntu system.

apt-cache search # ------(package 搜索包)
apt-cache show #------(package 获取包的相关信息,如说明、大小、版本等)
sudo apt-get install # ------(package 安装包)
sudo apt-get install # -----(package - - reinstall 重新安装包)
sudo apt-get -f install # -----(强制安装?#"-f = --fix-missing"当是修复安装吧...)
sudo apt-get remove #-----(package 删除包)
sudo apt-get remove - - purge # ------(package 删除包,包括删除配置文件等)
sudo apt-get autoremove --purge # ----(package 删除包及其依赖的软件包+配置文件等(只对6.10有效,强烈推荐))
sudo apt-get update #------更新源
sudo apt-get upgrade #------更新已安装的包
sudo apt-get dist-upgrade # ---------升级系统
sudo apt-get dselect-upgrade #------使用 dselect 升级
apt-cache depends #-------(package 了解使用依赖)
apt-cache rdepends # ------(package 了解某个具体的依赖?#当是查看该包被哪些包依赖吧...)
sudo apt-get build-dep # ------(package 安装相关的编译环境)
apt-get source #------(package 下载该包的源代码)
sudo apt-get clean && sudo apt-get autoclean # --------清理下载文件的存档 && 只清理过时的包
sudo apt-get check #-------检查是否有损坏的依赖

4 aptitude

与 apt-get 一样,是 Debian 及其衍生系统中功能极其强大的包管理工具。与 apt-get 不同的是,aptitude 在处理依赖问题上更佳一些。举例来说,aptitude 在删除一个包时,会同时删除本身所依赖的包。这样,系统中不会残留无用的包,整个系统更为干净.

sudo 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 仅删除过期的包文件 

5 PPA: Personal Package Archives

PPA是Ubuntu Launchpad网站提供的一项服务,允许个人用户上传软件源代码,通过Launchpad进行编译并发布为2进制软件包,作为apt/新立得源供其他用户下载和更新

安装命令:

1 sudo add-apt-repository ppa:xubuntu-dev/xfce-4.12

zhai@zhai-VirtualBox:~$ sudo add-apt-repository ppa:xubuntu-dev/xfce-4.12
[sudo] password for zhai: 
 As always, install packages from PPA's at your own risk.

Xfce 4.12 packages for currently supported versions of Xubuntu. Please note that these are pre-release versions, which may contain annoying bugs and/or crash.

NOTE: For 12.04, you MUST enable the PPA for Xfce 4.10 packages (https://launchpad.net/~xubuntu-dev/+archive/xfce-4.10) as well.

If you need and/or want stable versions, wait for the final release date of Xfce 4.12. More information at http://wiki.xfce.org/releng/4.12/roadmap.
 More info: https://launchpad.net/~xubuntu-dev/+archive/ubuntu/xfce-4.12
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmpnrfxkory/secring.gpg' created
gpg: keyring `/tmp/tmpnrfxkory/pubring.gpg' created
gpg: requesting key 142986CE from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpnrfxkory/trustdb.gpg: trustdb created
gpg: key 142986CE: public key "Launchpad PPA for Xubuntu Developers" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK

2 sudo apt-get update && sudo apt-get dist-upgrade

3 sudo apt-get install xfce4

$ sudo add-apt-repository ppa:xubuntu-dev/xfce-4.12
$ sudo apt-get update
$ sudo apt-get dist-upgrade

卸载命令:

sudo apt-get install ppa-purge
sudo ppa-purge ppa:xubuntu-dev/xfce-4.12


参考:

ubuntu官网

http://blog.csdn.net/makenothing/article/details/23954445

PPA:

https://help.launchpad.net/Packaging/PPA

https://help.launchpad.net/Packaging/PPA/InstallingSoftware


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值