从 Ubuntu 卸载软件包(sendmail-base)问题

从 Ubuntu 卸载软件包(sendmail-base)问题

我尝试卸载 sendmail-base 包,但失败了。有什么方法可以删除它吗?

root@server:~# apt-get remove --purge sendmail-base 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  sendmail-base*
0 upgraded, 0 newly installed, 1 to remove and 3 not upgraded.
1 not fully installed or removed.
After this operation, 1,274kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 67543 files and directories currently installed.)
Removing sendmail-base ...
Can't locate DebianNet.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /usr/sbin/update-inetd line 23.
dpkg: error processing sendmail-base (--purge):
 subprocess installed pre-removal script returned error exit status 2
Errors were encountered while processing:
 sendmail-base
E: Sub-process /usr/bin/dpkg returned an error code (1)



root@server# uname -a
Linux server 2.6.32-27-generic-pae #49-Ubuntu SMP Thu Dec 2 00:07:52 UTC 2010 i686 GNU/Linux



root@server# dpkg -l sendmail-base
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
+++-=========================================-=========================================-==================================================================================================
pF  sendmail-base                             8.14.3-9.1ubuntu1                         powerful, efficient, and scalable Mail Transport Agent

答案1

您能DebianNet.pm在系统上找到吗?

用来apt-file search查找提供该文件的包,安装该包并重试删除。

答案2

我不确定为什么它不起作用。尝试使用这个命令行:

sudo apt-get autoremove sendmail-base

这将自动删除依赖项,然后您可以尝试再次删除它。

答案3

自从升级到 ubuntu 18.10 以来我就遇到了这个问题。

我必须结合以上答案来解决这个问题。

sudo apt autoremove sendmail-base && sudo apt install update-inetd && sudo apt remove sendmail-base

答案4

此软件包似乎需要Netbase(包括 DebianNet.pm)运行其卸载脚本。您可以安装它,然后预删除脚本应该可以正确运行。

相关内容