Today I bring you a little trick, which despite being quite easy, is useful to save disk space and avoid annoying updates what do we need. I recently made an update of my system to use the 3.5.0-X kernel, but the previous versions of the 3.2.0-X kernel were installed on my system and every time the system asked to update, it was updating the 3.2.0 branch -X from the kernel, which I wasn't using.
I gave myself to the task of remove these older versions, for this, first I saw which ones were installed on my system, using the command:
sudo dpkg -l | grep linux-image
This command returns the list of installed kernels, which in my case were enough for the 3.2.0-X branch, so I decided to remove all the packages from this branch and thus avoid new updates that I would not use. To perform this action use the command:
sudo apt-get remove --purge linux-image-X.X.X-X
The Xs must be replaced by the version we want to remove, in my case it is as follows:
sudo apt-get remove --purge linux-image-3.2.0-40-generic-pae
After carrying out this last operation, 113 MB of disk space was freed, when repeating it to eliminate all versions of this branch, it freed me 1GB. Hope you find this tip useful and help you save disk space.
Taken from humans.
I find that some articles are very simple and are made just for posting something. The article is an explanation of how to remove an installed package, and that is best done in synaptic, it is also recommended not to remove all the kernels because later ...
Some things may seem simple when you already have a level of knowledge... but DesdeLinux It is not focused on Gurus... but on new users.
Excellent answer!
Hahaha You say guru because I recommend using a graphical tool instead of the terminal? for new users there is nothing better than graphical interfaces for managing your system; and that you cannot argue.
As elav says, I think the blog has a place for information of all kinds, from the simplest tips for those who recently started using a Linux distribution, to the more technical articles for people of a more advanced level, basically it is about learning, in one way or another, but learning.
Greetings and good tip.
This article is intended for all new linux users to lose their fear of the terminal
Excellent post
Thank you very much, it is the fastest to use the Synaptic Package Manager. From the console you can also, but at least in Linux Mint you always have remnants of the previous kernel if you do it with the same commands from the tutorial or with these below, and you have to repeat them several times
dpkg –list | grep linux-image -> list what kernels you have installed
uname -r -> see which one you are using
sudo apt-get purge linux-image-XXX-generic -> remove one
sudo update-grub -> update grub
sudo apt autoremove -> clean
sudo apt autoclean -> clean
as well as to update the system it is better from the console, than from the Update Manager, if you do it from here, in the terminal it will tell you that there are still packages to update
sudo apt update -> update the list of packages available from the servers
sudo apt upgrade -> install the packages and upgrade the system
Example:
user @ user ~ $ sudo apt upgrade
Reading package list ... Done
Creating dependency tree
Reading the status information ... Done
Calculating the update ... Done
0 updated, 0 new will be installed, 0 to remove, and 0 not updated.
If you use fedora the steps would be:
To find out which ones you have installed "rpm -q kernel" and so it will tell you which kernels you have and to remove it, just type "yum remove (the kernel you want to remove)"
that's a problem we don't have in arch
Very true!
I was wondering how it was done in arch "Thanks for the TIP"
Of course you don't have it, simply because if the update puts a kernel that fucks your system, then you screwed up, neither more nor less xD
Yes, but let me tell you that stability is an issue that Arch has and not Debian. If you haven't had any at the moment, time to time.
good tip when one is very short of space is very useful
With aptitude (debian) you can also, (if you know well what you want to do, thinking that it is always advisable to have an extra kernel)
more tending to the one liner
dpkg -l | grep "linux- [im \ | he]" | grep -v "$ (uname -r)" | awk '{print $ 2}'
purge replaces remove –purge or is unnecessary, according to this in apt.conf
APT :: Get :: Purge;
I use a siduction package (derived from debian Sid) called kernel remover which works very well.
I do it from Ubuntu Tweak, from the Cleaner tab, it is very easy. In addition to deleting the versions of the Kernel that we do not use, we can do more things like delete the caches of some programs, unnecessary packages, etc.
I always leave the last one, the previous one and delete the oldest ones.
and in archlinux? :DC
and in Chakra-Linux? :DC
Elav is also imposing to do the same procedure with the headers that remain installed
for fedora and centos
his -
yum remove -y $ (rpm -qa | grep -i kernel)
this seeks to remove all kernels and skipping the running
Thanks friend it worked perfectly for me
Sometimes the obvious things stop being obvious if they are not said.
It is always useful, it will serve more than one for sure.
Greetings.
here I was looking for the linux mint community and this script appeared, this is the URL
http://community.linuxmint.com/tutorial/view/373
Simply comment that the information presented here has been very useful to me, can I ask for more from a blog? salu2
It really is something very simple, simple and useful.
Working by console, for me is the best, definitely, it is simpler and with a command line you can do many things.
Your post has been very useful.
Greetings and thanks for sharing.
Thank you very helpful!
Excellent contribution…. Thank you…