Ubuntu 22.04 配置qtchooser默认启用 Qt6

文章目录

  • 问题现象
  • 解决方案
    • [系统解决方案 1. Select Qt6 system-wide](#系统解决方案 1. Select Qt6 system-wide)
    • [当前用户解决方案 2. Select Qt6 for current user only](#当前用户解决方案 2. Select Qt6 for current user only)
  • 参考资料

问题现象

In Ubuntu 22.04 there is currently an open bug QtChooser doesnt support qt6.

So even if Qt6 has been installed using sudo apt install qt6-base-dev, qtchooser -l does not list a qt6 option and qmake outputs qmake: could not find a Qt installation of ''.

Assuming Qt6 is installed and qmake6 can be called, I believe there are two options:

解决方案

系统解决方案 1. Select Qt6 system-wide

  • Generate qt6.conf based on the path to qmake6
bash 复制代码
qtchooser -install qt6 $(which qmake6)
  • Move/copy qt6.conf to system-wide dir
bash 复制代码
# sudo mv ~/.config/qtchooser/qt6.conf /usr/share/qtchooser/qt6.conf
sudo cp ~/.config/qtchooser/qt6.conf /usr/share/qtchooser/qt6.conf
  • Set Qt6 as default option
bash 复制代码
sudo mkdir -p /usr/lib/$(uname -p)-linux-gnu/qt-default/qtchooser
sudo ln -sf /usr/share/qtchooser/qt6.conf /usr/lib/$(uname -p)-linux-gnu/qt-default/qtchooser/default.conf

当前用户解决方案 2. Select Qt6 for current user only

  • Generate qt6.conf based on path to qmake6
bash 复制代码
qtchooser -install qt6 $(which qmake6)
  • Select Qt6 as default (place in ~/.bashrc for persistence):

    export QT_SELECT=qt6

参考资料

相关推荐
bantinghy1 小时前
Linux系统TCP/IP网络参数优化
linux·网络·tcp/ip
星期天要睡觉1 小时前
Linux 综合练习
linux·运维·服务器
saynaihe2 小时前
proxmox8升级到proxmox9
linux·运维·服务器
Orchestrator_me2 小时前
CentOS交换区处理
linux·运维·centos
zru_96022 小时前
centos 系统如何安装open jdk 8
java·linux·centos
FLS1682 小时前
VMwaer虚拟机安装完Centos后无法联网问题
linux·运维·centos
OctopusMonster2 小时前
centos下gdb调试python的core文件
linux·运维·centos
snowfoootball3 小时前
(自用)Linux 常用命令自查文档
linux·运维·服务器
Web极客码3 小时前
在Ubuntu 20.04的服务器上查找的服务器的IP地址
服务器·tcp/ip·ubuntu
R-G-B4 小时前
Linux常见命令总结 合集二:基本命令、目录操作命令、文件操作命令、压缩文件操作、查找命令、权限命令、其他命令
linux·基本命令·目录操作命令·linux常见命令·压缩文件操作·权限命令·查找命令