Discussion:
[gentoo-user] Old kernel versions
(too old to reply)
Beau E. Cox
19 years ago
Permalink
Hi -

When a new kernel ( I'm using gentoo-sources ) comes down
the line, I go to /usr/src, ln -s to linux, copy current
.config, yada, yada... It works fine.

Now I notice in eix that all my old kernels are marked as
'installed'. I normally keep only the previous kernel in
/boot. Can I safely 'emerge -C' the older kernels w/o
upsetting my apple cart?
--
Aloha => Beau;
--
gentoo-***@gentoo.org mailing list
Andres Becerra Sandoval
19 years ago
Permalink
Post by Beau E. Cox
Hi -
When a new kernel ( I'm using gentoo-sources ) comes down
the line, I go to /usr/src, ln -s to linux, copy current
.config, yada, yada... It works fine.
Now I notice in eix that all my old kernels are marked as
'installed'. I normally keep only the previous kernel in
/boot. Can I safely 'emerge -C' the older kernels w/o
upsetting my apple cart?
--
Aloha => Beau;
--
Yes, you can clean the old kernel versions, this will free you some space.

A quick way to do it is:
- back up your .config
- emerge -C gentoo-sources or whatever-sources (this will clean all versions)
- emerge gentoo-sources (only merges the actual)


--
Andrés
--
gentoo-***@gentoo.org mailing list
Beau E. Cox
19 years ago
Permalink
...
I have the kernel option on that puts the compressed .config file of
the running kernel in /proc ( I think that's neat - you always have
access to the running .config ).
Post by Andres Becerra Sandoval
- emerge -C gentoo-sources or whatever-sources (this will clean all
versions) - emerge gentoo-sources (only merges the actual)
That is an excellent way to go...Thanks, Andrés.
Post by Andres Becerra Sandoval
--
Andrés
--
Aloha => Beau;
--
gentoo-***@gentoo.org mailing list
Neil Bothwick
19 years ago
Permalink
Post by Andres Becerra Sandoval
- back up your .config
If you installed the kernel with make install, the config is already
backed up to /boot.
Post by Andres Becerra Sandoval
- emerge -C gentoo-sources or whatever-sources (this will clean all versions)
- emerge gentoo-sources (only merges the actual)
Why remove the current version only to reinstall it?
emerge --prune gentoo-sources will remove all but the latest.

It's also faster to remove the directories from /usr/src before unmerging
them. You'll need to remove them manually anyway as unmerge -C/P doesn't
remove the compiled files.
--
Neil Bothwick

The world is coming to an end... SAVE YOUR BUFFERS!!
Andres Becerra Sandoval
19 years ago
Permalink
...
Thank you Neil, this is quicker !

--
Andrés
--
gentoo-***@gentoo.org mailing list
Michael Kintzios
19 years ago
Permalink
-----Original Message-----
Sent: 19 January 2006 10:52
Subject: Re: [gentoo-user] Old kernel versions
[snip...]
Post by Neil Bothwick
Why remove the current version only to reinstall it?
emerge --prune gentoo-sources will remove all but the latest.
It's also faster to remove the directories from /usr/src
before unmerging
Post by Neil Bothwick
them. You'll need to remove them manually anyway as unmerge
-C/P doesn't
Post by Neil Bothwick
remove the compiled files.
Also it doesn't remove the source distpackages, or the lib/modules for
the particular kernel version. There may be a script lurking somewhere
in the forums, but I remove these manually out of habit.
--
Regards,
Mick
--
gentoo-***@gentoo.org mailing list
Neil Bothwick
19 years ago
Permalink
Post by Michael Kintzios
Also it doesn't remove the source distpackages, or the lib/modules for
the particular kernel version. There may be a script lurking somewhere
in the forums, but I remove these manually out of habit.
Removing the source tarballs for older kernel installs may not be a good
idea, as it could be the same tarball as for the current kernel.

I clean out old kernel versions with this script, that leaves the last
two.

#!/bin/bash

# clean /lib/modules
cd /lib/modules
ls -1 | head -n -2 | xargs rm -fr

# clean /boot
mount /boot
cd /boot
ls -1 config-* | head -n -2 | while read f; do
mv $f oldconfigs/
done

ls -1 System.map-* | head -n -2 | xargs rm -f
ls -1 vmlinuz-* | head -n -2 | xargs rm -f

# clean /usr/src
cd /usr/src
ls -1d linux-* | head -n -2 | xargs rm -fr
/usr/local/bin/qpkg -d -v -nc gentoo-sources | head -n -2 | xargs emerge --unmerge

umount /boot
--
Neil Bothwick

Headline: "Explosion At Sperm Bank, Nurses Overcome"
Nick Rout
19 years ago
Permalink
On Thu, 19 Jan 2006 10:05:20 +0100
Post by Andres Becerra Sandoval
Yes, you can clean the old kernel versions, this will free you some space.
- back up your .config
- emerge -C gentoo-sources or whatever-sources (this will clean all versions)
- emerge gentoo-sources (only merges the actual)
simpler to emerge -P gentoo-sources and get rid of all but the latest.
(-P = prune)
--
Nick Rout <***@rout.co.nz>
--
gentoo-***@gentoo.org mailing list
Simon Kellett
19 years ago
Permalink
Post by Beau E. Cox
Now I notice in eix that all my old kernels are marked as
'installed'. I normally keep only the previous kernel in
/boot. Can I safely 'emerge -C' the older kernels w/o
upsetting my apple cart?
Yes: unlike most packages these are the kernel *sources* not the kernel
install (which you have done manually).

(So you could do emerge gentoo sources, config, make, install etc, and
immediately remove the kernel sources.)
--
Simon Kellett, | Gentoo Linux, Fvwm, Firefox
Darmstadt, Germany | Xemacs, Vm, Gnus
--
gentoo-***@gentoo.org mailing list
Neil Bothwick
19 years ago
Permalink
Post by Simon Kellett
(So you could do emerge gentoo sources, config, make, install etc, and
immediately remove the kernel sources.)
As long as you don't need any third party kernel modules, like the Nvidia
drivers.
--
Neil Bothwick

Speak softly and carry a cellular phone.
Continue reading on narkive:
Loading...