dpkg -l 命令可以浏览所有安装的包,其中 rc 状态的包即卸载了包却保留了配置文件。如果想要完整删除所有 rc 状态的包一个一个删还是很麻烦的,所以可以使用以下命令进行清理。
1
| dpkg -l | grep ^rc | cut -d' ' -f3 | sudo xargs dpkg --purge
|
使用实例
1 2 3 4 5 6 7 8 9
| 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$
|