I know I can use this to remove a package but keep configuration:
sudo apt-get remove $package
I know I can also use this to remove a package and discard its configuration files:
sudo apt-get purge $package
But what if I want to keep a package but discard its configuration?
Context: I did something wrong with Network Manager and it's started segfaulting on a loop, and while sudo service network-manager stop
works, I also kinda want to use WiFi. If this was just any old boring package, I could just purge and reinstall it. That's obviously not an option for Network Manager, since ubuntu-desktop depends on it.
To reinstall the package and overwrite the changed configurations in
/etc
with the configuration of the package runBut this command doesn't affect configurations in your home folder, because nothing in the home folder will be changed by the package manager.