Kernel upgrades are being marked as manual
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Landscape Client |
New
|
Undecided
|
Unassigned |
Bug Description
Tested on Ubuntu 20.04
landscape-client 22.09+git6230-
Also confirmed on 18.04
All references are checked via:
- `dpkg -l | grep linux`
- `apt-mark showmanual`
When doing a manual upgrade of kernel packages via the CLI, the "new" kernel packages are not marked as manual. See "pre" [1] and "post" [2].
When upgrading kernel packages via an upgrade profile, the "new" kernel packages are not marked as manual. See "pre" [3] and "post" [4].
When upgrading kernel packages via Landscape by navigating to the computer in Landscape, selecting the Packages tab and clicking "Request upgrades", the "new" kernel packages are marked as manually installed. This causes apt autoremove not to remove the kernel packages, which ends up with machines running out of space in /boot. See "pre" [5] and "post" [6].
It doesn't make sense to me that there is a different behaviour between a "manual" install of kernel packages via CLI vs the Landscape GUI.
[1] https:/
[2] https:/
[3] https:/
[4] https:/
[5] https:/
[6] https:/
tags: | added: cpe-onsite |
Steps to reproduce with LXC are the following:
Find an old lxc vm. An old vm will likely require kernel updates. Make sure no other vms are running like multipass. Also some vms older than focal will not launch machine
lxc image list ubuntu: architecture=x86_64 type=virtual-
I used this one
lxc launch ubuntu:fb944b6797cf --vm
Then remove unattedend upgrades as this will cause kernel updates to be automatically installed in the background
sudo apt remove unattended-upgrades
Then run sudo apt update. And sudo apt upgrade but do NOT proceed with updates.
We need to find the linux modules, not the ones with the version numbers but the generic meta ones and hold them. These are different depending on the vm/updates. This is so the update is just limited it to the desired packages which will make it happen faster.
sudo apt-mark hold linux-headers- generic linux-headers- virtual linux-image-virtual linux-virtual
Now proceed with the upgrade via command line.
Now unhold the packages. Optionally hold another random package (non kernel related) to test out behavior of the package profiles.
sudo apt-mark unhold linux-headers- generic linux-headers- virtual linux-image-virtual linux-virtual
sudo apt update
Now install landscape client.
Run landscape server on another machine and run the hashids to make the package show up quicker.
Now configure landscape client on the vm. 10.166. 210.1:8080/ message- system --ping-url http:// 10.166. 210.1:8081/ ping --silent
sudo landscape-config --computer-title test1 --account-name onward --url http://
Now is a good time to shut down the vm and save it.
lxc publish equal-beetle --alias=autoremove
Now accept the computer and wait for packages to show up. This may take awhile depending on if the hashids are installed.
Send the upgrade request from the server to the client in the UI.
When it's completed run
sudo apt-mark showmanual
The linux kernel packages with the specific version numbers should not be there. This is the bug. It's okay if the meta package is there.