3

I performed a minimal install of Ubuntu 23.10 on a typical desktop PC (x64). I've made no changed to /etc/apt/sources.list from the default. I want to set up some VMs, so I typed:

sudo apt install qemu

like I've done in the past, and like many online sources suggest. But I got this error:

Package qemu is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'qemu' has no installation candidate

How can I install qemu?

Aaron
  • 33

2 Answers2

4

For full system emulation run: apt-get install qemu-system

For emulating Linux binaries run: apt-get install qemu-user-static

That is quoting this Source: (https://www.qemu.org/download/#linux)

Apparently, it is assumed the user knows this must be done with root privilege, e.g. :

sudo apt-get install qemu-system

The more modern way is to run:

sudo apt install qemu-system

stumblebee
  • 3,547
1

Ubuntu, like most binary Linux distributions, splits QEMU into a few dozen actual packages because QEMU is huge, almost nobody actually needs all the components, and some of the components are actually a potential security risk. There used to be a qemu metapackage that pulled in everything, but it got removed long ago because, as mentioned above, almost nobody actually needs everything.

The package you actually want here is almost certainly one of:

  • qemu-system-<arch> to run regular virtual machines for <arch> (If you just want to run native VMs, replace <arch> with the output of uname -m). In this case you may also want qemu-system-gui if you intend to use QEMU’s built-in GUI to access the VM console from your desktop or qemu-utils if you need to be able to manipulate disk images. Alternatively, qemu-system will pull in all of the full system emulators.
  • qemu-user-static to use QEMU’s userspace emulation to run non-native binaries or containers, and possibly also qemu-user-binfmt to get automatic setup of this functionality.
  • qemu-utils if you’re just looking for the qemu-img or qemu-nbd tools.