When,
while installing
Xubuntu, I decided EEEPC disk partitioning I based my decision on
previous installation typical disk usage worrying mostly about
“/home” and “/usr” partitions. I never would
have thought about running out of space in the root “/”
partition.
Then,
the first time I tried to upgrade to latest Xubuntu distribution I
got an error message about disk free space on partition being not
enough to download distribution files (that usually take a little
less than 1GB of disk space). Examining disk free space I discovered
that very little free space was left on the root partition even if it
was more then enough after my post-installation check.
Fortunately
AskUbuntu came quickly at
recover: here I quickly found a question
asked from who had the same problem. To be precise the question was
about problems with “/boot” partition low disk space bat I
suppose it was because of a different partitioning schema, by the way
solution worked for me.
Cleaning
“apt-get” leftovers
As I
learned from AskUbuntu question some of the “lost” disk
space might be occupied by unused files or apt-get temporary files.
So simply by executing the following commands …
sudo apt-get autoremovesudo apt-get clean
some
disk space can be set free.
Removing
old Linux kernel images
If
free space gained from the previous operation isn't enough some more
space can be obtained by removing old Linux kernel images. Every time
Ubuntu upgrade to e new kernel release the old one is kept available
in to be used to solve possible compatibility issues. Such feature is
scarcely user and is of no use at all in the eve of a major
distribution upgrade.
First
the currently used Linux kernel must be identified the command …
uname -a
does
the job, here is the current output
Linux eeepc900 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:34:49 UTC 2016 i686 i686 i686 GNU/Linux
while
the command …
dpkg -l 'linux-image*'
lists
all Linux kernel images currently installed, here is a sample output:
Desired=Unknown/Install/Remove/Purge/Hold| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)||/ Name Version Architecture Description+++-==============-============-============-=================================un linux-image <none> <none> (no description available)un linux-image-3. <none> <none> (no description available)rc linux-image-3. 3.19.0-15.15 i386 Linux kernel image for version 3.rc linux-image-3. 3.19.0-28.30 i386 Linux kernel image for version 3.rc linux-image-3. 3.19.0-33.38 i386 Linux kernel image for version 3.rc linux-image-3. 3.19.0-43.49 i386 Linux kernel image for version 3.ii linux-image-3. 3.19.0-56.62 i386 Linux kernel image for version 3.ii linux-image-4. 4.2.0-34.39 i386 Linux kernel image for version 4.ii linux-image-4. 4.4.0-21.37 i386 Linux kernel image for version 4.rc linux-image-ex 3.19.0-15.15 i386 Linux kernel extra modules for verc linux-image-ex 3.19.0-28.30 i386 Linux kernel extra modules for verc linux-image-ex 3.19.0-33.38 i386 Linux kernel extra modules for verc linux-image-ex 3.19.0-43.49 i386 Linux kernel extra modules for veii linux-image-ex 3.19.0-56.62 i386 Linux kernel extra modules for veii linux-image-ex 4.2.0-34.39 i386 Linux kernel extra modules for veii linux-image-ex 4.4.0-21.37 i386 Linux kernel extra modules for veii linux-image-ge 4.4.0.21.22 i386 Generic Linux kernel image
eventually
older kernel images can be removed with an “apt-get”
command like the following, changing of course the version number
sudo apt-get -y purge linux-image-x.yy.z-tt-generic linux-image-extra-x.yy.z-tt-generic linux-headers-x.yy.z-tt linux-headers-x.yy.z-tt-generic
If
you look deeper in AskUbuntu answer you'll see that more complex
scripts can be used to make the operation faster. I stopped here, I
don't like automating too much when deleting things and, after all,
this it's I problem I get into at most twice a year. So … I can do
it manually