LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 10-05-2013, 03:20 PM   #16
fulvetta
LQ Newbie
 
Registered: Jun 2013
Location: Earth
Distribution: [laptop] CrunchBang Linux [server] Debian
Posts: 8

Rep: Reputation: 5

Quote:
Originally Posted by JohnnyHead View Post
Hi! I too wanted to purge my machine throughly from old uninstalled packages... I have ubuntu karmic.

I used this simple trick:

dpkg --get-selections | grep deinstall > tobepurged

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.

Last edited by fulvetta; 10-05-2013 at 03:22 PM.
 
Old 10-06-2013, 01:41 AM   #17
fulvetta
LQ Newbie
 
Registered: Jun 2013
Location: Earth
Distribution: [laptop] CrunchBang Linux [server] Debian
Posts: 8

Rep: Reputation: 5
Just ran it on my web server and it removed 133 packages. So thrilled, thanks again!
 
Old 10-07-2013, 02:46 AM   #18
JohnnyHead
LQ Newbie
 
Registered: Dec 2009
Distribution: Karmic
Posts: 2

Rep: Reputation: 1
Quote:
Originally Posted by fulvetta View Post
Just ran it on my web server and it removed 133 packages. So thrilled, thanks again!
My very pleasure
 
Old 12-18-2013, 08:57 PM   #19
fenario
Member
 
Registered: Apr 2013
Posts: 46

Rep: Reputation: Disabled
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.
 
Old 04-02-2014, 07:37 AM   #20
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,744

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
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.
 
Old 04-02-2014, 07:17 PM   #21
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,038

Rep: Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408Reputation: 1408
Hi,

I don't normally like to comment on zombie threads, but I also don't like misinformation.

Quote:
Originally Posted by JeremyBoden View Post
apt-get clean removes all history of uninstalled packages.
No it does not. It removes downloaded package files from /var/cache/apt/archives and /var/cache/apt/archives/partial/.


Evo2.
 
Old 07-01-2014, 04:26 PM   #22
cmcanulty
Member
 
Registered: Sep 2009
Posts: 32

Rep: Reputation: 0
How does purge compare to completely remove in synaptic?
 
Old 07-01-2014, 05:43 PM   #23
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,059
Blog Entries: 2

Rep: Reputation: 227Reputation: 227Reputation: 227
Quote:
Originally Posted by cmcanulty View Post
How does purge compare to completely remove in synaptic?
Same thing.
 
Old 12-17-2014, 08:20 AM   #24
sudowtf
Member
 
Registered: Nov 2013
Posts: 200

Rep: Reputation: 46
Quote:
Originally Posted by JohnnyHead View Post
Hi! I too wanted to purge my machine throughly from old uninstalled packages... I have ubuntu karmic.

I used this simple trick:

dpkg --get-selections | grep deinstall > tobepurged

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.
interesting! thank you.
same as one-liner:
Code:
dpkg --get-selections | grep deinstall | awk -F" " '{print $1}' | xargs sudo apt-get -y purge
 
Old 12-17-2014, 11:35 AM   #25
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,744

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Don't forget to remove any user files/directories which get created in /home, such as hidden config or data files.

Last edited by JeremyBoden; 12-17-2014 at 11:36 AM.
 
Old 03-15-2016, 02:37 PM   #26
jlibraryist
LQ Newbie
 
Registered: Feb 2016
Location: Chitown
Distribution: debian, ubuntu-gnome
Posts: 29

Rep: Reputation: Disabled
Quote:
Originally Posted by HappyTux View Post
apt-get --purge remove <package>

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.

Thank you.
 
Old 03-15-2016, 05:10 PM   #27
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,744

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Code:
apt-get --purge remove <package>
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.
 
Old 03-16-2016, 07:04 PM   #28
jlibraryist
LQ Newbie
 
Registered: Feb 2016
Location: Chitown
Distribution: debian, ubuntu-gnome
Posts: 29

Rep: Reputation: Disabled
Purge Remove

Thank you Jeremy.
 
Old 03-17-2016, 09:37 AM   #29
muxman
Member
 
Registered: Apr 2004
Distribution: Debian
Posts: 203

Original Poster
Rep: Reputation: 32
After 12 years this thread is still going. Nice.
 
1 members found this post helpful.
Old 03-17-2016, 10:43 AM   #30
erik2282
Member
 
Registered: May 2011
Location: TX
Distribution: Debian
Posts: 807

Rep: Reputation: 228Reputation: 228Reputation: 228
1,251,872 views is why i clicked on this.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
latex2e package unavailable in package manager or apt-get cesine Debian 2 07-11-2006 02:31 PM
how do I completely uninstall IE ddaas General 17 01-20-2005 06:21 PM
How do i COMPLETELY uninstall Linux and GRUB? Lambas Linux - Newbie 10 11-09-2004 07:37 AM
HELP with apt-getHow come when I tried to use apt-get to remove a package to regain redss Linux - Newbie 1 08-22-2004 11:59 PM
Does apt-get install <package> upgrade the package if it is already installed? davidas Debian 4 04-05-2004 06:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 04:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration