Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Coming from windows, I’m a little confused how this works, is he reinstalling Linux/Ubuntu every week on all his machines? Or is it possible to “upgrade in place” just the kernel and leave your files/data alone, if the latter, is there a good guide for how to do that and for a homelabber would that be a good idea to avoid security bugs?


In a classic Linux distro, various OS components are much less tightly coupled than in Windows. You can easily update the linux kernel, without updating all the system libraries, daemons, configs, tools, applications, much less your user configs and data. This is done every time "apt-get upgrade" installs an upgraded kernel package, which can be more often than monthly, depending on linux distro. And all the other components can be updated separately, like openssl libraries, init system binaries, tools like git, etc. You can swap in your own alternative for any component, if you know how. The linux kernel is one of the easiest components to swap because the linux syscall ABI is very backwards compatible. (Linux compatibility challenges are about user-land libraries which are all separate and up to the development policy of those library authors, modulated by the update policy of the distro.)

I find modern Windows and macOS updates to be frustratingly opaque and slow. Linux distro updates, on the popular/common distros like debian and arch, are one of my favorite parts of using the system. It'll just install updates for like 200 separate packages (libraries, tools, etc) bang, bang, bang, less than a minute, done. And with the absurdly high speed of todays CPUs and storage, why should it take longer? What are Windows and macOS even doing? I will accept linux has some drawbacks and disadvantages, but the system package managers have been fantastic, for about 2 decades now.


Same. A long time ago, I envied Windows and Mac users. For the past decade, I mostly just pity them.


Installing kernel in Ubuntu is simply, given that you already have a kernel deb, a single line "apt-get install". You can create your own package apt repo or use the one provided by the author https://github.com/zabbly/linux#installation

Be aware that upgrading kernel usually mess with graphics driver, especially for Nvidia. In the best case you'll have to unload and reload the Nvidia driver, in the worst case your driver just stops working.


In the _most common_ case (with nvidia), your graphics stops working entirely and you spend (at least) an hour in a virtual console trying to undo what you did. Fun times.


This case ain't very common anymore, just Nvidia proprietary driver users suffer with this commonly these days.

Intel and AMD don't have significant breakage when upgrading the Linux kernel.


Yeah, I should have mentioned this is specific to nvidia. Update: fixed.


As the other replies to this state, yes it's standard practise to update a kernel by installing the newer one without having to re-install or update all the other packages. Kernel updates are handled the same as any other package update but with the only difference being that a system reboot is required. (There's also the possibility of performing live kernel patching so that a reboot isn't needed, but that's typically a paid for service with enterprise linux).

Also, you can have many kernels installed concurrently and select which one to boot from at the GRUB boot screen. This is mostly used when you update the kernel and suddenly find on rebooting that something has gone wrong (e.g. necessary drivers not included in the initial ram disk - initrd), so you can reboot and select the previous working kernel to boot the system and resolve whatever issue you had.


> but that's typically a paid for service with enterprise linux

Ubuntu Pro is free for five machines and includes live-patches for security updates. Non-security updates still require a reboot.


> Or is it possible to “upgrade in place” just the kernel and leave your files/data alone

Yeah. I've never heard of reinstalling the OS just to get a newer kernel.

> is there a good guide for how to do that

I think it's best to continue to use your distro's package manager to handle actually installing that kernel, so the instructions would all be distro-specific. Some distros make working with a custom kernel easier than others.

> for a homelabber would that be a good idea to avoid security bugs?

Depends on your distro. I would expect major ones and enterprise-oriented ones to do a good job of backporting security fixes to the older kernels they run. If they do a really good job of this, it might even be more secure on the whole.

But yeah, just using the latest stable kernel is probably the simplest way to ensure that you have the latest security fixes. (It'll also ensure you have the latest undiscovered security bugs. ;)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: