Ubuntu 18.04.1 LTS x64: how to update Qt 5.10 from Qt 5.9.5?
Solution 1
You have the latest version of qt5-default
package available from Ubuntu repositories qt5-default (5.9.5+dfsg-0ubuntu1). To install the 5.10.x
version you should follow the instructions described on the official website : Install Qt 5 on Ubuntu
The installation file can be downloaded from here.
The 5.10.0
version:
wget http://download.qt.io/official_releases/qt/5.10/5.10.0/qt-opensource-linux-x64-5.10.0.run
The 5.10.1
version:
wget http://download.qt.io/official_releases/qt/5.10/5.10.1/qt-opensource-linux-x64-5.10.1.run
to set qt 5.10 as default edit:
sudo nano /usr/lib/x86_64-linux-gnu/qtchooser/default.conf
with the following line (replace $USER with your username):
/home/$USER/Qt5.10.0/5.10.0/gcc_64/bin
/home/$USER/Qt5.10.0/5.10.0/gcc_64/lib
then run:
qtchooser -print-env
qmake -v
.
Solution 2
Qt PPAs are maintained by Stephan Binner on Launchpad:
Instructions for updating are listed within each PPA.
Solution 3
I spent several weeks messing with a system level replacement of Qt 5.9.5 on Ubuntu Bionic and it didn't seem feasible without a backport. The qtxxx.run file will install to /opt which is correct but ancillary and would require some environment variable and/or path override. I built some programs against qt in /opt but they didn't work well just because everything wants to use system default.
System Qt is distributed in a wide array of folders that exist in parallel where the /opt is in a tree. This magic appears to happen toward the end of the debuild/backportpackage type process where the rules makes changes to some of the paths stored in files to mesh with Ubuntu's structure. I was unable to backport upstream versions because of chicken and the egg situations where cross-package dependencies fail even with the bootstrapped qmake.
Long story short, at least for me, best to stick with the Qt version that's part of the distro. It is a core item that isn't meant to be either replaced or have multiple versions without very careful testing.
This was my experience but that doesn't mean it's fact. I'd be pleased to hear if anyone had more success.
Related videos on Youtube
1Z10
Updated on September 18, 2022Comments
-
1Z10 almost 2 years
I'm on Ubuntu 18.04.1 LTS x64 and I need to update my Qt 5 installation from v5.9.5 to v5.10.0, however when I issue the command
sudo apt-get install qt5-default
it gives me that
qt5-default is already at the latest versione (5.9.5+dfsg-0ubuntu1).
But obviously it's not true. I've also tried running:
sudo apt-get update sudo apt upgrade sudo apt dist-upgrade
before, but without success.
What is wrong with those commands? I just need to install the core libs without the UI stuff (e.g. qtcreator).
-
1Z10 over 5 yearsok, I installed the 5.10.0 with Qt Creator and Desktop gcc x64, but
qmake -v
still returnsQMake version 3.1 Using Qt version 5.9.5 in /usr/lib/x86_64-linux-gnu
-
GAD3R over 5 years@1Z10 please add the output of
qtchooser -l
-
1Z10 over 5 yearsI installed it and this is the output
$ qtchooser -l 4 5 qt4-x86_64-linux-gnu qt4 qt5-x86_64-linux-gnu qt5
-
tofutim over 4 yearsare there any good tips on installing this headless to the right place?