LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Pruning a huge /usr directory with 'aptitude' (https://www.linuxquestions.org/questions/linux-newbie-8/pruning-a-huge-usr-directory-with-aptitude-695680/)

fof3 01-07-2009 03:41 PM

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?

jailbait 01-07-2009 03:59 PM

Quote:

Originally Posted by fof3 (Post 3400349)

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

farslayer 01-07-2009 04:01 PM

/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

arckane 01-07-2009 04:02 PM

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 :)

Didier Spaier 01-07-2009 04:08 PM

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.

fof3 01-12-2009 01:56 PM

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

Didier Spaier 01-12-2009 02:22 PM

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.


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