How do you install qt on ubuntu22.04

5,417

Solution 1

Why don't you install it with their online installer.

Once downloaded, chmod +x qt-unified-linux-<arch>-<version>-online.run then ./qt-unified-linux-<arch>-<version>-online.run

Solution 2

You need to install packages:

sudo apt install -y qtcreator qtbase5-dev qt5-qmake cmake

And you need to manually change the Qt version: screenshot how to manually change Qt version

Then you need to manually change Qt version in the Kits tab: screenshot on the Kits tab

Share:
5,417
Admin
Author by

Admin

Updated on January 04, 2023

Comments

  • Admin
    Admin over 1 year

    In ubuntu20.04 qt5-default was the package name. So I tried the same and qt6-default in 22.04.

    Then I tried apt-cache search qt which revealed (among many others): qt6-base-dev and qt5-base-dev.

    I am unsure whether the new qt{version}-base-dev is the old qt5-default. If not: What is?

  • Admin
    Admin almost 2 years
    I try to use the package manager whenever I am able, but you are right given my question.
  • Admin
    Admin almost 2 years
    @Natan I tried the same thing. Maybe it'll get there in the future since 22.04 is relatively new.
  • Admin
    Admin almost 2 years
    Unfortunately, the online installer does not run on arm64 architecture.
  • Admin
    Admin almost 2 years
    @Dragos You can also build from source if you are unable to use the installer.
  • Admin
    Admin almost 2 years
    this is a good answer and will get you the latest qt6.2+ BUT if you want to use the qt that came with your distro (especially if you use Kubuntu - which i guess you don't) then sudo apt install answer is the way to go if you want to distribute .deb files on kubuntu. which i guess you don't :)
  • Admin
    Admin almost 2 years
    i sure hope this works on the standard raspberry pi os. i'm having problems gettin apt to install qtcreator on there. Well, not qtcreator - that's on fine. But the qt kit can't be found. Hoping that's in the qtbase5-dev. I'll give it a shot. thanks!
  • Admin
    Admin almost 2 years
    @StephenHazel Unless it's changed (doubtful), you can install Qt 5.x through this installer as well.
  • Admin
    Admin almost 2 years
    not 5.15.3 that is used by kubuntu 22.04. you can sudo apt install it on kubuntu, but the online installer goes from 5.15.2 to 6.0. I think cuz KDE started maintaining bug fixes on the last 5.x line as they couldn't move to 6 yet.
  • Admin
    Admin almost 2 years
    That -does- work to install qtcreator (and especially the proper kit stuff) onto raspberry pi (regular 32 bit os). That helped me a looot - thanks!
  • Admin
    Admin almost 2 years
    This worked for me on amd-64 Ubuntu 22.04