Installing libqt4-dev in Debian GNU/Linux 12 (bookworm)

I need Qt 4 for installing a software in debian bookworm. I believe I can install Qt 4 by ‘sudo apt install libqt4-dev’. I wanted to know if there are any risks to it. I don’t think that would be the case, but could it break my system?

Asked By: physu


Qt 4 is no longer available in Debian, it was removed in March 2020.

If you really want to install it, you can still do so, with some level of support until the end of June. This is commonly frowned-upon¹ but isn’t really risky. Create a file, /etc/apt/sources.list.d/buster.list, containing

deb buster main
deb buster/updates main

Then run apt update as root, followed by apt install libqt4-dev again as root. This will install all the available Qt 4 libraries.

The package manager will ensure this doesn’t break your system — or at least, it will warn you before removing packages (so make sure you read what it’s asking if it asks for confirmation).

The installation is easily reversible: remove /etc/apt/sources.list.d/buster.list, run apt update (as root), and list all obsolete packages:

apt list '~o'

If you don’t think you’ll miss any of the packages listed there, remove them with

apt purge '~o'

(as root).

¹ You might be told this produces a “FrankenDebian”, but that’s really about mixing a Debian release with development suites (Debian testing and/or unstable).

Answered By: Stephen Kitt
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.