[Solved] Upgrade and switch to new kernel

Kernels & Hardware, configuring network, installing services

[Solved] Upgrade and switch to new kernel

Postby emitor » 2018-08-16 05:52

Hi, I have a debian server and I want to update Linux kernel to the latest version.

In this output I see that I am using Kernel version 3.16.
Code: Select all
# uname -a
Linux pc 3.16.6-042stab127.46 #1 SMP Wed Mar 28 01:57:40 CEST 2018 x86_64 GNU/Linux


Code: Select all
# apt search linux-image
linux-headers-4.17.0-0.bpo.1-amd64/stretch-backports 4.17.8-1~bpo9+1 amd64
  Header files for Linux 4.17.0-0.bpo.1-amd64

linux-headers-4.17.0-0.bpo.1-cloud-amd64/stretch-backports 4.17.8-1~bpo9+1 amd64
  Header files for Linux 4.17.0-0.bpo.1-cloud-amd64

linux-headers-4.9.0-3-amd64/stable 4.9.30-2+deb9u5 amd64
  Header files for Linux 4.9.0-3-amd64

linux-headers-4.9.0-3-rt-amd64/stable 4.9.30-2+deb9u5 amd64
  Header files for Linux 4.9.0-3-rt-amd64

linux-headers-4.9.0-4-amd64/stable 4.9.65-3+deb9u1 amd64
  Header files for Linux 4.9.0-4-amd64

linux-headers-4.9.0-4-grsec-amd64/stretch-backports 4.9.65-2+grsecunoff1~bpo9+1 amd64
  Header files for Linux 4.9.0-4-grsec-amd64

linux-headers-4.9.0-4-rt-amd64/stable 4.9.65-3+deb9u1 amd64
  Header files for Linux 4.9.0-4-rt-amd64

linux-headers-4.9.0-5-amd64/stable 4.9.65-3+deb9u2 amd64
  Header files for Linux 4.9.0-5-amd64

linux-headers-4.9.0-5-rt-amd64/stable 4.9.65-3+deb9u2 amd64
  Header files for Linux 4.9.0-5-rt-amd64

linux-headers-4.9.0-6-amd64/stable 4.9.88-1+deb9u1 amd64
  Header files for Linux 4.9.0-6-amd64

linux-headers-4.9.0-6-rt-amd64/stable 4.9.88-1+deb9u1 amd64
  Header files for Linux 4.9.0-6-rt-amd64

linux-headers-4.9.0-7-amd64/stable 4.9.110-3+deb9u2 amd64
  Header files for Linux 4.9.0-7-amd64

linux-headers-4.9.0-7-rt-amd64/stable 4.9.110-3+deb9u2 amd64
  Header files for Linux 4.9.0-7-rt-amd64

linux-image-4.17.0-0.bpo.1-amd64/stretch-backports,now 4.17.8-1~bpo9+1 amd64 [installed]
  Linux 4.17 for 64-bit PCs

linux-image-4.17.0-0.bpo.1-amd64-dbg/stretch-backports 4.17.8-1~bpo9+1 amd64
  Debug symbols for linux-image-4.17.0-0.bpo.1-amd64

linux-image-4.17.0-0.bpo.1-cloud-amd64/stretch-backports 4.17.8-1~bpo9+1 amd64
  Linux 4.17 for x86-64 cloud

linux-image-4.17.0-0.bpo.1-cloud-amd64-dbg/stretch-backports 4.17.8-1~bpo9+1 amd64
  Debug symbols for linux-image-4.17.0-0.bpo.1-cloud-amd64

linux-image-4.9.0-3-amd64/stable 4.9.30-2+deb9u5 amd64
  Linux 4.9 for 64-bit PCs

linux-image-4.9.0-3-amd64-dbg/stable 4.9.30-2+deb9u5 amd64
  Debug symbols for linux-image-4.9.0-3-amd64

linux-image-4.9.0-3-rt-amd64/stable 4.9.30-2+deb9u5 amd64
  Linux 4.9 for 64-bit PCs, PREEMPT_RT

linux-image-4.9.0-3-rt-amd64-dbg/stable 4.9.30-2+deb9u5 amd64
  Debug symbols for linux-image-4.9.0-3-rt-amd64

linux-image-4.9.0-4-amd64/stable 4.9.65-3+deb9u1 amd64
  Linux 4.9 for 64-bit PCs

