码迷,mamicode.com
首页 > 系统相关 > 详细

Linux使用技巧9--用dpkg管理你的软件

时间:2015-04-01 21:59:24      阅读:211      评论:0      收藏:0      [点我收藏+]

标签:dpkg   deb安装   deb删除   

dpkg(package manager for Debian): debian体系中的包管理工具。

Commands:
  -i|--install       <.deb file name> ... | -R|--recursive <directory> ...
-r|--remove        <package> ... | -a|--pending

1.查看已经安装的软件

$ dpkg -l
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                            Version              Architecture         Description
+++-===============================-====================-====================-====================================================================
ii  account-plugin-aim              3.8.6-0ubuntu9.1     amd64                Messaging account plugin for AIM
ii  ack-grep                        2.12-1               all                  grep-like program specifically for large source trees

2.安装deb格式的软件

有时候会下载deb的软件,如virtualbox,那么我们就可以这样安装:

$ sudo dpkg -i virtualbox-4.3_4.3.26-98988~Ubuntu~raring_amd64.deb 
Selecting previously unselected package virtualbox-4.3.
(Reading database ... 237712 files and directories currently installed.)
Preparing to unpack virtualbox-4.3_4.3.26-98988~Ubuntu~raring_amd64.deb ...
Unpacking virtualbox-4.3 (4.3.26-98988~Ubuntu~raring) ...
Setting up virtualbox-4.3 (4.3.26-98988~Ubuntu~raring) ...
Adding group `vboxusers‘ (GID 127) ...
Done.

3.查看deb的信息

-I参数,查看详细信息

$ dpkg -I virtualbox-4.3_4.3.26-98988~Ubuntu~raring_amd64.deb 
 new debian package, version 2.0.
 size 64750912 bytes: control archive=23332 bytes.
     118 bytes,     4 lines      conffiles            
    1371 bytes,    20 lines      control              
   58951 bytes,   641 lines      md5sums              
   14579 bytes,   365 lines   *  postinst             #!/bin/sh
    2144 bytes,    59 lines   *  postrm               #!/bin/sh
    3335 bytes,    98 lines   *  preinst              #!/bin/bash
    3100 bytes,   100 lines   *  prerm                #!/bin/sh
    4666 bytes,   107 lines      templates            
 Package: virtualbox-4.3
 Version: 4.3.26-98988~Ubuntu~raring
 Architecture: amd64
 Maintainer: Oracle Corporation <info@virtualbox.org>
 Installed-Size: 147848

-c,查看包中的文件结构

$ dpkg -c virtualbox-4.3_4.3.26-98988~Ubuntu~raring_amd64.deb 
drwxr-xr-x root/root         0 2015-03-17 02:12 ./
drwxr-xr-x root/root         0 2015-03-17 02:12 ./etc/
drwxr-xr-x root/root         0 2015-03-17 02:12 ./etc/init.d/
-rwxr-xr-x root/root      6796 2015-03-17 02:12 ./etc/init.d/vboxautostart-service
-rwxr-xr-x root/root     12680 2015-03-17 02:12 ./etc/init.d/vboxdrv

Linux使用技巧9--用dpkg管理你的软件

标签:dpkg   deb安装   deb删除   

原文地址:http://blog.csdn.net/lincyang/article/details/44812613

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!