I uninstalled and purged BURG bootloader and all it's repositories and files but when I try to reinstall it, I get an error saying "Not replacing deleted config file /etc/default/burg" and when it shows that error, upon boot, my BURG has no themes and looks like GRUB. Any help?
4 Answers
Purging the package is not enough: ucf (update configuration files) protects the files. One way to avoid this is to force ucf default action. I didn't had much luck with confmiss in dpkg options, so I've read the ucf documentation.
- override the default ucfaction, to create configuration if it doesn't already exists:
export UCF_FORCE_CONFFMISS=1
- purge the package:
apt-get purge burg
- reinstall the package:
apt-get install burg
- set back the ucfdefault action:
export UCF_FORCE_CONFFMISS=
Side note: you can use UCF_FORCE_CONFFNEW=1 to erase your configuration files, but use with caution.
 
    
    - 161
Since purging the package can cause all kinds of dependency problems, here's a script to pull the problems out of apt, purge ucf, then get the config files back. It's disgusting to have to do this.
This is reinstall-purge-ucf:
#!/bin/bash
PACKAGE=$1
apt-get install --reinstall $PACKAGE | grep 'Not replacing deleted config file' | awk '{print $6}' | tr -d '[$]' | tr -d '[\r]' |  xargs -t -n 1 ucf -p 
apt-get install --reinstall $PACKAGE
Now do, for example:
# ./reinstall-purge-ucf php7.4-json
ucf -p /etc/php/7.4/mods-available/json.ini
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/19.3 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 191911 files and directories currently installed.)
Preparing to unpack .../php7.4-json_7.4.30-1+deb11u1_amd64.deb ...
Unpacking php7.4-json (7.4.30-1+deb11u1) over (7.4.30-1+deb11u1) ...
Setting up php7.4-json (7.4.30-1+deb11u1) ...
Processing triggers for libapache2-mod-php7.4 (7.4.30-1+deb11u1) ...
Processing triggers for php7.4-fpm (7.4.30-1+deb11u1) ...
NOTICE: Not enabling PHP 7.4 FPM by default.
NOTICE: To enable PHP 7.4 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php7.4-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
Processing triggers for php7.4-cli (7.4.30-1+deb11u1) ...
Processing triggers for php7.4-phpdbg (7.4.30-1+deb11u1) ...
And then the files we need are there.
 
    
    - 181
With apt, you have to add the parameter --reinstall like this:
sudo apt -y --reinstall install burg
It will reinstall deleted config files.
I don't know if apt exists in 16.04.
 
    
    - 109
 
    