[ubuntu] aptitude and unwanted upgrade

Mike Reinehr cmr
Fri Sep 30 10:07:28 PDT 2005


Hi, Man-wai, ...

On Friday 30 September 2005 07:02 am, Man-wai Chang wrote:
> Mike Reinehr wrote:
> > Man-wai,
> >
> > Even though you have compiled your own kernel, do you still have an
> > original, packaged kernel installed? Try running:
> >
> > 	dpkg -l 'kernel-*'
> >
> > and see what is listed as installed.
>
> Yes. I still kept the old kernel. What can I do to stop ubuntu from
> upgrading them?

	Use Aptitude to remove/purge the original kernel image package. Start 
Aptitude and type '/' to bring up a search window. Then type 'kernel-image' & 
hit return. You can press 'n' to step through the different kernel-image 
packages, although the one you want, likely, will be the first found, since 
the installed packages will list before the not-installed packages. Once you 
have found the correct package (with an 'i' for installed in the first 
column), press '_' (underscore) to mark it to be purged and then press 
'g' (for go :-).

	Alternatively, after you have found the correct kernel-image package, you 
could press '=' (equal sign) which will mark the package to be held at it's 
current version and never upgraded. This way, you'll still have it in an 
emergency, but not be prompted to upgrade.

> (BTW, the upgrade would incorrectly alter custom entries in
> /boot/grub/menu.lst)

	Debian has enhanced GRUB beyond what is standard. At first, it's somewhat 
confusing, but once you figure it out it's a real time saver. 
Open /boot/grub/menu.lst in vi and move down a few lines. You'll see "BEGIN 
AUTOMAGIC KERNELS LIST". Between this and "End Default Options" you'll find a 
number of options that you can customize. Once you have the options correctly 
set, generating a new menu.lst is easy. Just install your new kernel-image 
package and type 'update-grub'. Update-grub will use your options to generate 
the new boot stanzas in lines following "End Default Options". I'm not sure 
just how update-grub determines in what order to organize the kernel-images 
(newest to oldest, maybe), but it will generate boot stanzas for every 
kernel-image found in /boot. (By the way, update-grub may be running 
automatically after installing a new kernel-image.)

	Finally, if there are some boot stanzas that you do not want to create 
manually, just add them after the line "END DEBIAN AUTOMAGIC KERNELS LIST" 
and update-grub will not touch them.

HTH's!

cmr
-- 
Debian 'Sarge': Registered Linux User #241964

"More laws, less justice." -- Marcus Tullius Ciceroca, 42 BC


More information about the Linux-users mailing list