这篇文章上次修改于 832 天前,可能其部分内容已经发生变化,如有疑问可询问作者。 I frequently need to check which packages are installed, and I use the following command: ``` dpkg -l | grep foo ``` which gives the following output ``` Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Description ii foo ``` 1. What does the ii mean? 2. What other flags are there? 3. How to read the flags? (because the explanation is quite complicated, IMO) #### Where to find this information in the system You can find this information out in the head of dpkg -l output, as it's just a formatting convention: ``` dpkg -l | head -3 ``` #### Description of each field As you can see from the first three lines: ##### First letter -> desired package state ("selection state"): - u ... unknown - i ... install - r ... remove/deinstall - p ... purge (remove including config files) - h ... hold ##### Second letter -> current package state: - n ... not-installed - i ... installed - c ... config-files (only the config files are installed) - U ... unpacked - F ... half-configured (configuration failed for some reason) - h ... half-installed (installation failed for some reason) - W ... triggers-awaited (package is waiting for a trigger from another package) - t ... triggers-pending (package has been triggered) ##### Third letter -> error state (you normally shouldn't see a third letter, but a space, instead): - R ... reinst-required (package broken, reinstallation required)
没有评论