大家经常和deb包打交道。总结了一下dpkg,试试平时简单的代替synaptic的某些工作。

新手涉及到的教学或入门贴,推荐新手必看,版主维护
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

大家经常和deb包打交道。总结了一下dpkg,试试平时简单的代替synaptic的某些工作。

#1

帖子 eexpress » 2005-10-19 1:11

最常用的就是-i,-r。简单,安装/卸载。不用说。
下面简单介绍最常用,也最好用的4种命令参数。也好记,L,l,S,s。大小L和大小S。
-------------------------------
dpkg -L|--listfiles <软件包名> ... 列出所有“属于”该软件包(或多个软件包) 的文件
相当与synaptic的看包属性
~$ dpkg -L gcc-3.4|head -n 5
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/gcc-3.4-base
-------------------------------
dpkg -l|--list [<表达式> ... 简明地列出软件包的状态
查找包,使用表达式,方便很多
$ dpkg -l gcc*
期望状态=未知(u)/安装(i)/删除(r)/清除(p)/保持(h)
| 当前状态=未(n)/已安装(i)/仅存配置(c)/仅解压缩(U)/配置失败(F)/不完全安装(H)
|/ 错误?=(无)/保持(?)/须重装(R)/两者兼有(#) (状态,错误:大写=故障)
||/ 名称 版本 简介
+++-==============-==============-============================================
ii gcc 3.3.5-1 The GNU C compiler
un gcc-2.95 <无> (无相关介绍)
un gcc-3.2 <无> (无相关介绍)
ii gcc-3.3 3.3.5-8ubuntu2 The GNU C compiler
ii gcc-3.3-base 3.3.5-8ubuntu2 The GNU Compiler Collection (base package)
un gcc-3.3-doc <无> (无相关介绍)
ii gcc-3.4 3.4.3-9ubuntu4 The GNU C compiler
ii gcc-3.4-base 3.4.3-9ubuntu4 The GNU Compiler Collection (base package)
un gcc-3.4-doc <无> (无相关介绍)
un gcc-3.5-base <无> (无相关介绍)
ii gcc-4.0-base 4.0.0-7ubuntu6 The GNU Compiler Collection (base package)
un gcc-doc <无> (无相关介绍)
-------------------------------
dpkg -S|--search <表达式> ... 搜寻拥有该文件(或多个文件)的软件包
由单个(多个)文件回溯找包
$ dpkg -S /usr/share/doc/gcc-3.4-base/FAQ.gz
gcc-3.4: /usr/share/doc/gcc-3.4-base/FAQ.gz

链接也可以自动处理
$ ls -l /usr/bin/ppp*
lrwxrwxrwx 1 root root 15 2005-09-17 01:11 /usr/bin/pppoeci -> eciadsl-pppoeci

$ dpkg -S /usr/bin/pppoeci
eciadsl-usermode: /usr/bin/pppoeci
-------------------------------
dpkg -s|--status <软件包名> ... 显示软件包详尽的状态信息
相当于synaptic看依赖关系
$ dpkg -s gcc-3.4
Package: gcc-3.4
Status: install ok installed
Priority: optional
Section: devel
Installed-Size: 4404
Maintainer: Debian GCC maintainers <debian-gcc@lists.debian.org>
Architecture: i386
Version: 3.4.3-9ubuntu4
Provides: c-compiler
Depends: gcc-3.4-base (>= 3.4.3-9ubuntu4), libgcc1 (>= 1:3.4.3-9ubuntu4), libc6 (>= 2.3.2.ds1-4), cpp-3.4 (>= 3.4.3-9ubuntu4), cpp-3.4 (<< 3.4.5), binutils (>= 2.15-5)
Recommends: libc6-dev (>= 2.3.2.ds1-16)
Suggests: gcc-3.4-doc (>= 3.4.3-9ubuntu4), amd64-libs-dev
Conflicts: gcc-3.2 (<= 1:3.2.3-0pre8)
Description: The GNU C compiler
This is the GNU C compiler, a fairly portable optimizing compiler for C.
.
ABIs changed between gcc-3.3 and gcc-3.4 on some architectures (hppa, m68k,
mips, mipsel, sparc). Please read /usr/share/doc/gcc-3.4/README.Debian
for more details.
-----------------------------------------------
其他的大家可以补充。觉得还是dpkg很方便。起码看点信息不要老是sudo。
上次由 eexpress 在 2005-10-21 21:06,总共编辑 1 次。
● 鸣学
zhuzhzh
帖子: 265
注册时间: 2005-07-28 15:08

#2

帖子 zhuzhzh » 2005-10-19 10:01

不错

赞人品


给英文不好的人很多帮助
无声胜有声
头像
内存不足
论坛版主
帖子: 3277
注册时间: 2005-08-18 18:43
联系:

#3

帖子 内存不足 » 2005-10-27 16:12

| 这个怎么打出来的?
໌→ iCookie Gtk Theme
໌→DropPlusBluetheme
กรัก กรัก`菠萝
christoph
帖子: 45
注册时间: 2005-05-08 13:25

#4

帖子 christoph » 2005-10-27 17:00

内存不足 写了:| 这个怎么打出来的?


:shock:

就是 shift+反斜杠
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

#5

帖子 eexpress » 2005-10-27 21:59

内存不足
说什么呢?
● 鸣学
头像
yang119345
帖子: 570
注册时间: 2005-06-19 14:22
来自: 上海
联系:

#6

帖子 yang119345 » 2006-03-26 19:57

:shock: 不就是管道符号 ?
cnpcbgp
帖子: 64
注册时间: 2007-05-26 8:28

#7

帖子 cnpcbgp » 2007-06-06 16:14

多谢!,正愁不知道怎么卸载呢
头像
skyx
论坛版主
帖子: 9202
注册时间: 2006-12-23 13:46
来自: Azores Islands
联系:

#8

帖子 skyx » 2007-06-13 21:28

多谢,希望全部都一一对应起来
no security measure is worth anything if an attacker has physical access to the machine
dh2563256
帖子: 38
注册时间: 2007-06-02 14:14

#9

帖子 dh2563256 » 2007-06-14 9:13

谢谢。学习了。 :lol: :lol:
头像