0

I'm trying to install libqt4-dev on Ubuntu 20.04 but I get the following errors:

kjs@PC:~/Downloads$ sudo apt-get install -y libqt4-dev
Reading package lists... Done
Building dependency tree... 50%
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libqt4-dev : Depends: libqt4-dbus (= 5:4.8.7+dfsg-7ubuntu4rock7) but it is not going to be installed
              Depends: libqt4-declarative (= 5:4.8.7+dfsg-7ubuntu4rock7) but it is not going to be installed
              Depends: libqt4-designer (= 5:4.8.7+dfsg-7ubuntu4rock7) but it is not going to be installed
              Depends: libqt4-dev-bin (= 5:4.8.7+dfsg-7ubuntu4rock7)
              Depends: libqt4-help (= 5:4.8.7+dfsg-7ubuntu4rock7) but it is not going to be installed
              Depends: libqt4-network (= 5:4.8.7+dfsg-7ubuntu4rock7) but it is not going to be installed
              Depends: libqt4-qt3support (= 5:4.8.7+dfsg-7ubuntu4rock7) but it is not going to be installed
              Depends: libqt4-script (= 5:4.8.7+dfsg-7ubuntu4rock7) but it is not going to be installed
              Depends: libqt4-scripttools (= 5:4.8.7+dfsg-7ubuntu4rock7) but it is not going to be installed
              Depends: libqt4-sql (= 5:4.8.7+dfsg-7ubuntu4rock7) but it is not going to be installed
              Depends: libqt4-svg (= 5:4.8.7+dfsg-7ubuntu4rock7) but it is not going to be installed
              Depends: libqt4-test (= 5:4.8.7+dfsg-7ubuntu4rock7) but it is not going to be installed
              Depends: libqt4-xml (= 5:4.8.7+dfsg-7ubuntu4rock7) but it is not going to be installed
              Depends: libqt4-xmlpatterns (= 5:4.8.7+dfsg-7ubuntu4rock7) but it is not going to be installed
              Depends: libqtcore4 (= 5:4.8.7+dfsg-7ubuntu4rock7) but it is not going to be installed
              Depends: libqtgui4 (= 5:4.8.7+dfsg-7ubuntu4rock7) but it is not going to be installed
              Depends: qt4-linguist-tools (= 5:4.8.7+dfsg-7ubuntu4rock7)
              Depends: qt4-qmake (= 5:4.8.7+dfsg-7ubuntu4rock7)
              Depends: qtchooser (>= 55-gc9562a1-1~)
              Recommends: libqt4-opengl-dev (= 5:4.8.7+dfsg-7ubuntu4rock7) but it is not going to be installed
 libqtgui4:i386 : Depends: libpng12-0:i386 (>= 1.2.13-4) but it is not going to be installed
                  Recommends: qt-at-spi:i386 but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

After this I tried:

sudo add-apt-repository ppa:rock-core/qt4 
sudo apt-get update
sudo apt-get install libqtcore4

and got the following error:

~$ sudo apt-get install libqtcore4
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libqtcore4 : Breaks: libqtcore4:i386 (!= 5:4.8.7+dfsg-7ubuntu4rock7) but 4:4.8.7+dfsg-5ubuntu2 is to be installed
 libqtcore4:i386 : Breaks: libqtcore4 (!= 4:4.8.7+dfsg-5ubuntu2) but 5:4.8.7+dfsg-7ubuntu4rock7 is to be installed
 libqtgui4:i386 : Depends: libpng12-0:i386 (>= 1.2.13-4) but it is not going to be installed
                  Recommends: qt-at-spi:i386 but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

I also tried to install Qt5 using the following command:

sudo apt-get install git g++ python libeigen3-dev zlib1g-dev libqt5opengl5-dev libqt5svg5-dev libgl1-mesa-dev libfftw3-dev libtiff5-dev libpng-dev

and got the following error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
g++ is already the newest version (4:9.3.0-1ubuntu2).
g++ set to manually installed.
libpng-dev is already the newest version (1.6.37-2).
git is already the newest version (1:2.25.1-1ubuntu3.10).
libgl1-mesa-dev is already the newest version (21.2.6-0ubuntu0.1~20.04.2).
libgl1-mesa-dev set to manually installed.
zlib1g-dev is already the newest version (1:1.2.11.dfsg-2ubuntu1.5).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libfftw3-dev : Depends: libfftw3-bin (= 3.3.8-2ubuntu1)
                Depends: libfftw3-double3 (= 3.3.8-2ubuntu1) but it is not going to be installed
                Depends: libfftw3-long3 (= 3.3.8-2ubuntu1) but it is not going to be installed
                Depends: libfftw3-quad3 (= 3.3.8-2ubuntu1) but it is not going to be installed
 libqt5opengl5-dev : Depends: libqt5opengl5 (= 5.12.8+dfsg-0ubuntu2.1) but it is not going to be installed
                     Depends: qtbase5-dev (= 5.12.8+dfsg-0ubuntu2.1)
 libqt5svg5-dev : Depends: libqt5svg5 (= 5.12.8-0ubuntu1) but it is not going to be installed
 libqtgui4:i386 : Depends: libpng12-0:i386 (>= 1.2.13-4) but it is not going to be installed
                  Recommends: qt-at-spi:i386 but it is not going to be installed
 python : PreDepends: python-minimal (= 2.7.11-1) but it is not going to be installed
          Depends: python2.7 (>= 2.7.11-1~) but it is not going to be installed
          Depends: libpython-stdlib (= 2.7.11-1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

1 Answer 1

0

Ubuntu 20.04 dropped qt4 and all libqt4-* dependencies in its official repos. Adding this PPA repository to your system may solve your problem.

sudo add-apt-repository ppa:rock-core/qt4
sudo apt-get update

Then, install qt4.

sudo apt-get install libqtcore4
4
  • can you please elobrate the error or can show the error. check the following site to install instead of this libqt4-devpackage [link](packages.ubuntu.com/bionic/libqt4-dev )
    – zara
    Mar 13, 2023 at 12:20
  • i have edited the question above @zara Mar 13, 2023 at 12:42
  • Try to install the qt5 because qt4 is not allowed in the ubuntu 20.4 try for below command sudo apt-get install git g++ python libeigen3-dev zlib1g-dev libqt5opengl5-dev libqt5svg5-dev libgl1-mesa-dev libfftw3-dev libtiff5-dev libpng-dev @OmkarDixit
    – zara
    Mar 13, 2023 at 12:50
  • I tried this also which I have updated in the question Mar 13, 2023 at 14:31

You must log in to answer this question.

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