How to Uninstall Qt5?

Somehow I ended up with 2 versions of Qt on my Ubuntu 14.04 LTS machine, Qt4 and Qt5. Here is the output of qtchooser -list-versions

4
5
config
default
qt4-i386-linux-gnu
qt4-x86_64-linux-gnu
qt4
qt5-x86_64-linux-gnu
qt5

How do I remove Qt5?

0
  1. Open a terminal and navigate to the directory where Qt is installed.
  2. Run the command ./MaintenanceTool.

From The Terminal:

1. Remove the package:
sudo apt-get remove qtcreator && sudo apt-get remove qt5*
2. Remove all the dependencies:
sudo apt-get purge qtcreator && sudo apt-get purge qt5*

3. Remove the unneeded packages that were once installed as a dependency:

sudo apt-get autoremove
4. Remove the retrieved packages from the local cache:
sudo apt-get autoclean

From the GUI:

  1. Open Qt Maintenance Tool

  2. Tick Uninstall

  3. Click next, then Uninstall

  4. Enter the Sudo password if requested then, press Finish.

If you want to remove/uninstall Qt Creator then follow this:

Open your terminal (Ctrl + Alt + T), then...

  1. To only uninstall Qt Creator:

    sudo apt-get remove qtcreator

  2. If you want to remove Qt Creator and its dependent packages as well:

    sudo apt-get remove --auto-remove qtcreator

Reference website:

0

Just remove the Qt5 dev packages, that should do it:

sudo apt autoremove '.*qt5.*-dev'

Inspect the shown list of packages to be removed carefully before hitting yes, though! If there are some you want to keep, do apt install for them to mark them manually installed.

4
  1. Where is your qtchooser configuration file?

    $: locate qtchooser | grep conf

  2. From the list of conf files, probably there is one call "default.conf". This one is a link to one of the others (4.conf or qt4.conf or 5.conf or qt5.conf). Choose the one that makes sense to you, and create a link to it.

    Suppose your default file path is /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf.

    Create a backup:

    $: cd $(dirname /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf)
    $: cp -av default.conf default.conf_backup
    

    Let's say your target is /usr/lib/x86_64-linux-gnu/qtchooser/qt5.conf, then:

    $: sudo ln -s /usr/lib/x86_64-linux-gnu/qtchooser/qt5.conf default.conf
    
  3. Is the path to your qmake right?

    Check the qmake location:

    $: locate qmake | grep bin
    

    Is this the same one as indicated in your modified qtchooser/default.conf?

    $: cat /usr/lib/x86_64-linux-gnu/qtchooser/qt5.conf
    

    If the answer is yes, then you are done. If the answer is no, then you need to modify the file:

    Create a backup:

    $: cd $(dirname /usr/lib/x86_64-linux-gnu/qtchooser/qt5.conf)
    $: cp -av qt5.conf qt5.conf_backup
    

    Edit the file and change the path to your qmake location:

    $ sudo vi qt5.conf
    

    Now it is done.

David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article
Twitter Facebook Pinterest