locally compile current qemu

Most Linux distributions do not update qemu to current versions, but you can compile the current qemu release yourself. A good target for installation is /opt/qemu. (Check qemu download as reference.)

As of june 2022, Debian testing/unstable contains qemu-7.0.0: https://tracker.debian.org/pkg/qemu.

Download, compile and install a current qemu to /opt/qemu:

sudo apt-get install pkg-config libglib2.0-dev libpixman-1-dev
wget -q https://download.qemu.org/qemu-7.0.0.tar.xz
tar xJf qemu-7.0.0.tar.xz
cd qemu-7.0.0
./configure --prefix=/opt/qemu
make -j 8
sudo make install