-1

How does a person remove/purge residual files after uninstalling/purging an application?

After uninstalling AirVPN Eddie client via

sudo apt-get remove --purge airvpn

I still have the affected (corrupted?) conf files in the /etc directory. I'm looking for other files that remain that are keeping my wifi from working. See this question:

DNS conflicts & no connect wifi VPN

Right-clicking and deleting these files doesn't work. What is the proper command to take ownership of hidden and system files and delete them?

2
  • You should be able to delete any file with sudo rm filename, and any directory with sudo rm -r dirname, if you have sudo rights. Just be careful, and don't delete too much. Dec 4, 2017 at 23:50
  • seems like an XY problem. Why don't you edit your question to give the full story? We have told you how to purge packages but it didn't solve your problem, so tell us about the real problem...
    – Zanna
    Dec 6, 2017 at 10:09

1 Answer 1

1

During the removal of package, corresponding .prerm and .postrm scripts (stored in /var/lib/dpkg/info) for the package should clean up and remove the files for the package, but those scripts may be missing removal for a few files or something failed in the process while script was running.

When a package is installed via apt-get or apt, there will be a .list file in /var/lib/dpkg/info folder with list of all directories and files that were used by the package. You could go over contents of that file and remove items individually via sudo rm <filename> command. One possible quick way to figure out which items from the list are still there would be to do the following:

while IFS= read -r line || [ -n "$line" ]; 
do 
    [ -f "$line" ] && printf "%s\n" "$line"  
done < /var/lib/dpkg/info/<PACKAGE-NAME>.list 

Of course you could replace printf part with rm, and run this loop as root, but I wouldn't recommend doing that. Use discretion, verify each file is not used by something else and is actually something you can remove without breaking your system.

1
  • Thanks for this guide. Since it is a third party and trusted software >AirVPN Eddie client, this approach may not work. The "conf" files from network manager and resolv.conf need to be removed or editied for a fresh install of the client, to fix a DNS problem. Dec 5, 2017 at 15:38

Not the answer you're looking for? Browse other questions tagged .