linux-image-4.9.0-4-amd64-dbg/stable 4.9.65-3+deb9u1 amd64
  Debug symbols for linux-image-4.9.0-4-amd64

linux-image-4.9.0-4-grsec-amd64/stretch-backports 4.9.65-2+grsecunoff1~bpo9+1 amd64
  Linux 4.9 for 64-bit PCs, Grsecurity protection (unofficial patch)

linux-image-4.9.0-4-rt-amd64/stable 4.9.65-3+deb9u1 amd64
  Linux 4.9 for 64-bit PCs, PREEMPT_RT

linux-image-4.9.0-4-rt-amd64-dbg/stable 4.9.65-3+deb9u1 amd64
  Debug symbols for linux-image-4.9.0-4-rt-amd64

linux-image-4.9.0-5-amd64/stable 4.9.65-3+deb9u2 amd64
  Linux 4.9 for 64-bit PCs

linux-image-4.9.0-5-amd64-dbg/stable 4.9.65-3+deb9u2 amd64
  Debug symbols for linux-image-4.9.0-5-amd64

linux-image-4.9.0-5-rt-amd64/stable 4.9.65-3+deb9u2 amd64
  Linux 4.9 for 64-bit PCs, PREEMPT_RT

linux-image-4.9.0-5-rt-amd64-dbg/stable 4.9.65-3+deb9u2 amd64
  Debug symbols for linux-image-4.9.0-5-rt-amd64

linux-image-4.9.0-6-amd64/stable 4.9.88-1+deb9u1 amd64
  Linux 4.9 for 64-bit PCs

linux-image-4.9.0-6-amd64-dbg/stable 4.9.88-1+deb9u1 amd64
  Debug symbols for linux-image-4.9.0-6-amd64

linux-image-4.9.0-6-rt-amd64/stable 4.9.88-1+deb9u1 amd64
  Linux 4.9 for 64-bit PCs, PREEMPT_RT

linux-image-4.9.0-6-rt-amd64-dbg/stable 4.9.88-1+deb9u1 amd64
  Debug symbols for linux-image-4.9.0-6-rt-amd64

linux-image-4.9.0-7-amd64/stable,now 4.9.110-3+deb9u2 amd64 [installed,automatic]
  Linux 4.9 for 64-bit PCs

linux-image-4.9.0-7-amd64-dbg/stable 4.9.110-3+deb9u2 amd64
  Debug symbols for linux-image-4.9.0-7-amd64

linux-image-4.9.0-7-rt-amd64/stable 4.9.110-3+deb9u2 amd64
  Linux 4.9 for 64-bit PCs, PREEMPT_RT

linux-image-4.9.0-7-rt-amd64-dbg/stable 4.9.110-3+deb9u2 amd64
  Debug symbols for linux-image-4.9.0-7-rt-amd64

linux-image-amd64/stable,now 4.9+80+deb9u5 amd64 [installed]
  Linux pre 64-bitové PC - metabalík

linux-image-amd64-dbg/stable 4.9+80+deb9u5 amd64
  Debugging symbols for Linux amd64 configuration (meta-package)

linux-image-cloud-amd64/stretch-backports 4.17+95~bpo9+1 amd64
  Linux for x86-64 cloud (meta-package)

linux-image-cloud-amd64-dbg/stretch-backports 4.17+95~bpo9+1 amd64
  Debugging symbols for Linux cloud-amd64 configuration (meta-package)

linux-image-grsec-amd64/stretch-backports 13~bpo9+1 amd64
  Linux image meta-package, grsec featureset

linux-image-rt-amd64/stable 4.9+80+deb9u5 amd64
  Linux for 64-bit PCs (meta-package), PREEMPT_RT

linux-image-rt-amd64-dbg/stable 4.9+80+deb9u5 amd64
  Debugging symbols for Linux rt-amd64 configuration (meta-package)


Code: Select all
# apt search linux-image | grep installed

linux-image-4.17.0-0.bpo.1-amd64/stretch-backports,now 4.17.8-1~bpo9+1 amd64 [installed]
linux-image-4.9.0-7-amd64/stable,now 4.9.110-3+deb9u2 amd64 [installed,automatic]
linux-image-amd64/stable,now 4.9+80+deb9u5 amd64 [installed]


