debin,ubuntu删除所有带 rc 标记的dpkg包

dpkg -l 命令可以浏览所有安装的包,其中 rc 状态的包即卸载了包却保留了配置文件。如果想要完整删除所有 rc 状态的包一个一个删还是很麻烦的,所以可以使用以下命令进行清理

[plain]  view plain copy
  1.   

[html]  view plain copy
  1. dpkg -l | grep ^rc | cut -d' ' -f3 | sudo xargs dpkg --purge  

使用实例

niu@niu:~/download/wordpress$ dpkg -l | grep ^rc | cut -d' ' -f3 | sudo xargs dpkg --purge
(Reading database ... 176063 files and directories currently installed.)
Removing freeglut3 ...
Purging configuration files for freeglut3 ...
Removing libphysfs1 ...
Purging configuration files for libphysfs1 ...
Removing libsdl-pango1 ...
Purging configuration files for libsdl-pango1 ...
niu@niu:~/download/wordpress$



转自:http://blog.csdn.net/chrisniu1984/article/details/6619755

你可能感兴趣的:(debin,ubuntu删除所有带 rc 标记的dpkg包)