On Freya, in a virtual machine
sudo apt-get autoremove does not anything. I wanted to free up some disk space and it has no packages to remove, but there should be packages like old kernels, etc.
apt-get autoremove does not remove old kernels (by design). If you want to free up some space by removing old kernels you have to do this manually, but it's advised that the latest two kernel versions remain.
How-to remove old kernels manually
Fair warning: You should only mess with kernels (removing as well as manually installing new ones) if there is a need for it (space constraints or problems with the current kernel). Figuratively the kernel is the heart of your system, elementary really can't live without it!
Lines starting with
$ denote commands you have to input in terminal, the following text is example output from my machine.
First display the kernel you are currently using, you want to keep that:
$ uname -r 3.19.0-26-generic
Then list all currently installed kernels:
$ dpkg -l | grep linux-image- ii linux-image-3.13.0-62-generic 3.13.0-62.102 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP ii linux-image-3.16.0-46-generic 3.16.0-46.62~14.04.1 amd64 Linux kernel image for version 3.16.0 on 64 bit x86 SMP ii linux-image-3.19.0-26-generic 3.19.0-26.28~14.04.1 amd64 Linux kernel image for version 3.19.0 on 64 bit x86 SMP ii linux-image-extra-3.13.0-62-generic 3.13.0-62.102 amd64 Linux kernel extra modules for version 3.13.0 on 64 bit x86 SMP ii linux-image-extra-3.16.0-46-generic 3.16.0-46.62~14.04.1 amd64 Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP ii linux-image-extra-3.19.0-26-generic 3.19.0-26.28~14.04.1 amd64 Linux kernel extra modules for version 3.19.0 on 64 bit x86 SMP ii linux-image-generic-lts-vivid 188.8.131.52.13 amd64 Generic Linux kernel image
This means there are currently three kernels installed. The last entry for
linux-image-generic-lts-vivid is a meta package which does not use much disk space (from installing the Ubuntu Vivid kernel in Freya) and should not be removed.
You can now remove kernels you don't need anymore. Make sure to at least keep two kernels around, which should be the absolute minimum so you have at least one backup if the most recent kernel fails.
$ sudo apt-get autoremove linux-image-3.13.0-62-generic Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED linux-image-3.13.0-62-generic linux-image-extra-3.13.0-62-generic 0 to upgrade, 0 to newly install, 2 to remove and 0 not to upgrade. After this operation, 194 MB disk space will be freed. Do you want to continue? [Y/n] y ...
You can now check the list of installed kernels again with
dpkg -l | grep linux-image-. If a line starts with
rc this only means there is residual config files remaining (uses little to no space).
You can use
apt-get autoremove to free space if there are things in your disk that aren't necessary for the system anymore. If you run
apt-get upgrade there you'll see a message that will tell you if there are things that you can remove with apt-get autoremove.
Something like this:
$ sudo apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages were automatically installed and are no longer required: libassuan0 libgmime-2.6-0 libgpgme11 libmessaging-menu0 Use 'apt-get autoremove' to remove them.