LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 01-07-2009, 03:41 PM   #1
fof3
Member
 
Registered: Nov 2003
Distribution: Debian - Lenny
Posts: 174

Rep: Reputation: 30
Pruning a huge /usr directory with 'aptitude'


edhe@hebrews:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 4.6G 4.0G 438M 91% /usr

hebrews:/usr# du -h --max-depth=1
11M ./sbin
1.3G ./lib
16K ./lost+found
327M ./src
7.4M ./games
14M ./include
1.8G ./share
263M ./local
4.0K ./X11R6
171M ./bin
3.8G .

I want to remove unneeded packages. I was told that aptitude was the tool to use; and that with it I could determine the usage frequency of a package;and to use that as a criteria for deleting. I saw no mention of this in aptitude/doc/en. Any comments, or advice?
 
Old 01-07-2009, 03:59 PM   #2
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, SolydK 2013
Posts: 7,434

Rep: Reputation: 134Reputation: 134
Quote:
Originally Posted by fof3 View Post

I want to remove unneeded packages.
One way to approach this is to run orphaner. Orphaner will tell you which packages are not dependencies of any other packages. Look through the orphans and remove any orphaned packages that you no longer use.

--------------------
Steve Stites
 
Old 01-07-2009, 04:01 PM   #3
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,231
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
/usr is where most user applications are installed.. so what is installed in your system that you don't need ?

for a list of installed applications with descriptions

aptitude search ~i > installed_apps.txt - create a file containing installed apps.
less installed_apps.txt - open and view the list of installed apps.

aptitude remove <packagename>
- to uninstall a package
 
Old 01-07-2009, 04:02 PM   #4
arckane
Member
 
Registered: Sep 2005
Location: UK
Distribution: Gentoo/Debian/Ubuntu
Posts: 306

Rep: Reputation: 37
Not sure about the package usage. There are tools to monitor this but I don't believe any are setup by default.

dpkg -l (that's an EL, not a ONE) will list all installed packages, as would synaptic and filter for installed if you prefer a GUI.

To aid in uninstalling packages, only uninstall packages you _know_ you don't need. IE you may have installed supertux but don't play it anymore, so that's safe. You spot glibc, don't know what it is and uninstall and all of a sudden you've broken your system. BE CAREFUL is what I'm trying to say here
 
Old 01-07-2009, 04:08 PM   #5
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware-14.0 on a Lenovo T61 6457-4XG
Posts: 3,644

Rep: Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828
Guess you have other partitions than the one shown. The problem could be that you made too thin slices of your hard disk, not that you installed too many applications.

So please give us the *complete* output of "df -h" as well as the output of "cat /etc/fstab". and for the sake of clarity wrap [CODE] tags around the text.
 
Old 01-12-2009, 01:56 PM   #6
fof3
Member
 
Registered: Nov 2003
Distribution: Debian - Lenny
Posts: 174

Original Poster
Rep: Reputation: 30
edhe@hebrews:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 935M 415M 473M 47% /
tmpfs 470M 0 470M 0% /lib/init/rw
udev 10M 96K 10M 1% /dev
tmpfs 470M 0 470M 0% /dev/shm
/dev/sda9 356G 2.8G 335G 1% /home
/dev/sda8 373M 11M 343M 3% /tmp
/dev/sda5 4.6G 4.0G 438M 91% /usr
/dev/sda6 2.8G 323M 2.3G 13% /var



edhe@hebrews:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/sda1 / ext3 defaults,errors=remount-ro 0 1
/dev/sda9 /home ext3 defaults 0 2
/dev/sda8 /tmp ext3 defaults 0 2
/dev/sda5 /usr ext3 defaults 0 2
/dev/sda6 /var ext3 defaults 0 2
/dev/sda7 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0
 
Old 01-12-2009, 02:22 PM   #7
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware-14.0 on a Lenovo T61 6457-4XG
Posts: 3,644

Rep: Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828
So the problem arise because your /usr is way too small but you have plenty of room elsewhere, e.g. in /home

What I would do:

1) Get gparted. For that I recommand dowloadin and burning a live cd
2) After having made a backup of all your valuables data, use gparted to resize your partitions. First downsize sda9 (for /home) a lot, then use the freed space to upsize sda1 (for /), sda5 (for /usr) and sda6 (for var/). Probably you will have to move some partitions to use the free space. Plan carefully before doing all that it and don't cancel a process (move or resize) once started even if it takes time.
3) If needed, update your /etc/fstab accordingly.

More generally, but for special needs I recommend making only three partitions for a Linux distribution:
- reserve around 20 gigabytes for /
- may be two gigabytes for swap
- all the remaining space for /home

So you won't fall into this kind of issue.

Last edited by Didier Spaier; 01-12-2009 at 02:24 PM.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Huge directory files and performance Undertoad Linux - Software 5 05-01-2007 10:09 AM
Deleting a HUGE Directory teamchachi Linux - Software 1 03-07-2007 04:28 PM
Installing software, /usr/lib directory and /usr/local millertime Linux - Software 2 07-10-2004 09:21 AM
Need some file pruning help... smeenge Linux - Newbie 3 05-22-2004 03:02 AM
Pruning termcap aditya Linux - General 1 09-06-2002 03:03 AM


All times are GMT -5. The time now is 12:46 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration