LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 06-19-2004, 06:31 PM   #1
Brother Michael
Member
 
Registered: Aug 2003
Location: Columbus, Ohio
Distribution: Debian
Posts: 284

Rep: Reputation: 30
Removing extra files using apt-get


Can Apt-Get scan my computer and remove excess files (like old copies of file that were upgraded with newer versions) and remove them?

If not what can I do to remove files no longer needed by my machine?

Mike
 
Old 06-19-2004, 07:08 PM   #2
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
Old copies are usually removed when the new ones are installed. You can however have multiple versions of somethings at the same time ( things like gcc for example) so you can just remove the ones you don't want with apt-get remove --purge, this will warn you if anything is dependant on it.

The other thing that can happen is an orphaned package ( where nothing else depends on it ) To check for these you can use deborphan ( apt-get install deborphan ). Use it carefully.

To remove excess stuff that apt-get has use apt-get autoclean

Last edited by leonscape; 06-19-2004 at 07:09 PM.
 
Old 06-19-2004, 07:19 PM   #3
Brother Michael
Member
 
Registered: Aug 2003
Location: Columbus, Ohio
Distribution: Debian
Posts: 284

Original Poster
Rep: Reputation: 30
When I remove a package, like lets say GAIM, will all the extra files (like dependencies) be removed with it?

Mike
 
Old 06-19-2004, 07:26 PM   #4
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
What it depends on No, its other files Yes. Configuration files will be left behind unless you told apt-get to purge.

Thats why we have deborphan. Also most of a packages depedancies might be needed by something else. but to see what a package depends on ( so you can try to remove them ) use

apt-cache depends thepackage

From what I saw, what gaim depends on most of Gnome depends on as well.
 
Old 06-19-2004, 07:36 PM   #5
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480° N, 95.3690° W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 47
aptitude is a front-end for apt-get that has options for cleaning obsolete files.
 
Old 06-19-2004, 08:50 PM   #6
Brother Michael
Member
 
Registered: Aug 2003
Location: Columbus, Ohio
Distribution: Debian
Posts: 284

Original Poster
Rep: Reputation: 30
I love Aptitude!
 
Old 06-20-2004, 10:39 AM   #7
macondo
Senior Member
 
Registered: Jul 2003
Location: Central America
Distribution: Slackwre64-current Devuan
Posts: 1,034

Rep: Reputation: 62
I run a PII/266/128Mb RAM/10GB/Sid/GRUB So i try to keep it 'lean and fast'.

After a fresh install, the second thing i do, after installing a firewall is:

#apt-get install deborphan debfoster localepurge

DEBORPHAN

after installing 'deborphan', invoke it:

#deborphan

it will give you a list of "orphaned" libraries sometimes approaching 40 MB, to get rid of them:

#deborphan | xargs apt-get -y remove --purge

without the flag -y it will abort.

this will take care of the list of files listed when you first invoked 'deborphan'.

DEBFOSTER
This is a very good program to get rid of things you THOUGHT were gone when you did an

'apt-get -y remove --purge <name of package>

I purged emacs21 (i prefer Vim), debfoster came up asking me if i wanted to keep 'emacsen', hehe, i nuked it.

invoke it:

#debfoster

if you make a mistake, don't panic, just press the key 'U' to undo and correct your mistake, the question will pop again, check 'H' for help. If you don't know what a file/library does, DO NOT ERASE IT.

LOCALEPURGE

This will eliminate all the locales you don't need after installing a program. This will save you tons of real estate on your hdd. What i do is this:

#dpkg-reconfigure locales

i choose all the instances of en_US and es_ES, (spanish being my native tongue) set my language environment in the next screen, it will generate the locales and voilá.

Next, i invoke localepurge

#localepurge

it will take me to a list of locales identical to the one previously explained. Click OK, answer the next questions and you are set.

The next time you install a package it will just keep the locales you specified, you don't need Russian or Rumanian if you barely speak English, and viceversa.

One last note: after purging a program run

apt-get clean

this will nuke all files in the installation of that package. If you want it again, then reinstall it with apt-get.

I do the debfoster and deborphan bit once a week.

Last edited by macondo; 06-20-2004 at 10:49 AM.
 
Old 06-20-2004, 05:24 PM   #8
Brother Michael
Member
 
Registered: Aug 2003
Location: Columbus, Ohio
Distribution: Debian
Posts: 284

Original Poster
Rep: Reputation: 30
Whoa, thanks a lot.

Mike
 
  


Reply



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
apt not removing dependencies JetJock Debian 11 06-18-2005 02:09 AM
Kdevelop 3.0: I don't need all these extra files! TheMusicGuy Linux - Software 0 04-14-2005 01:17 AM
Removing files wihtout removing containing Direcotry caps_phisto Linux - General 2 10-07-2004 08:16 AM
Removing extra kernels slackist Fedora 2 04-14-2004 10:20 PM
removing obsolete files in APT m_yates Debian 1 11-15-2003 06:57 PM

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

All times are GMT -5. The time now is 03:43 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