[config-package-dev] config-package, package removal

Tyler Retzlaff tretzlaff at sparqsys.com
Tue Jan 13 14:39:27 EST 2015


I've been using config-package successfully for diverting configuration 
files for custom configuration.  Recently, I've hit a problem where 
uninstalling a package that contains a diversion complains that the file 
is being ignored because it has an invalid filename extension.

mypackage.deb has 2 diversions, one for /etc/ntp.conf and one for 
/etc/apt/apt.conf.d/50unattended-upgrades

My package.displace file looks as follows.

/etc/apt/apt.conf.d/50unattended-upgrades.mypackage
/etc/ntp.conf.mypackage

I observe the following when installing and then removing the package.

e.g.
$ dpkg -i mypackage.deb

seems to work fine

$ ls -l /etc/ntp.conf*
lrwxrwxrwx 1 root root   14 Jan 13 19:25 /etc/ntp.conf -> ntp.conf.mypackage
-rw-r--r-- 1 root root 1936 Oct  9  2013 /etc/ntp.conf.dpkg-new
-rw-r--r-- 1 root root  574 Jan 13 17:59 /etc/ntp.conf.mypackage
-rw-r--r-- 1 root root 1936 Dec 20 11:51 /etc/ntp.conf.mypackage-orig

$ ls -l /etc/apt/apt.conf.d/50unattended-upgrades*
lrwxrwxrwx 1 root root   27 Jan 13 19:25 
/etc/apt/apt.conf.d/50unattended-upgrades -> 50unattended-upgrades.mypackage
-rw-r--r-- 1 root root 2326 Jan 13 17:59 
/etc/apt/apt.conf.d/50unattended-upgrades.mypackage
-rw-r--r-- 1 root root 2331 Apr  2  2014 
/etc/apt/apt.conf.d/50unattended-upgrades.mypackage-orig

However when I try to remove the package I get.

$ apt-get remove --purge mypackage
Removing 'diversion of /etc/ntp.conf to /etc/ntp.conf.mypackage-orig by 
mypackage'
Removing 'diversion of /etc/apt/apt.conf.d/50unattended-upgrades to 
/etc/apt/apt.conf.d/50unattended-upgrades.mypackage-orig by mypackage'
N: Ignoring file '50unattended-upgrades.mypackage-orig' in directory 
'/etc/apt/apt.conf.d/' as it has an invalid filename extension
N: Ignoring file '50unattended-upgrades.mypackage' in directory 
'/etc/apt/apt.conf.d/' as it has an invalid filename extension

$ ls -l /etc/ntp.conf*
-rw-r--r-- 1 root root 1936 Dec 20 11:51 /etc/ntp.conf
-rw-r--r-- 1 root root 1936 Oct  9  2013 /etc/ntp.conf.dpkg-new

$ ls -l /etc/apt/apt.conf.d/50unattended-upgrades*
-rw-r--r-- 1 root root 2331 Apr  2  2014 
/etc/apt/apt.conf.d/50unattended-upgrades

Still the files are removed but I'm concerned about the inconsistency in 
warning I'm getting when removing the package.  I only get it for the 
diverted file in /etc/apt/apt.conf.d/ but not /etc.

If I had to speculate (and I often do wildly) I'd say there is something 
going wrong in extension parsing where the diversion path contains 
additional '.' characters...?

Would anyone be able to shed some light on what is going on here? Or 
better how to resolve/work around it? Or maybe I shouldn't be diverting 
files in that path and instead solving this problem another way?

Kind regards,

Tyler



More information about the config-package-dev mailing list