Qt 4.x installation on Ubuntu 18.04
-
Hi. I'm a newbie and trying to install Qt on Ubuntu 18.04 so that I can use the Avogadro program, which requires Qt v.4. I've failed pretty miserably so far. Can anyone provide guidance or links to help me:
- Remove all traces of previous Qt installations
- Find, download, make, and install some version of Qt 4.x
Thanks.
-
hi @Just_Liberty,
can you tell us what you did install so far (and how)?
-
Hi and welcome to devnet,
There's no need to search to manually install Qt 4. Just use the one provided by your distribution. At this point in time, it will be the latest version available.
-
@Just_Liberty
Hi
What about
sudo apt install qt4-default -
Well that was easy! So, is that -default a Qtism, an Ubuntu-ism, a package-ism, or a Linux-ism? How would I find that out if I (you!) didn't know it? Thanks very much.
-
@Just_Liberty probably Debian/Ubuntu.
apt-cache search qt4
is your friend ;) -
@Just_Liberty It's how Ubuntu packages Qt, nothing related to Qt project. To find out what you need to install use what @aha_1980 suggested or "apt search".
-
@Just_Liberty said in Qt 4.x installation on Ubuntu 18.04:
Well that was easy! So, is that -default a Qtism, an Ubuntu-ism, a package-ism, or a Linux-ism? How would I find that out if I (you!) didn't know it? Thanks very much.
Each Linux distribution has a package mechanism or rather each major distribution has. For example all Debian derivates like Ubuntu uses Debian's package manager. That's one of the first thing you should look for when installing one or the other flavours of Linux. Also note that most of them also have one or more GUI available so you don't necessarily have to go through the command line.
-
@Just_Liberty To add to @SGaist : on Debian derivatives like Ubuntu you can install Synaptic - it is a graphical user interface for the packet manager.
-
As a matter of principle, I wouldn't use a GUI to help install under Linux, that's too helpful ;-)
In addition to to @aha_1980's
apt-cache search qt4
suggestion, be aware that the shell (bash
) will (getapt
to) suggest completions for installation packages just via the tab key on the command line. It's not an "in-string" search likeapt-cache search
, but it's a convenient starting point. So if you are interested in packages which might start withqt4
, just type inapt-get install qt4
and press the Tab key. That will expand to
qt4-
in this case, as that's the only completion here. Pressing Tab now a second time will list all the packages starting withqt4-
(12 in my case). That's what I do when I know the prefix of the package but not what's available. -
@Just_Liberty
Heads-up, just to be clear about the "3 vs 2 times". (I see I mis-explained this above.) It depends when you started pressing Tab, and shell filename completion works the same:-
If you start from
apt-get install qt4
, the only possible completions at that point all start withqt4-
(note the hyphen). Pressing Tab once will append the hyphen and that's it at that point. -
You now have
apt-get install qt4-
. At this point there are multiple possible completions all fromqt4-
. When you press Tab once nothings (seems to) happen (in fact, I think the terminal "bell" rings to tell you this), because the shell does not know what you want next. If you then press Tab a second time at this point it will list all the possible completions, so that you know what you might want to type next.
Above is all default
bash
behaviour (can be modified). So if you start fromapt-get install qt4
you will end up pressing Tab 3 times, if you start fromapt-get install qt4-
it will only be 2 Tabs. See?This is all worth knowing if you like
bash
filename completion. That has worked for years & years, back to UNIX days. What's new (to me, somewhere along the line) is that it used to be only filename completion.bash
now seems to be "clever" and look at what you have to the left on the command-line and adjust what it does to the "context" of the command you're intending, e.g.gunzip <filename><TAB>
only offers files ending in.gz
,tar xf archive.tar <file-to-extract><TAB>
looks inside the archive for filenames to offer, etc.! Often helpful, sometimes annoying! :) -
-
@JonB The logic behind this bash feature is called bash-completion and is of course adjustable ;)
-
@aha_1980
Aha! [So to speak.] What do I say to my Linux admin expert friend who says/claims it does not work in his Ubuntu 16.04 when it's working for me in 18.04, I know it always used to work in 17.04, and I would have thought when I started it 16.04 it did? How long do you think that "customizable" bash completion has been available & implemented, is it really new? -