Обновление ядра Linux до новой версии
В последнее время новые версии ядер выходят достаточно часто. Раз в несколько месяцев выходит стабильный релиз. Ну а нестабильные кандидаты в релизы выходят и того чаще. Линус Торвальдс и множество разработчиков по всему миру постоянно работают над улучшением новых ядер и добавлением в них все больше и больше функциональности.
С каждой новой версией в ядре Linux появляется поддержка нескольких новых устройств, например, новых процессоров, видеокарт или даже сенсорных экранов. За последнее время, поддержка нового оборудования очень сильно улучшилась. Также в ядро включаются новые файловые системы, улучшается работа сетевого стека, исправляются ошибки и баги.
Если вам нужна более подробная информация об изменениях в какой-то определенной версии ядра смотрите ее Changelog на kernel.org, а в этой статье мы рассмотрим обновление ядра Linux до самой новой версии. Я попытаюсь не привязывать инструкцию к определенной версии ядра, новые ядра выходят достаточно часто и она будет актуальна для каждого из них. Рассмотрим обновление ядра Ubuntu и CentOS. Сначала давайте рассмотрим как обновить ядро в Ubuntu.
Обновление ядра Ubuntu вручную
Давайте сначала посмотрим какое ядро у вас установлено. Для этого откройте терминал и выполните:
Например, у меня сейчас используется версия 5.4, и я могу обновиться к самой новой версии. Разработчики Ubuntu уже позаботились о том чтобы их пользователи не собирали ядро вручную и сделали deb пакеты новой версии ядра. Их можно скачать с официального сайта Canonical.
Я мог бы привести здесь команды wget для загрузки, если была бы известна версия ядра, но в нашем случае лучше будет использовать браузер. Откройте сайт http://kernel.ubuntu.com/
kernel-ppa/mainline/. Здесь находятся все, собираемые командой Ubuntu ядра.
Пролистайте вниз, именно там находятся более новые версии ядер:
Кроме того, в самом верху есть папка daily/current, в которой находятся самые свежие, ночные сборки ядер. Выберите нужную версию ядра, затем выберите архитектуру. Для 64-битных систем вам понадобится архитектура amd64:
Далее надо скачать четыре файла: два linux-headers, linux-image и linux-modules. Как видите, там есть несколько типов ядер: lowlatency и generic. Ядро lowlatency судя из названия имеет более низкие задержки при работе с прерываниями. Зато ядро generic имеет большую пропускную способность. В большинстве случаев достаточно ядра generic. Скачайте linux-headers для all и generic, а также linux-image-generic и linux-modules-generic:
После завершения загрузки можно переходить к установке. Перейдите в папку с установочными пакетами, например,
dpkg -i linux-headers* linux-image* linux-modules*
Если эта команда не сработала, можно пойти другим путем. Установите утилиту gdebi:
sudo apt install gdebi
Затем с помощью нее установите ядро:
sudo gdebi linux-headers*.deb linux-image-*.deb linux-modules-*.deb
Ядро установлено, осталось обновить загрузчик:
Теперь можно перезагружать компьютер и смотреть что получилось. После перезагрузки убедимся, что обновление ядра Linux до самой новой версии прошло успешно:
Как видите ядро успешно установлено и работает. Но не спешите удалять старую версию ядра, рекомендуется иметь несколько версий ядра в системе, чтобы в случае неполадок иметь возможность загрузиться со старой рабочей версии. Если вы хотите настроить автоматическое обновление ядра в Ubuntu — используйте утилиту UKKU.
Если во время установки произошли какие-либо ошибки или ядро обновилось неправильно, и теперь система не загружается с новым ядром, вы можете использовать старое ядро. Также система может не запускаться, если вы используете проприетарный драйвер для видеокарты NVIDIA в таком случае не спешите качать самую новую версию ядра, используйте только стабильные ядра, в них, как правило, уже добавлена поддержка этого модуля.
А чтобы восстановить работу системы выберите пункт Advanced options for Ubuntu в меню Grub:
И запустите предыдущее работающее ядро:
После загрузки останется удалить неверно установленное ядро и еще раз обновить Grub. Найдите точное имя пакета ядра с помощью apt search. Например:
sudo apt search linux-headers-5.8
Затем удалите этот пакет:
sudo apt remove linux-headers-5.8-000055-generic
Аналогично надо поступить с ядром. После этого обновите конфигурацию Grub:
Теперь ваша система вернулась к прежнему состоянию. Вы можете попробовать устанавливать более старую версию ядра или попробовать еще раз.
Обновление ядра Linux до в CentOS
А теперь давайте рассмотрим как обновить ядро Linux самой новой версии в CentOS. Инструкция проверена на CentOS 8, но скорее всего, будет работать и на RHEL 8, Fedora и других подобных дистрибутивах.
Как правило, новые ядра не включены в официальные репозитории CentOS, поэтому чтобы получить последнюю стабильную версию нам необходимо будет добавить репозиторий ELRepo. Это репозиторий коммерческих пакетов (Enterprise Linux Packages) он также поддерживается в RHEL и Fedora.
Для добавления репозитория сначала необходимо импортировать ключ:
sudo rpm —import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
Для того чтобы добавить репозиторий и необходимые компоненты в RHEL 7 и CentOS 7 выполните:
sudo yum install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm
В CentOS 8 выполните:
sudo dnf install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm
sudo yum install https://www.elrepo.org/elrepo-release-6.el6.elrepo.noarch.rpm
Готово, теперь посмотрим текущую версию ядра:
Можем устанавливать самую новую версию ядра Linux командой:
sudo yum —enablerepo=elrepo-kernel install kernel-ml
Пакет kernel-ml, это текущий стабильный mainline релиз, на данный момент, это 5.8. После того как установка нового ядра Linux завершена, обновите конфигурационный файл загрузчика:
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Затем можете перезагружать систему. Обновление ядра в CentOS завершено.
Если после перезагрузки у вас возникли какие-либо проблемы с новым ядром, просто удалите его с помощью команды:
yum remove kernel-ml -y
dnf remove kernel-ml -y
И перезагрузите компьютер, чтобы вернуть систему к прежнему состоянию.
Выводы
В этой инструкции мы рассмотрели как обновить ядро Linux до 4.4 в Ubuntu и CentOS, но мы говорили только об обновлении ядра из бинарников. Также можно собрать ядро из исходных кодов, которые доступны для загрузки на официальном сайте ядра. О сборке ядра Linux я писал в отдельной статье. Вроде все разобрали, если остались вопросы — пишите в комментариях.
Обнаружили ошибку в тексте? Сообщите мне об этом. Выделите текст с ошибкой и нажмите Ctrl+Enter.
Похожие записи
Оцените статью
alt=»Creative Commons License» width=»» />
Статья распространяется под лицензией Creative Commons ShareAlike 4.0 при копировании материала ссылка на источник обязательна .
Об авторе
Основатель и администратор сайта losst.ru, увлекаюсь открытым программным обеспечением и операционной системой Linux. В качестве основной ОС сейчас использую Ubuntu. Кроме Linux, интересуюсь всем, что связано с информационными технологиями и современной наукой.
23 комментария к “Обновление ядра Linux до новой версии”
Спасибо за статью.
Подписан на вашу рассылку, так что в качестве обратной связи с читателями передаю вам привет!
Система Минт 17.3 Роза, ядро 3.16. Делаю все как описано в статье — после рестарта ядро 3.16. Иду в диспетчер обновлений, вижу предлагаемые ядра для обновления, 4-ки нет ни одной, рекомендуемое ядро 3.19, устанавливаю — работает, 3.16 убиваю. Ошибок нигде не выдавало. Остался пока без 4.4.
Выполните в место: sudo dpkg -i linux*.deb — sudo dpkg -i *.deb И выполнять команду обязательно в папке, в которую были загружены установочные пакеты.
Установил ядро 4.4, но слетел Вайфай, запустить не смог, пока откатился на старое ядро.
Да у меня такая же беда, обновился на 4.2 правда, было 3.19. Теперь вай фай с блютузом, не запускаются, пока остался на 3.19.
Подожду уже выхода Ubuntu 16.04 посмотрим, что будет в релизе, должны пофиксить по идее.
Ребзя а чего у меня не хочет обновлять? Сейчас стоит на VPS Ubuntu Xenial (16.04 LTS) (GNU/Linux 4.5.7-std-3 x86_64). Пробую обновить до 4.7.3 и ошибку пишет:
Selecting previously unselected package linux-headers-4.7.3-040703-generic.
(Reading database . 20139 files and directories currently installed.)
Preparing to unpack linux-headers-4.7.3-040703-generic_4.7.3-040703.201609070334_amd64.deb .
Unpacking linux-headers-4.7.3-040703-generic (4.7.3-040703.201609070334) .
Selecting previously unselected package linux-image-4.7.3-040703-generic.
Preparing to unpack linux-image-4.7.3-040703-generic_4.7.3-040703.201609070334_amd64.deb .
Done.
Unpacking linux-image-4.7.3-040703-generic (4.7.3-040703.201609070334) .
dpkg: dependency problems prevent configuration of linux-headers-4.7.3-040703-generic:
linux-headers-4.7.3-040703-generic depends on linux-headers-4.7.3-040703; however:
Package linux-headers-4.7.3-040703 is not installed.
dpkg: error processing package linux-headers-4.7.3-040703-generic (—install):
dependency problems — leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-4.7.3-040703-generic:
linux-image-4.7.3-040703-generic depends on initramfs-tools | linux-initramfs-tool; however:
Package initramfs-tools is not installed.
Package linux-initramfs-tool is not installed.
dpkg: error processing package linux-image-4.7.3-040703-generic (—install):
dependency problems — leaving unconfigured
Errors were encountered while processing:
linux-headers-4.7.3-040703-generic
linux-image-4.7.3-040703-generic
На 16.10 вывод следующий:
KernelUpdateChecker
Traceback (most recent call last):
File «/usr/bin/lsb_release», line 95, in
main()
File «/usr/bin/lsb_release», line 59, in main
distinfo = lsb_release.get_distro_information()
File «/usr/lib/python3/dist-packages/lsb_release.py», line 383, in get_distro_information
distinfo = guess_debian_release()
File «/usr/lib/python3/dist-packages/lsb_release.py», line 281, in guess_debian_release
get_distro_info(distinfo[‘ID’])
File «/usr/lib/python3/dist-packages/lsb_release.py», line 41, in get_distro_info
RELEASES_ORDER.sort(key=lambda n: float(n[0]))
File «/usr/lib/python3/dist-packages/lsb_release.py», line 41, in
RELEASES_ORDER.sort(key=lambda n: float(n[0]))
ValueError: could not convert string to float: ‘8.04 LTS’
А что выдает lsb_release?
А на сколько они стабильные, вот например отсюда: http://kernel.ubuntu.com/
вот тут наверное так?
sudo apt remove linux-headerS-4.7* linux-image-4.7*
без S не сработало.
А какое ядро посоветуете, если система установлена после wubi? 14.4.0-143-generic ubuntu 14 TT
А как обновить ядро в openSUSE 15?
E: Невозможно получить блокировку внешнего интерфейса dpkg (/var/lib/dpkg/lock-frontend); у вас есть права суперпользователя?
При запуске закачанных двух файлов вышла ошибка: dpkg: пакет обработки ошибок linux-image-4.18.16-041816-generic (—install):
проблемы зависимостей — оставляем»не задано»
При обработке были обнаружены ошибки:
linux-заголовки-4.18.16-041816-дженерик
linux-образ-4.18.16-041816-дженерик
Ден, тут надо качать три файла. хедерс, модулес, кернел. Причём хедерс на версии 5.7 сработал только тот что с приставкой «all». Админ! Поправь статью! Она слегка устарела, но полезна многим!
а как в FEDORA (RED HAT) Обновить ядро ?
D ukuu последнее ядро 5.7.1 больше не обновляется. Бесплатная версия. Платная стоит 15 вечно зелёных.
Здравствуйте.
Поставил Ubuntu 20.04. Была проблема с черным экраном при выключении.
Обновил ядро с 5.4.0-58 на 5.10.0-051000. Проблема исчезла. Но сейчас при выключении/перезагрузке сразу после логотипа ноутбука подгружает или настраивает что-то(загружает это ядро мб. Пишет с самого чала Loading 5.10. , дальше много строк, а слева [OK] зеленым). Фотки не прикрепляются.
Пробовал ядро вернуть. Но тогда комп не выключается, а такое включение остается.
7.7равсвсвуйте, подскажите пожалуйста как обновить версию ядра на Centos 7.7 3.10.0-1062.4.3 до версии CentOS 7.7 версия ядра 3.10.0-1062.9.1.el7.x86_64
Подскажите, пробую обновить по Вашей инструкции ядро Ubuntu Server 20.04 с 5.4.0-97-generic до последнего 5.17-rc7 и в момент установки, возникает ошибка.
Не подскажите что это значит?
sudo dpkg -i linux-headers* linux-image* linux-modules*
Выбор ранее не выбранного пакета linux-headers-5.17.0-051700rc7.
(Чтение базы данных … на данный момент установлено 257589 файлов и каталогов.)
Подготовка к распаковке linux-headers-5.17.0-051700rc7_5.17.0-051700rc7.202203062330_all.deb …
Распаковывается linux-headers-5.17.0-051700rc7 (5.17.0-051700rc7.202203062330) …
Выбор ранее не выбранного пакета linux-headers-5.17.0-051700rc7-generic.
Подготовка к распаковке linux-headers-5.17.0-051700rc7-generic_5.17.0-051700rc7.202203062330_amd64.deb …
Распаковывается linux-headers-5.17.0-051700rc7-generic (5.17.0-051700rc7.202203062330) …
Выбор ранее не выбранного пакета linux-image-unsigned-5.17.0-051700rc7-generic.
Подготовка к распаковке linux-image-unsigned-5.17.0-051700rc7-generic_5.17.0-051700rc7.202203062330_amd64.deb …
Распаковывается linux-image-unsigned-5.17.0-051700rc7-generic (5.17.0-051700rc7.202203062330) …
Выбор ранее не выбранного пакета linux-modules-5.17.0-051700rc7-generic.
Подготовка к распаковке linux-modules-5.17.0-051700rc7-generic_5.17.0-051700rc7.202203062330_amd64.deb …
Распаковывается linux-modules-5.17.0-051700rc7-generic (5.17.0-051700rc7.202203062330) …
Настраивается пакет linux-headers-5.17.0-051700rc7 (5.17.0-051700rc7.202203062330) …
dpkg: зависимости пакетов не позволяют настроить пакет linux-headers-5.17.0-051700rc7-generic:
linux-headers-5.17.0-051700rc7-generic зависит от libc6 (>= 2.34), однако:
Версия libc6:amd64 в системе — 2.31-0ubuntu9.7.
linux-headers-5.17.0-051700rc7-generic зависит от libssl3 (>= 3.0.0
alpha1), однако:
Пакет libssl3 не установлен.
dpkg: ошибка при обработке пакета linux-headers-5.17.0-051700rc7-generic (—install):
проблемы зависимостей — оставляем не настроенным
Настраивается пакет linux-image-unsigned-5.17.0-051700rc7-generic (5.17.0-051700rc7.202203062330) …
I: /boot/vmlinuz.old is now a symlink to vmlinuz-5.4.0-104-generic
I: /boot/initrd.img.old is now a symlink to initrd.img-5.4.0-104-generic
I: /boot/vmlinuz is now a symlink to vmlinuz-5.17.0-051700rc7-generic
I: /boot/initrd.img is now a symlink to initrd.img-5.17.0-051700rc7-generic
Настраивается пакет linux-modules-5.17.0-051700rc7-generic (5.17.0-051700rc7.202203062330) …
Обрабатываются триггеры для linux-image-unsigned-5.17.0-051700rc7-generic (5.17.0-051700rc7.202203062330) …
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.17.0-051700rc7-generic
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub’
Sourcing file `/etc/default/grub.d/init-select.cfg’
Generating grub configuration file .
Found linux image: /boot/vmlinuz-5.17.0-051700rc7-generic
Found initrd image: /boot/initrd.img-5.17.0-051700rc7-generic
Found linux image: /boot/vmlinuz-5.4.0-104-generic
Found initrd image: /boot/initrd.img-5.4.0-104-generic
Found linux image: /boot/vmlinuz-5.4.0-100-generic
Found initrd image: /boot/initrd.img-5.4.0-100-generic
Found linux image: /boot/vmlinuz-5.4.0-99-generic
Found initrd image: /boot/initrd.img-5.4.0-99-generic
Found linux image: /boot/vmlinuz-5.4.0-97-generic
Found initrd image: /boot/initrd.img-5.4.0-97-generic
done
При обработке следующих пакетов произошли ошибки:
linux-headers-5.17.0-051700rc7-generic
Мб запоздал с ответом, но все же. Если image и modules установились, но не ставится headers generic — попробуйте headers all. Сам с этим столкнулся, headers all стал без проблем. Проверял на разных ядрах.
How to Install the Latest Mainline Linux Kernel Version in Ubuntu [GUI and Terminal Methods]
I am assuming that you already know what is a Linux kernel. This is the core software that drives any Linux distribution. Linus Torvalds created it around 30 years ago and still works on it.
A newer version of the Linux kernel is released every few months with new features (such as support for more hardware), bug fixes, etc.
This does not mean you cannot use the latest Linux kernel in Ubuntu or other distributions you are using.
In this tutorial, I’ll discuss various ways to get a new Linux kernel on Ubuntu.
Suggested Read
It's FOSS Abhishek Prakash
Using the latest Linux kernel in Ubuntu: FAQ
Before we proceed installing the latest Linux kernel version in Ubuntu. Let me highlight some important information to avoid confusion.
Unless you are facing a particular issue or looking for an adventure to experiment, you should not update your system to the latest mainline Linux Kernel.
Upgrading the Linux Kernel manually could break your system. So, you need to have a backup ready to restore things if it happens.
Why install a new Linux kernel version manually?
Suppose the new Linux kernel introduces support for your sound card or Wi-Fi card or some other hardware component.
Considering your current Linux Kernel version does not detect your hardware and giving you serious issues, you can choose to upgrade.
HWE kernel option is also available
You should also remember that Ubuntu has this hardware stack enablement (HWE) feature that lets you use a somewhat newer Linux kernel on an Ubuntu LTS release.
Older kernels remain available
Another thing to note is that installing a new kernel doesn’t mean the older kernel has been removed from the system. It remains at your disposal. By default, Ubuntu boots into the newest Linux Kernel installed on the system.
Two ways of installing a new kernel in Ubuntu: Command line and GUI
There are two ways to install a newer Linux kernel:
- Manually download the DEB file for the new Linux kernel and install it in terminal
- Use a GUI tool and install a newer Linux kernel
You can only successfully boot into the newer Linux Kernel if you disable your system’s «Secure Boot» feature.
If you want to enable Secure Boot and enjoy the newer kernel, you will have to sign the Linux Kernel manually, which can be challenging for non-technical users.
Method 1: Manually install the new Linux kernel in Ubuntu using the command line
The latest Linux kernel is called the mainline Linux kernel. You’ll see this term used often.
Step 1: Check currently installed version
You may want to first check the currently installed version of kernel. You can do this by using the uname command in the terminal:
As you can see in the output below, I have kernel version 5.4 installed.
Step 2: Download the mainline Linux kernel of your choice
Now you have to download the desired kernel build provided by Ubuntu from here.
You can see the kernel list like this. I am going to download Linux Kernel 6.3. You also should remember to install the stable kernel instead of RC (release candidate).
Now download the appropriate kernel files for your architecture. For 64-bit architecture, you should download these files:
- linux-headers-VERSION-NUMBER_all.deb
- linux-headers-VERSION-NUMBER_amd64.deb
- linux-image-VERSION-NUMBER_amd64.deb
- linux-modules-VERSION-NUMBER_amd64.deb
Here’s what it looks like:
Step 4: Install the downloaded kernel
Now it’s time to install the downloaded kernel. First, go into the directory where you’ve downloaded the kernel and enter the following command:
It will take some time. After installation is finished, you can list the kernel files and look at them using the following command:
Step 5: Reboot Ubuntu and enjoy the new Linux kernel.
Now that you’ve successfully installed the new kernel in Ubuntu; it’s time to reboot the machine. Ubuntu, by default, boots into the newer kernel version.
After rebooting, check the kernel version with the uname -r command you used earlier. As you can see, it’s updated to 6.3.0.
Rollback the changes and downgrade the Linux Kernel
If you do not like the new Linux Kernel or if you discovered issues with it. You can easily downgrade the Kernel. You have to:
- Boot into an older kernel
- Remove the newer Linux kernel you don’t want
Let’s see how to do that.
When booting into your system, select the Advanced options for Ubuntu on the grub menu.
If you do not see the grub menu, try holding the shift key or using the Esc key to bring the grub menu.
Here, you’ll see all the Linux kernels installed on your system. Select an older one. Don’t choose the recovery mode; go with the normal ones.
Now that you have booted into your good old kernel, we have to remove the new kernel.
You can use the apt or dpkg command to remove the installed kernel version.
Do you remember the version of the new kernel you installed manually? For me, it was kernel 6.3. So here’s what I use to delete it.
Change the commands with the version you want to install:
Method 2: Upgrade Linux Kernel in Ubuntu Ukuu GUI tool
You can upgrade the Linux kernel in the Linux command line.
But the kernel upgrade procedure is much easier and more convenient with a GUI.
You can use the paid tool called Ukuu (Ubuntu Kernel Update Utility) or an open-source fork mainline.
Step 1: Install mainline in Ubuntu
You can download the deb files from its GitHub releases page.
Step 2: Install kernel with mainline
Once you have installed mainline, start it. It will refresh the list of available Linux kernels available for Ubuntu.
By default, it will show you all the available kernels, including the unstable release kernel (tagged with RC and with the red Tux icon).
Kernel versions from the distributions are labeled with the logo, and the other versions have just the good old Tux logo.
Again, you should avoid the release candidates. Select the desired Kernel version and click on Install. It will download the Linux Kernel that you want and also list what you have currently installed (which is Linux Kernel 5.19 for Ubuntu 22.04 LTS).
Of course, it will require an admin password for this action. Once you have entered your password, you can see the installation progress in the application itself.
You should see something like this when the installation is finished successfully.
Once installation finishes, you’ll see a beneficial screen that tells you if anything goes wrong with the new Linux kernel, you can always choose to boot into the older kernel from the grub menu.
Now it shows that you have Linux Kernel 6.3 installed:
Rollback the changes/Downgrade Linux Kernel with mainline
Rollbacking is done in two steps:
- Boot into an older kernel
- Remove the newer Linux kernel you don’t want
Let’s see how to do that.
When booting into your system, select the Advanced options for Ubuntu on the grub menu.
Select your old kernel (Linux Kernel 5.19 in this case) to boot into it.
Once you boot into the system with the older Linux kernel, start mainline again.
Ensure that you are not deleting the kernel you are currently running.
Select the newer kernel version you don’t want anymore and click Uninstall.
That’s all you need to do here to downgrade the Linux kernel in Ubuntu.
How do you upgrade the Linux kernel?
I hope this tutorial helped you install the mainline Linux kernel in Ubuntu.
So, do you often upgrade the Linux kernel on your own, or do you wait for your distribution to provide the upgrade? How do you do it?
Kernel / Upgrade
The script at https://github.com/medigeek/kmp-downloader/ does not seem to allow choosing amd64 (64-bit) architecture. It only allows installing i386 (32-bit) architecture. This seems like a bug to me. Just press <ENTER> instead of a number if you get stuck on a certain question in the python script.
Roll-back and uninstallation
You can roll back by selecting the previous (old) kernel at the boot menu and then uninstall the (new) not working kernel.
With Synaptic you can uninstall previously installed kernel packages.
See also
Kernel/Upgrade (последним исправлял пользователь ckimes 2017-09-26 21:09:59)
The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details
How to Update Linux Kernel In Ubuntu
The Linux kernel is like the central core of the operating system. It works as sort of a mediator, providing an interface between software applications and computer hardware.
The Linux kernel is the foundation on which all the different types of Linux, operate. It is Open Source software – anyone can decompile, examine, and modify the code.
As technology progresses, developers discover patches and updates to the Linux kernel. These patches can improve security, add functionality, or even improve the speed at which the operating system functions.
If you’re running a Linux operating system (like Ubuntu), it’s a good idea to check and update the kernel regularly.
- A server running Ubuntu Linux
- Access to the Terminal (CTRL-ALT-T or Applications menu > Accessories > Terminal)
- A user account with sudo privileges
- The apt tool, built into Ubuntu
- The Update Manager, built into Ubuntu (optional)
Tutorial on Updating Ubuntu Kernel
Option A: Use the System Update Process
Step 1: Check Your Current Kernel Version
At a terminal window, type:
The terminal returns an output similar to:
The first two digits (in this case, 4.4) are the overall kernel package. The third digit is the version, and the fourth digit shows you the level of patches and fixes.
For more details, refer to our full guide on checking the Linux kernel version. While inspecting the system, you can also check which version of Ubuntu you are running.
Step 2: Update the Repositories
At a terminal, type:
This command refreshes your local list of software, making a note of any newer revisions and updates. If there’s a newer version of the kernel, the command will find it and mark it for download and installation.
Step 3: Run the upgrade
While still in the terminal, type:
The “dist-upgrade” switch asks Ubuntu to handle any dependencies intelligently. That is, if a particular software package is dependent on another software package to run, this command will make sure that the second package is upgraded before upgrading the first one.
This method is a safe way to upgrade your Ubuntu Linux kernel. The kernel updates accessible through this utility have been tested and verified to work with your version of Ubuntu.
Option B: Use the System Update Process to Force a Kernal Upgrade
There are instances in which a newer kernel has been released but not thoroughly tested with your version of Ubuntu. For example, you might be running Ubuntu 17.10 (Artful Aardvark), and you know that Ubuntu 18.04 (Bionic Beaver) is available.
Updating the kernel in this way requires a more substantial process.
Step 1: Back Up Your Important Files
You’ve probably already done this, but it’s important enough that it’s worth repeating.
Step 2: Use the Software Updater
Launch the software updater by hitting the super key (the “windows” key on most keyboards), and search for Update Manager.
The update manager will notify you if there are any updates needed. If you performed the steps in Part A, it should say your computer is up to date.
Click the Settings button.
A new window should open up with several tabs.
Step 3: Configure the Software Updater
Click the Updates tab.
Tick the first three checkboxes, under “Install updates from:”
- Important security updates
- Recommended updates
- Unsupported updates
Then, at the bottom of this tab, look for a drop-down labeled “Notify me of a new Ubuntu version:”
Click that drop-down, and select:
- For long-term support versions (If you want to stick with tested and reliable versions with full support)
- For any new version (If you like playing with the latest-and-greatest, and don’t mind if things are a little buggy)
Close this window, and then re-open it. It should offer the option to upgrade if there’s a new version out. (It usually takes a few days after release for the upgrade to become available, and for the server traffic to lighten up.)
Step 4: Force the Upgrade
If for some reason the system does not offer an upgrade, you can force it by opening a terminal and typing:
The system should respond with a window showing release notes for the new kernel (and version) of Ubuntu.
If everything looks good, click upgrade, and the process will proceed.
Option C: Manually Update the Kernel (Advanced Procedure)
If you just want to upgrade to the latest (untested) kernel available, and you’re aware of the risks, there’s a third procedure for selecting and installing a new kernel.
Before performing this step, it’s worth checking your system configuration. Are you running any custom drivers (especially video drivers)? Any custom configurations or packages? Those may not be compatible with the new kernel.
If you make a mistake and find that the new kernel is incompatible, a recovery option should be available. But it’s better to take precautions and prevent a problem than to try to fix one.
It’s also a good idea to research the release notes for the kernel you want to install. Note the revision number and any features that you intend to work with.
This process will use Ukuu, a graphical utility for updating the kernel. There are other methods, including manually downloading and installing the kernel, or even getting a copy of the source code and compiling it. Those methods are more complicated, and outside the scope of this guide.
Step 1: Install Ukuu
At the terminal, type the following (hit enter after each line):
The first command adds the TeeJeeTech repositories of open-source software for Linux to your basic repositories. The second command refreshes the database, so you’ve got a list of the latest revisions. The third command installs the Ukuu software.
Step 2: Launch Ukuu
At the terminal, type:
The Ukuu utility will launch and should display a list of the available Linux kernel versions.
Step 3: Install the Kernel
Select the kernel you wish to install, then click the “Install” button on the right-hand side.
Step 4: Reboot the System
Once the kernel finishes installing, reboot your system. Once you’re back into the operating system, you can relaunch Ukuu to verify the installation.
Step 5: In Case of Failure
If there’s a catastrophic problem, the GRUB, or boot utility, will keep a copy of the old kernel that you can select and boot into.
On the boot screen, select Advanced options for Ubuntu – then select the previous kernel (identified by the revision number). There’s no need to use the “upstart” or “recovery mode” options.
Step 6: Uninstalling the Kernel
The Ukuu utility also offers the ability to remove old kernels on Ubuntu. Simply click the same kernel that you installed previously, and click Remove on the right-hand side.
For most users, upgrading the kernel in Ubuntu is pretty straightforward. Most systems will prompt when the upgrade is ready. But if you’re looking for a custom kernel, or want to override the automatic process, this guide provides a good foundation for doing so.