qt5-default not in Ubuntu 21.04

I tried to install qt5-default but the package was not found. Of course, I read this question and added universe to the apt and done a apt update.

I think qt5-default is not in 21.04 yet as it says here so how can I install, i need it.


Solution 1:

The 21.04 is based on Debian bullseye, which does not have qt5-default package in the repository. I reported a bug to launchpad about missed qt5-default package.

There is a way is to install all dependencies of qt5-defalt package with

sudo apt-get install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools

and then try to compile your application.


If you are installing some package from third-party which requires qt5-default package on Ubuntu 21.04 (or newer), then you can create fake package by using commands below:

sudo apt-get update
sudo apt-get install equivs

cd ~/Downloads
cat <<EOF > qt5-default-control
Package: qt5-default
Source: qtbase-opensource-src
Version: 5.99.99+fake-13ubuntu37
Architecture: all
Depends: qtbase5-dev, qtchooser
Suggests: qt5-qmake, qtbase5-dev-tools
Conflicts: qt4-default
Section: libdevel
Priority: optional
Homepage: http://qt-project.org/
Description: Qt 5 development defaults fake package
EOF

equivs-build qt5-default-control
sudo apt-get install ./qt5-default_5.99.99+fake-13ubuntu37_all.deb

and enjoy.


But IMO better way is to install Ubuntu 20.04 LTS instead to live another 4 years without problems as it has needed qt5-default package in place.


This explains that qt5-default became obsolete, and that's why it was removed.

Solution 2:

Two ways to solve this on Ubuntu 21.04

Fast hack

Packages can be installed without the qt5-default dependency with:

sudo dpkg --force-all -i ODADrawingsExplorer_QT5_lnxX64_7.2dll_22.5.deb

This will install the package. The solution is not perfect. apt knows the missing dependency and it will remove the package if you do an upgrade, for example. sudo apt -f install will remove the package. But this is ok if you just want to try the application.

Long term solution: change the package dependencies

This is not so easy, but it removes the qt5-default dependency.

I'll use the ODADrawingsExplorer_QT5_lnxX64_7.2dll_22.5.deb package here, but this works with any other package.

Unpack the package:

cd tmp/
ar -x ../ODADrawingsExplorer_QT5_lnxX64_7.2dll_22.5.deb
tar xf control.tar.xz

Edit control file and remove the qt5-default dependency from the Pre-Depends or Depends list.

Pack the package:

tar cfJ control.tar.xz control
ar rcs ../oda-without-qt-default.deb debian-binary control.tar.xz data.tar.xz
cd ..
sudo dpkg -i oda-without-qt-default.deb

You can check that the dependencies are fine with sudo apt -f install. The package will not be removed.