34

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.

0

5 Answers 5

51

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.

6
  • I still cant mark +1 on your answer, but is the right one Apr 30, 2021 at 18:29
  • i found this too, it explains that qt5-default became obsolete. Maybe because Qt6 is coming out. Apr 30, 2021 at 18:40
  • Thanks, looks as the reason for qt5-default removal.
    – N0rbert
    Apr 30, 2021 at 18:51
  • 1
    sudo apt install qttools5-dev-tools for QT designer.
    – Gauthier
    Aug 10, 2021 at 11:51
  • Worked for me on Xubuntu 21.04 Hirsute.
    – Joey
    Oct 12, 2021 at 23:39
7

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.

1
  • Excellent, +1, I've used your "long term solution" to install the spinnaker SDK from FLIR, having installed qtbase5-dev qtchooser qt5-qmake and qtbase5-dev-tools. Works perfectly. Not so complicated in fact.
    – calocedrus
    Nov 21, 2021 at 14:25
4

qt5-default was removed in the qtbase-opensource-src source package in Debian's version 5.15.1+dfsg-2. Hirsute autosynced in 5.15.2+dfsg-5 during the development cycle.

There is no way to 'return' qt5-default in the package without manually recompiling the package, and it looks like other things were removed since -default is no more.

This was the changelog justification for the removal:

  • Remove qt5-default. Nowadays it's not needed as Qt 5 is the only Qt version in Debian and it brought more problems than solutions.

Installing any .deb files manually that depend on qt5-default will not function, and you will need whoever provided those .deb files to update them. If the .deb file is from an older system, you are not going to be able to configure it to function properly because you will have to rebuild that package for newer Ubuntu, which may or may not be an option based on the age of the package you're trying to install.

3

Based on estibordo's "Long term solution: change the package dependencies" I made the following script.

#!/bin/sh
read -p "[Warning] This script will modify all the debian files in the current directory. Continue (y/n)? " reply
echo 
if [ "$reply" = "y" ]; then
    for deb_file in *.deb
    do
        ar -x $deb_file
        tar -xf control.tar.gz
        sed -i 's/qt5-default, //g' control
        tar -cf control.tar.gz control
        ar -rcs $deb_file debian-binary control.tar.gz data.tar.gz
        rm control control.tar.gz data.tar.gz debian-binary md5sums shlibs
    done
fi
1

qt5-default package is missing from Ubuntu 21.04 repository, so you should just install all base packages by yourself by running the command below:

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

Answer from Farshid616's StackOwerflow answer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .