如何卸载Qt5?

18

一些原因导致我在我的 Ubuntu 14.04 LTS 机器上拥有了两个版本的Qt,Qt4和Qt5。以下是 qtchooser -list-versions 的输出:

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

如何移除Qt5?

5个回答

19
  1. 打开终端并导航到安装Qt的目录。
  2. 运行命令./MaintenanceTool

13

从终端操作:

1. 卸载软件包:
sudo apt-get remove qtcreator && sudo apt-get remove qt5*
2. 移除所有依赖项:
sudo apt-get purge qtcreator && sudo apt-get purge qt5*

3. 移除作为依赖项一度安装的不必要软件包:

sudo apt-get autoremove
4. 从本地缓存中删除所检索的软件包:
sudo apt-get autoclean

从GUI:

  1. 打开Qt维护工具Qt Maintenance Tool

  2. 勾选卸载Uninstall

  3. 点击下一步,然后卸载enter image description here

  4. 如果需要,请输入Sudo密码,然后按完成


10

7
只需删除Qt5开发包即可解决问题:
sudo apt autoremove '.*qt5.*-dev'

在点击“是”之前,请仔细检查要删除的包列表!如果有一些您想保留的包,可以使用apt install命令手动标记它们为已安装。


1
我想从我的Ubuntu 16.04中删除所有Qt,我该如何实现? - user3806649
1
完成这个操作后,我仍然可以在 qtchooser -list-versions 中看到 Qt 4 和 Qt 5。 - ugola
@UrviG 猜测您仍然拥有两个 qmake。也许您在某个时候手动标记了它们为已安装,因此它们没有被删除。请检查已安装软件包的列表。 - hyde
1
感谢@hyde,这是该命令的输出。5 default qt4-x86_64-linux-gnu qt4 qt5-x86_64-linux-gnu qt5``` 我只想完全清除QT,在这个系统(ubuntu 16.04)之前安装了不同版本的QT并重新开始。尽管有这个输出,我可以继续吗? - ugola

2
  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.


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接