There is 4.17 installed, 4.9 installed and "automatic". What does the automatic mean? Which kernel version is booted? Its a VPS without GUI - I have no chance to see GRUB and switch it before boot. I am confusing, but I whing that 3.16 is booted (uname -a command said).

Can you tell me how to correctly switch (install and boot automatically) to the latest (supported) kernel? And how to remove unused installed kernels?
Last edited by emitor on 2018-08-22 10:51, edited 1 time in total.
emitor
 
Posts: 4
Joined: 2018-08-16 05:33

Re: Upgrade and switch to new kernel

Postby p.H » 2018-08-16 13:48

emitor wrote:# uname -a
Linux pc 3.16.6-042stab127.46 #1 SMP Wed Mar 28 01:57:40 CEST 2018 x86_64 GNU/Linux

This is not a Debian stock kernel.
Also, according to your apt command, it does not seem to have been installed by a Debian package.

emitor wrote:There is 4.17 installed, 4.9 installed and "automatic". What does the automatic mean?

"Automatic" means that the package was installed automatically by dependency of another package. Here the other package is linux-image-amd64 from stable, which depends on the latest available stable kernel version.

emitor wrote:Which kernel version is booted? Its a VPS

uname says that the booted kernel is 3.16.6.

What kind of VPS is this ? Is it a full virtual machine or a container ? If it is a container, it does not have its own kernel and uses the host's kernel.
I don't know how you can tell, but you can look at installed kernel images in /boot and search if a GRUB config file /boot/grub/grub.cfg is present and check its contents. If a kernel image for version 3.16.6 (or no version) it present in /boot, and /boot/grub/grub.cfg is present and contains a menu entry for this kernel in the first position, then you have a chance to select another kernel.
p.H
 
Posts: 519
Joined: 2017-09-17 07:12

Re: Upgrade and switch to new kernel

Postby emitor » 2018-08-20 13:14

