1

I'm running Ubuntu under virtualized environment (as a guest of VMware ESXi, HyperV or KVM). Which packages should I delete that are not needed under virtualized environment since a virtualized guest Ubuntu anyway cannot access physical hardware anyway? I mean packages like linux-firmware, intel-microcode, amd64-microcode, thermald, acpid, etc. Could you please somehow suggest a list of unnecessary packages that I could delete? I'm running many virtual machines and I don't want for them to reboot in vain just because some packages, like linux-firmware for example, have updated by unattended-upgrades.

  • 3
    ...and how should we know which packages you need, and which don't? – mikewhatever Jul 5 at 10:07
  • 2
    You could try for yourself. Make a clone of your VM and use apt purge -s acpid for example. If deleting whatever you want doesn't break your clone, apply the same to the "real" VM. You could also turn off unattended upgrades. – DK Bose Jul 5 at 10:16
  • 3
    you'll gain maybe a few megabytes, what's the point? are you really going to compile your own kernel just for this? a majority of the "things you don't need" are in the kernel. – tatsu Jul 5 at 11:00
  • @tatsu, you comment is not relevant since I don't want to recompile the kernel to remove per se the code that I do not need, I just want to remove modules that trigger reboot when they are updated by unattended-upgrades while actually they are not used. So my goal is to not minimize reboots and but save resources (disk, CPU) taken by upgrading these unused modules. – Maxim Masiutin Jul 9 at 22:52
5

If you start with Ubuntu's cloud images, then there's nothing hardware-related to remove. This won't help with your current VMs, but is an easier starting point for your future VMs.

Here's an example of getting started using KVM and cloud-images:

  1. Everything you need, including KVM, is a dependency of the wonderful uvtool package. No PPAs, this is all stock Ubuntu main.

    $ sudo apt install uvtool
    
  2. Download a cloud image. It's 400MB, so it takes a couple minutes. Don't panic about a lack of feedback - let it run.

    $ uvt-simplestreams-libvirt sync release=disco arch=amd64
    
  3. Create the VM:

    $ uvt-kvm create my_VM_name release=disco
    

There - it's running now. You can use virsh to control the VM (suspend, resume, shutdown, start, list, etc). You can SSH into it, or use virt-viewer.

Alternately, if you don't want to use uvtool, you can download cloud images from https://cloud-images.ubuntu.com/

  • Thank you for your reply, however, I don't usually control the host, I purchase virtual machine services from different providers like Azure and they provide ready Ubuntu virtual machines with modules like intel-microcode already installed so I have to uninstall them. – Maxim Masiutin Jul 9 at 22:50
  • 2
  • @MaximMasiutin you misled us. you said you're "running Ubuntu", as in "stock Ubuntu". you're not. You're running Ubuntu distros modified by Azure, this would have been crucial information to provide in the OP. this is an edge case, not a majority case. this is why we all assumed it was vanilla Ubuntu and why your question didn't make any sense. – tatsu Jul 10 at 7:33
0

I have identified the following packages so far that tend to operate physical hardware thus cannot do anything under virtualized environment so can be safely removed to avoid unnecessary reboots when they are updated by unattended-upgrades:

amd64-microcode intel-microcode iucode-tool thermald acpid linux-firmware mdadm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.