删除rc状态的包

ubuntu下,用apt-get remove 某个软件包后,用dpkg -l 查看,有些包变成rc 状态
rc状态的意思是:

    r: the package is marked for removal.    
    c: the configuration files are currently present in the system    

要想彻底删除,可以用以下命令:

dpkg -l | grep ^rc | cut -d' ' -f3| sudo xargs dpkg -P

或:

dpkg --list | grep "^rc" | cut -d " " -f 3 | xargs sudo dpkg --purge

man dpkg有这样的说明:

 -r, --remove, -P, --purge package...|-a|--pending
          Remove  an  installed  package.  -r  or --remove remove everything except conffiles. This may avoid having to
          reconfigure the package if it is reinstalled later. (Conffiles are configuration files that are listed in the
          DEBIAN/conffiles  control file). -P or --purge removes everything, including conffiles. If -a or --pending is
          given instead of a package name, then all packages unpacked, but marked to  be  removed  or  purged  in  file
          /var/lib/dpkg/status, are removed or purged, respectively. Note: some configuration files might be unknown to
          dpkg because they are created and handled separately through the configuration scripts. In  that  case,  dpkg
          won't  remove  them by itself, but the package's postrm script (which is called by dpkg), has to take care of
          their removal during purge. Of course, this only applies to files in system  directories,  not  configuration
          files written to individual users' home directories.

          Removing of a package consists of the following steps:

          1. Run prerm script

          2. Remove the installed files

          3. Run postrm script

转载于:https://my.oschina.net/u/1000151/blog/197778

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值