There is no grub/* in /boot folder.

Code: Select all
root@pc:/boot# ls -l
-rw-r--r-- 1 root root   202813 jul 23 17:56 config-4.17.0-0.bpo.1-amd64
-rw-r--r-- 1 root root   186568 aug 13 21:31 config-4.9.0-7-amd64
-rw-r--r-- 1 root root 21346665 aug  9 09:11 initrd.img-4.17.0-0.bpo.1-amd64
-rw-r--r-- 1 root root 17652317 aug 16 07:33 initrd.img-4.9.0-7-amd64
-rw-r--r-- 1 root root  3286974 jul 23 17:56 System.map-4.17.0-0.bpo.1-amd64
-rw-r--r-- 1 root root  3192069 aug 13 21:31 System.map-4.9.0-7-amd64
-rw-r--r-- 1 root root  5052272 jul 23 17:56 vmlinuz-4.17.0-0.bpo.1-amd64
-rw-r--r-- 1 root root  4232992 aug 13 21:31 vmlinuz-4.9.0-7-amd64
emitor
 
Posts: 4
Joined: 2018-08-16 05:33

Re: Upgrade and switch to new kernel

Postby p.H » 2018-08-20 13:39

This /boot directory contains only files belonging to the two installed linux-image-4.* packages. There are no files related to a usual boot loader. Not all boot loaders put files in /boot but the most common ones on x86, GRUB and LILO, do.

I'm afraid that either your VPS is a container using the host's kernel, or the kernel is loaded from outside the filesystem (e.g. PXE netboot). In the second case it might be possible to chose a different kernel in the VPS configuration panel, or hot-switch to another kernel with kexec-tools.

If unsure, ask your VPS provider.
p.H
 
Posts: 519
Joined: 2017-09-17 07:12

Re: Upgrade and switch to new kernel

Postby Wheelerof4te » 2018-08-20 14:42

3.16 is Jessie's kernel, apt shows Stretch's kernels. Please provide the output of
Code: Select all
cat /etc/apt/sources.list
User avatar
Wheelerof4te
 
Posts: 1129
Joined: 2015-08-30 20:14

Re: Upgrade and switch to new kernel

Postby p.H » 2018-08-20 15:03

Jessie's official kernel (apparent) version is 3.16.0-[0-9].
3.16.6-042stab127.46 does not match any Jessie's released kernel.
"apt search" showed that there is no linux-image-3.16.* package installed nor available.
This kernel is not from Debian.
p.H
 
Posts: 519
Joined: 2017-09-17 07:12

Re: Upgrade and switch to new kernel

Postby GarryRicketson » 2018-08-20 15:35

If unsure, ask your VPS provider.


The OP should ask their provider about this.
Is the OP using this : vpsfree.cz provider ?
They seem to be the ones using this:
Code: Select all
oot@box:~# uname -a
Linux box.vpsfree.cz 3.16.6-042stab127.46 #1 SMP Wed Mar 28 01:57:40 CEST 2018 x86_64 x86_64 x86_64 GNU/Linux
User avatar
GarryRicketson
 
Posts: 5035
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Upgrade and switch to new kernel

Postby emitor » 2018-08-21 04:15

Wheelerof4te wrote:3.16 is Jessie's kernel, apt shows Stretch's kernels. Please provide the output of
Code: Select all
cat /etc/apt/sources.list


Code: Select all
root@xxx:~# cat /etc/apt/sources.list
deb http://ftp.cz.debian.org/debian stretch main
deb-src http://ftp.cz.debian.org/debian stretch main

deb http://ftp.cz.debian.org/debian stretch-updates main
deb-src http://ftp.cz.debian.org/debian stretch-updates main

deb http://security.debian.org/ stretch/updates main
deb-src http://security.debian.org/ stretch/updates main

deb http://ftp.debian.org/debian stretch-backports main


GarryRicketson wrote:Is the OP using this : vpsfree.cz provider ?

Yes, it is vpsfree.cz.

Thanks all for your help and time.
emitor
 
Posts: 4
Joined: 2018-08-16 05:33

Re: Upgrade and switch to new kernel

Postby GarryRicketson » 2018-08-21 09:36

Your welcome,
Looks like P.H is right:
I'm afraid that either your VPS is a container using the host's kernel,--snip--
If unsure, ask your VPS provider.



From:https://vpsfree.org/faq/
I WANT TO USE MY OWN KERNEL IN MY VPS, IS IT POSSIBLE?

We use OpenVZ container technology. It means that all VPSs share one kernel with the host. If you really need your own kernel, you have to use full KVM virtualitazion.

The FAQ and what I quoted, has additional links in the text I quoted, so it is important you look at your self, and look at those links.
Do you all ready have the full KVM virtualitazion, ? If not , you will need to do this: https://kb.vpsfree.org/manuals/vps/kvm
Using KVM on vpsFree.cz
This information page contains manuals on how to install and run KVM on Alpine Linux 3.4+, CentOS 7 and Debian 8.---snip---details follow


At the top of the FAQ:
Just contact our support team

Which is what you should do, if the FAQ and the manuals it points to are not clear,...
One last note, but MOST important, Make good back ups before doing anything. I assume you have, but often it is surprising how many people don't do that.
==================== edit ====================
From:https://kb.vpsfree.org/information/openvzCan I have a newer kernel?

No, or only using KVM.

VPS (i.e. containers) share the kernel of their host. OpenVZ is developed on the kernel from RHEL6 – 2.6.32. No other kernel can be used, OpenVZ only works with this version. Moreover, this kernel contains a lot of extra patches and backports, e.g. it can even run Docker.

Applications that need a newer kernel to run often only check its version and refuse to run based on that, even if our kernel has the required functionality. Because of this, OpenVZ can present a fake version of the kernel to the containers to pass the checks that the apps have in place. E.g. a VPS using Debian 8 sees version 3.16.6 even though it is still the same kernel. The container just sees a different version number.

The only way to actually install any kernel is using KVM.

User avatar
GarryRicketson
 
Posts: 5035
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Upgrade and switch to new kernel

Postby emitor » 2018-08-21 10:43

Thank you for reading FAQ, I should did that. You can mark as solved this topic.
emitor
 
Posts: 4
Joined: 2018-08-16 05:33

Re: Upgrade and switch to new kernel

Postby GarryRicketson » 2018-08-21 10:53

Your welcome,
But I can't mark it as solved, you need to do that by editing the first post, add solved , to the subject line.
User avatar
GarryRicketson
 
Posts: 5035
Joined: 2015-01-20 22:16
Location: Durango, Mexico


Return to System configuration

Who is online

Users browsing this forum: hrsetrdr and 3 guests

fashionable