--Use the apt-mark hold
command. Put the following packages in hold.
- linux-generic-hwe-18.04 hold
- linux-headers-5.4.0-42-generic hold
- linux-headers-generic-hwe-18.04 hold
- linux-hwe-5.4-headers-5.4.0-42 hold
- linux-image-5.4.0-42-generic hold
- linux-image-generic-hwe-18.04 hold
- linux-modules-5.4.0-42-generic hold
- linux-modules-extra-5.4.0-42-generic hold
$ sudo apt-mark hold linux-generic-hwe-18.04 linux-headers-5.4.0-42-generic linux-headers-generic-hwe-18.04 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-42-generic linux-image-generic-hwe-18.04 linux-modules-5.4.0-42-generic linux-modules-extra-5.4.0-42-generic
$ dpkg --get-selections | grep hold
--To release the hold, use the apt-mark unhold
command.
$ sudo apt-mark unhold linux-generic-hwe-18.04 linux-headers-5.4.0-42-generic linux-headers-generic-hwe-18.04 linux-hwe-5.4-headers-5.4.0-42 linux-image-5.4.0-42-generic linux-image-generic-hwe-18.04 linux-modules-5.4.0-42-generic linux-modules-extra-5.4.0-42-generic