Purge apparmor ( 2.10.95-0ubuntu2.5~14.04.1) fail

Bug #1662127 reported by Jeffery Lin on 2017-02-06
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
AppArmor
Undecided
Unassigned

Bug Description

Hi all,

New Trusty images already have apparmor with version 2.10.95-0ubuntu2.5~14.04.1
But I will get following problem when I want to purge apparmor.

# apt-get purge apparmor -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  apparmor*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 107063 files and directories currently installed.)
Removing apparmor (2.10.95-0ubuntu2.5~14.04.1) ...
Purging configuration files for apparmor (2.10.95-0ubuntu2.5~14.04.1) ...
rmdir: failed to remove ‘/var/lib/apparmor/profiles’: No such file or directory
dpkg: error processing package apparmor (--purge):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 apparmor
E: Sub-process /usr/bin/dpkg returned an error code (1)

=====

After checking the apparmor.postrm, I find it is caused by following rmdir command.

36 rmdir --ignore-fail-on-non-empty /var/lib/apparmor/profiles
37 rmdir --ignore-fail-on-non-empty /var/lib/apparmor

=====
I think the directory /var/lib/apparmor already deleted when package is removed but the postrm script still try to rmdir it and make purge action failed.
could you help to check it ?

Thanks.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers