使用如下命令: dpkg --get-selections |grep deinstall | sed 's/deinstall/\lpurge/' | sudo dpkg --set-selections; sudo dpkg -Pa
解释: 1、dpkg –get-selections显示标记为“deinstall”的包,显示结果 - root@langchao-PC:~# dpkg --get-selections |grep deinstall
- deepin-screen-recorder deinstall
复制代码 2、sed 's/deinstall/\lpurge/'的作用是将上面的输出deepin-screen-recorder deinstall修改为deepin-screen-recorder purge- root@langchao-PC:~# dpkg --get-selections |grep deinstall|sed 's/deinstall/\lpurge/'
- deepin-screen-recorder purge
复制代码3、dpkg --set-selections即将pkg包修改为purge
4、 dpkg -Pa的作用是将标记为purge的包的配置信息清除 -P, --purge package...|-a|--pending Purge an installed or already removed package. This removes everything, including conffiles, and anything else cleaned up from postrm. If -a or --pending is given instead of a package name, then all packages unpacked or removed, but marked to be purged in file /var/lib/dpkg/status, are purged. |