[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: sytem running out of free disk space



--- Realos <realos@loftmail.com> wrote:

> hello,
> 
> I have a debian machine with 1.4G hard disk which is running out of
> space. Running "apt-get autoclean" and "apt-get autoclean" have provided
> me with about 100M free space but it is still too short for my server
> machine.
> 
> I see there are lots of documentations and unnecessary things on my
> system (like locales I will never use etc.).
> 
> Can you people point me to a documentation or give some hints how to
> deal with such problems in debian? I am not new to linux but have
> relatively little experience with debian.
> 
> Regards,
> 
> 
> -- 
> Realos

If it's a server and you don't need X you can jettison all those
packages.

If this is a system that's been running for a while, of course,
make sure /var/log isn't filling up too much.

Also, these three amigos can help clean house: deborphan, debfoster,
and localepurge.

Finally, there should be a way to list installed packages by-size
on your system. I don't know how you'd do that, so here's a clumsy
script that I just came up with that can do it:

#!/usr/bin/perl

use strict;
use warnings;

open DPKG_FILE, "< /var/lib/dpkg/status" or die "Gah! $!";

my %size_of_pkg;
my $temp_pkg_name;

my @temp_listing;

while ( <DPKG_FILE> ) {
    if ( m/^Package/ or m/^Installed-Size/ ) {
        push @temp_listing, $_;
    }
}

close DPKG_FILE;

# Now, some packages may not list an Installed-Size. Remove those from our
listing.
for ( @temp_listing ) {
    if ( m/^Package/ ) {
        # save this pkg name and look for a size.
        $temp_pkg_name = ( split( ' ', $_ ) )[-1]; # Get the name of the
package,
        next;
    }
    if ( m/^Installed-Size/ ) {
        $size_of_pkg{$temp_pkg_name} = ( split(' ', $_) )[-1];
        next;
    }
}

my %pkg_whose_size_is = reverse %size_of_pkg;
for ( sort { $a <=> $b } keys %pkg_whose_size_is ) {
    print "$_\t$pkg_whose_size_is{$_}\n"; # Biggest gets printed last.
}


---John



	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com



Reply to: