[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#893424: Cannot uninstall package



On Mon, Mar 19, 2018 at 01:42:09AM +0100, Andreas Beckmann wrote:
> Interesting. The empty directory shows up with size 0.
> What filesystem do you use for / ?

Similarly here:

rak@zeta:~$ ls -lashR /etc/mail
/etc/mail:
total 24K
   0 drwxr-xr-x 1 root root  138 Mar 18 14:32 .
   0 drwxr-xr-x 1 root root 5.3K Mar 18 17:51 ..
4.0K -rw-r--r-- 1 root root  281 Jan 13 17:43 address.resolve
   0 drwxr-xr-x 1 root root    0 Jan 13 17:43 m4
   0 drwxr-xr-x 1 root root   16 Mar 18 13:30 peers
 12K -rw-r--r-- 1 root root  12K Mar 18 13:33 sendmail.conf
4.0K -rw-r--r-- 1 root root  148 Jan 13 17:43 service.switch
4.0K -rw-r--r-- 1 root root  179 Jan 13 17:43 service.switch-nodns

/etc/mail/m4:
total 0
0 drwxr-xr-x 1 root root   0 Jan 13 17:43 .
0 drwxr-xr-x 1 root root 138 Mar 18 14:32 ..

/etc/mail/peers:
total 4.0K
   0 drwxr-xr-x 1 root root  16 Mar 18 13:30 .
   0 drwxr-xr-x 1 root root 138 Mar 18 14:32 ..
4.0K -rw-r--r-- 1 root root 328 Jan 13 17:43 provider

> What filesystem do you use for / ?

/dev/sda1 on / type btrfs (rw,relatime,ssd,space_cache,subvolid=5,subvol=/)

> The error should be triggered by this line in the prerm:
>                 # Remove empty files (probably touched databases)
>                 find /etc/mail -maxdepth 1 -size 0 | xargs -r rm;

Yeah, I think the problem is that it's calling 'rm' on directories. Tacking on a
'-type f' like you suggested (and perhaps even a '-delete' to skip the xargs
bit) would likely do the trick.

> $ find /etc/mail -maxdepth 1 -size 0
> $ find /etc/mail -maxdepth 1 -type f -size 0

rak@zeta:~$ find /etc/mail -maxdepth 1 -size 0
/etc/mail/m4
rak@zeta:~$ find /etc/mail -maxdepth 1 -type f -size 0
rak@zeta:~$

> The first should output /etc/mail/m4, the second should output nothing.

Your hunch on the error was right. I tried adding "set -x" to the top of the
prerm file, and got the following output:

rak@zeta:~$ sudo vim /var/lib/dpkg/info/sendmail-base.prerm
No protocol specified
rak@zeta:~$ sudo apt-get remove sendmail-base
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libxfont1 lockfile-progs
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  sendmail-base
0 upgraded, 0 newly installed, 1 to remove and 57 not upgraded.
After this operation, 867 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 389313 files and directories currently installed.)
Removing sendmail-base (8.15.2-10) ...
+ PACKAGE=sendmail-base
+ [ remove = remove ]
+ [ -x /usr/sbin/update-inetd ]
+ update-inetd --group MAIL --disable smtp,smtps,submission
+ [ -L /etc/mail/aliases ]
+ [ -f /etc/mail/aliases ]
+ rm -f /etc/cron.d/sendmail
+ rm -f /usr/lib/sasl/Sendmail.conf
+ rm -rf /var/lib/sendmail
+ rm -rf /var/run/sendmail
+ [ -x /etc/init.d/sendmail ]
+ [ -L /var/spool/mqueue ]
+ [ -d /var/spool/mqueue ]
+ [ -L /var/spool/mqueue-client ]
+ [ -d /var/spool/mqueue-client ]
+ rm -f /etc/mail/*.db /etc/mail/*.dir /etc/mail/*.pag
+ rm -f /etc/mail/sendmail.cf /etc/mail/sendmail.cf.old /etc/mail/sendmail.cf.errors /etc/mail/sendmail.mc.old /etc/mail/submit.cf /etc/mail/submit.cf.errors /etc/mail/submit.mc.old /etc/mail/databases /etc/mail/Makefile
+ rm -rf /etc/mail/smrsh /etc/mail/sasl /etc/mail/tls
+ find /etc/mail -maxdepth 1 -size 0
+ xargs -r rm
rm: cannot remove '/etc/mail/m4': Is a directory
dpkg: error processing package sendmail-base (--remove):
 installed sendmail-base package pre-removal script subprocess returned error exit status 123
Errors were encountered while processing:
 sendmail-base
E: Sub-process /usr/bin/dpkg returned an error code (1)

Hope this helps,
Ryan

-- 
|)|/  Ryan Kavanagh      | GPG: 4E46 9519 ED67 7734 268F
|\|\  https://rak.ac     |      BD95 8F7B F8FC 4A11 C97A

Attachment: signature.asc
Description: PGP signature


Reply to: