how do I get apt-get to completely uninstall a package?
DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
then opened the resulting file and removed the "deinstalled" line from each entry (used find deinstall and replace *blank*, there were a couple hundred packages). Finally:
cat tobepurged | xargs sudo dpkg -P
It worked fine for me and most important.. it didn't purge active packages!
Hope to hear some suggestions and ways to make it better. It's the first time I post an original solution (I understand it's very basic...) of mine on a linux forum.
I am well aware that this is a considerable bump, but I wanted to thank you for posting this. It worked beautifully on my CB system.
s4sarath, yes in Ubuntu it is the same as Debian. Downloaded packages are kept in: /var/cache/apt/archives/
before you clean them out you could save them on an external HDD, just in case you may want/need to re-install them later on if you can't waste your download quota.
muxman, some programs add hidden folders (with a . in front; use keys: Ctrl + H to unhide them)
mostly they would be left behind after removing programs.
So if you don't need those folders again you can remove them too.
sudo apt-get purge 'package' removes the package files and also config files from /etc.
I think it also removes /var/log files - but not sure.
If you accept any prompts to remove dependent packages, they are simply removed (not purged).
However - apt-get does NOT remove files created in /home (usually prefixed with a dot).
This is a real pain - I've kept the same /home for years and running
apt-get clean removes all history of uninstalled packages.
However the clean option speeds up simplistic backup programs by a huge factor...
Last edited by JeremyBoden; 04-02-2014 at 07:43 AM.
then opened the resulting file and removed the "deinstalled" line from each entry (used find deinstall and replace *blank*, there were a couple hundred packages). Finally:
cat tobepurged | xargs sudo dpkg -P
It worked fine for me and most important.. it didn't purge active packages!
Hope to hear some suggestions and ways to make it better. It's the first time I post an original solution (I understand it's very basic...) of mine on a linux forum.
You should never remove files by hand use dpkg --purge <package> if you have already removed it with apt plus the files by hand and it thinks it is still configured this should get rid of it.
See above and try apt-get --reinstall install <package> to see if it helps if not the dpkg --purge then reinstall.
I am running a VM debian 8.3 testing a multitude of things and definitely found this suggestion for dpkg --purge <package> command to work.
I thought I'd toss in my 2 cents as a newbie learner.
will remove all references to a package, including config files in /etc.
It won't touch any files in /home including any hidden files such as user config files.
Just using
Code:
apt-get remove <package>
or its equivalent in synaptic will leave some dross lying around.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.