I've build a custom debian package with shuold overwrite configs of lightdm (autologin). My install script (debian/install) contains the following lines:
But I get the following error while installing my custom package:
dpkg: error processing /var/cache/apt/archives/AAA (--unpack): trying to overwrite `/etc/lightdm/lightdm.conf.d/20-lubuntu.conf', which is also in package CCC dpkg-deb: subprocess paste killed by signal (Broken pipe) Errors were encountered while processing: AAA E: Sub-process /usr/bin/dpkg returned an error code (1)
I know i can use the param --force-overwrite to install the package via dpkg. But I want to install it as dependency of an other package. So how can I allow my package to overwrite the config files of other packages?
I tried this but it wont work (debian/rules):
#!/usr/bin/make -f %: dh $@ override_dh_command: dh_command -- --force-overwrite override_dh_installdeb: dh_installdeb -- --force-overwrite
I got it. There is only on thing left. Now i can divert the original conf file. But the checksums of my DEBIAN/conffile is invalid so I deleted it. My debian/rules file:
overrider dh_installdeb: dh_installdeb rm debian/mypackage-name/DEBIAN/conffiles
I get the follwing warning:
Configuration file `/etc/lightdm/lightdm.conf.d/20-ubuntu.conf' ==> Modified (by you or by a script) since installation. ==> Package distributor has shipped an updated version. What would you like to do about it ? Your options are: Y or I : install the package maintainer's version N or O : keep your currently-installed version D : show the differences between the versions Z : start a shell to examine the situation The default action is to keep your current version. *** bash.bashrc (Y/I/N/O/D/Z) [default=N] ?
How can I remove the warning message?
This is the content of my debian/preinst file:
#!/bin/bash dpkg-divert --add --package mypackage-name --rename --divert /etc/lightdm/lightdm.conf.d/20-lubuntu.conf.real /etc/lightdm/lightdm.conf.d/20-lubuntu.conf
Content of my debian/install file:
#!/usr/bin/make -f %: dh $@ override_dh_builddeb: dh_builddeb -- -z1 overrider dh_installdeb: dh_installdeb rm debian/mypackage-name/DEBIAN/conffiles