该命令dpkg -l
用于列出系统中所有已安装的包。
但如果你查看如下输出:
ii whoopsie 0.1.34 Ubuntu crash database submission daemon
rc wicd-daemon 1.7.2.3-1ubunt wired and wireless network manager - daemon
rc wicd-gtk 1.7.2.3-1ubunt wired and wireless network manager - GTK+ cl
ii winbind 2:3.6.3-2ubunt Samba nameservice integration server
ii wine 1:1.7.18-0ubun Microsoft Windows Compatibility Layer (meta-
ii wine-gecko2.21 2.21-0ubuntu1~ Microsoft Windows compatibility layer (embed
ii wine-gecko2.21 2.21-0ubuntu1~ Microsoft Windows compatibility layer (embed
ii wine-mono0.0.8 0.0.8-0ubuntu1 Microsoft Windows compatibility layer (.NET
rc wine1.4 1.4.1-0ubuntu1 Microsoft Windows Compatibility Layer (Binar
rc wine1.4-amd64 1.4.1-0ubuntu1 Microsoft Windows Compatibility Layer (64-bi
rc wine1.4-i386:i 1.4.1-0ubuntu1 Microsoft Windows Compatibility Layer (32-bi
ii wine1.6 1:1.6.1-0ubunt Microsoft Windows Compatibility Layer (Binar
您可以看到第一个元素是ii
或rc
。
ii
所以我的问题是and的含义是什么 rc
?
答案1
要获得该信息,您需要查看的手册页dpkg-query
。来自man dpkg-query
:
输出的前三列按顺序显示所需的操作、包状态和错误。
Desired action: u = Unknown i = Install h = Hold r = Remove p = Purge Package status: n = Not-installed c = Config-files H = Half-installed U = Unpacked F = Half-configured W = Triggers-awaiting t = Triggers-pending i = Installed Error flags: <empty> = (none) R = Reinst-required
答案2
引自https://linuxprograms.wordpress.com/2010/05/11/status-dpkg-list/
每个包裹的状态用三个字符 xxx 表示
第一个字符表示所需状态
u: Unknown (an unknown state)
i: Install (marked for installation)
r: Remove (marked for removal)
p: Purge (marked for purging)
h: Hold
第二个字符表示当前状态,是否安装。
n: Not- The package is not installed
i: Inst – The package is successfully installed
c: Cfg-files – Configuration files are present
u: Unpacked- The package is stilled unpacked
f: Failed-cfg- Failed to remove configuration files
h: Half-inst- The package is only partially installed
W: trig-aWait
t: Trig-pend
第三个字符对应错误状态。
R: Reinst-required The package must be installed.
然后
rc
删除配置文件存在的软件包
ii
找到标记为安装的软件包,并成功安装