How to Install Qt4 Libraries in Ubuntu 20.04 [Ubuntu 22.04 Updated]

Last updated: May 11, 2022 — 16 Comments

The Qt4 framework has been removed from Ubuntu 20.04 main repository. It is however still required for some obsolete applications.

Though it is not recommended, you can still get Qt4 libraries (e.g., libqt4-declarative, qt4-dev-tools, qt4-qmake, libqtwebkit4, and more) as software dependencies or for building an application via this third-party PPA.

NOTE: Qt4 has reached end of life! You may run into security issues with the library. USE IT AT YOUR OWN RISK! And for Ubuntu 22.04 LTS, please scroll down for option 2.

Option 1: Install Qt4 in Ubuntu 20.04

1.) Open terminal either by pressing Ctrl+Alt+T on keyboard or by searching for ‘terminal’ from your system application launcher. When terminal opens, run command:

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

Type user password (no asterisk feedback) when it prompts and hit enter.

For Ubuntu 20.10 users sticking to Qt4 libraries, try well trusted UNetbootin PPA.

The PPA built Qt4 package as dependency libraries since Unetbootin was based on Qt4.

sudo add-apt-repository ppa:gezakovacs/ppa

2.) After adding the PPA, it should automatically refresh the system package cache. On some Ubuntu derivatives, you may run command to manually update the package cache:

sudo apt update

3.) Finally install the software .deb package, and it should automatically install the required Qt4 libraries after running sudo apt -f install.

Or you may install specified Qt4 package by running command:

sudo apt install PACKAGE_NAME

See here for a full list of available Qt4 libraries.

Option 2: Install Qt4 in Ubuntu 22.04

For the new Ubuntu 22.04 LTS, you can get the Qt4 libraries via this unofficial PPA. The packages there belongs to kelebek333.

1. Firstly, press Ctrl+Alt+T on keyboard to open terminal. When it opens, run the command below to add the PPA:

sudo add-apt-repository ppa:ubuntuhandbook1/ppa

Type user password when it asks (no asterisk feedback) and hit Enter to continue.

2. After adding the PPA, install your old app packages should automatically install Qt4 as dependencies.

To install the packages manually, either run command sudo apt install PACKNAME in terminal or use Synaptic package manager:

Uninstall Qt4:

To remove the PPA, run command:

sudo add-apt-repository --remove ppa:rock-core/qt4

Or remove the PPA for Ubuntu 22.04 using command:

sudo add-apt-repository --remove ppa:ubuntuhandbook1/ppa

To remove all Qt4 libraries, run command:

sudo apt remove --autoremove libqt4* libqtcore4 libqtgui4 libqtwebkit4 qt4*


I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to remind me outdated tutorial! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via [email protected] Buy me a coffee:

16 responses to How to Install Qt4 Libraries in Ubuntu 20.04 [Ubuntu 22.04 Updated]

  1. The remove PPA command should be:
    sudo add-apt-repository ppa:rock-core/qt4 --remove

  2. Awesome !

  3. et pour 20.10?

  4. Thank you. I have an old binary that needs libqt4core and libqt4gui — you got them for me.

  5. sudo apt install PACKAGE_NAME ??? what package
    this is manual how to install python-qt4 i still get

    apt-get install python-qt4Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package python-qt4

  6. This is so helpful thank you so much!

  7. Debian PACKAGES for qt4 can also be downloaded from

  8. This used to be really hard. I wish I had found this page 5 years ago. Thanks.

  9. Ubuntu 10.20
    I tried this:
    sudo add-apt-repository ppa:rock-core/qt4
    Traceback (most recent call last):
    File “/usr/bin/add-apt-repository”, line 108, in
    sp = SoftwareProperties(options=options)
    File “/usr/lib/python3/dist-packages/softwareproperties/”, line 117, in __init__
    File “/usr/lib/python3/dist-packages/softwareproperties/”, line 612, in reload_sourceslist
    File “/usr/lib/python3/dist-packages/aptsources/”, line 91, in get_sources
    raise NoDistroTemplateException(
    aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Ubuntu/focal

  10. Thank!

    I need libqtgui4 for the SimpleIDE from Parallax

    I added the PPA and then sudo apt install libqtgui4

    • Stephen Griswold April 1, 2022 at 5:51 pm

      see my comment below, the ppa adding for Unetbootin (a iso to bootable flash drive utility) worked.

  11. Many, many thanks,
    more than two weeks I struggled with the problem,that a wonderful aerodynamic program (xflr5) I had used under Ubuntu-18.04-LTS disappeared after upgrading to Ubuntu-20.04-LTS and worse: a new installation of the actual .deb-file failed. Following your way the problem is solved.

  12. Stephen Griswold April 1, 2022 at 5:47 pm

    Ji, the unetbootin ppa fix also worked under Linux Mint 20.3, installing a front-end ide for the parallax P8X32 (aka the propeller chip) either the software hasn’t been upgraded the qt5, or a lot of software have lost dependencies because of depreciation of the libraries. Thanks for describing the patch!

  13. None of that works on 22.04 Ubuntu Studio

Leave a Reply

Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 


This site uses Akismet to reduce spam. Learn how your comment data is processed.