7

My goal is to install Qt 5.11.1 on my headless ubuntu server 18.04.1 running jenkins2.

I am currently testing my current script on a virtual box running ubuntu desktop 18.04. note that i have not trouble installing or running qt if install using the gui installer manually

When trying to install qt using the installer gui free approach i get the following problem running using the terminal.

./qt-opensource-linux-x64-5.11.1.run --script qt-installer-noninteractive.qs --platform minimal --verbose
or
./qt-unified-linux-x64-3.0.5-online.run --script qt-installer-noninteractive.qs --platform minimal --verbose

...
...
[9732] Warning: Other components depend on component qt.tools which has child components. This will not work properly.
[9745] Warning: Component qt.qt5.5111 depends on other components while having child components. This will not work properly.

When The process finish a Qt folder is created containg qtcreator but no qt library is included.

qt-installer-noninteractive.qs

function Controller() {
    installer.autoRejectMessageBoxes();
    installer.installationFinished.connect(function() {
        gui.clickButton(buttons.NextButton,3000);
    })
}

Controller.prototype.WelcomePageCallback = function() {
    gui.clickButton(buttons.NextButton,3000);
}

Controller.prototype.CredentialsPageCallback = function() {
    gui.clickButton(buttons.NextButton,3000);
}

Controller.prototype.IntroductionPageCallback = function() {
    gui.clickButton(buttons.NextButton,3000);
}

Controller.prototype.TargetDirectoryPageCallback = function()
{
    gui.currentPageWidget().TargetDirectoryLineEdit.setText(installer.value("HomeDir") + "/Qt");
    gui.clickButton(buttons.NextButton,3000);
}

Controller.prototype.ComponentSelectionPageCallback = function() {
    var widget = gui.currentPageWidget();

    widget.deselectAll();

// pretty sure the line below is the problem, but cant find a list over the proper paths to use for linux.

    widget.selectComponent("qt.5111.gcc_64");  
    //widget.selectComponent("qt.55.qtquickcontrols");

    // widget.deselectComponent("qt.tools.qtcreator");
    // widget.deselectComponent("qt.55.qt3d");
    // widget.deselectComponent("qt.55.qtcanvas3d");
    // widget.deselectComponent("qt.55.qtlocation");
    // widget.deselectComponent("qt.55.qtquick1");
    // widget.deselectComponent("qt.55.qtscript");
    // widget.deselectComponent("qt.55.qtwebengine");
    // widget.deselectComponent("qt.extras");
    // widget.deselectComponent("qt.tools.doc");
    // widget.deselectComponent("qt.tools.examples");

    gui.clickButton(buttons.NextButton,3000);
}

Controller.prototype.LicenseAgreementPageCallback = function() {
    gui.currentPageWidget().AcceptLicenseRadioButton.setChecked(true);
    gui.clickButton(buttons.NextButton,10000);
}

Controller.prototype.StartMenuDirectoryPageCallback = function() {
    gui.clickButton(buttons.NextButton,3000);
}

Controller.prototype.ReadyForInstallationPageCallback = function()
{
    gui.clickButton(buttons.NextButton,3000);
}

Controller.prototype.FinishedPageCallback = function() {
var checkBoxForm = gui.currentPageWidget().LaunchQtCreatorCheckBoxForm
if (checkBoxForm && checkBoxForm.launchQtCreatorCheckBox) {
    checkBoxForm.launchQtCreatorCheckBox.checked = false;
}
    gui.clickButton(buttons.FinishButton);
}

I have used the following resources but without any luck.

stack overflow: silent Qt install

Qt installer no interactive installer documentation

stack overflow, Silent install for Windows listing a set of commands

Jesper Rytter
  • 153
  • 1
  • 9

3 Answers3

4

to get the binaries component for qt 5.11.1 this is the correct path to add

widget.selectComponent("qt.qt5.5111.gcc_64"); 
Jesper Rytter
  • 153
  • 1
  • 9
  • 1
    Thanks. I suppose the correct path for *MSVC* binaries is `widget.selectComponent("qt.qt5.5111.win64_msvc2015_64");`. – Matphy Oct 12 '18 at 11:58
2

The script never worked for me (or I was just too dumb to use it), but I wrote a more or less simple python script that basically does the same as the official Qt installer does. You can find it here.

This is how to install the dependencies and run it:

sudo apt install python3-requests p7zip-full wget

wget https://git.kaidan.im/lnj/qli-installer/raw/master/qli-installer.py
chmod +x qli-installer.py

./qli-installer.py 5.11.3 linux desktop

Then the Qt installation can be found at ./5.11.3/gcc_64/ in this case. With other systems/targets (i.e. linux android android_armv7) this will differ of course.

LNJ
  • 304
  • 2
  • 13
  • Unfortunately your script does not does not change Qt install path / rpath. See "qmake --version" that shows /home/qt/work/install/lib and not the path the script installed Qt. One might be able to use Qt, but in quite some cases not. – Gusch5 Aug 04 '19 at 11:50
  • aqtinstall (based on the script) fixes the problem: https://github.com/miurahr/aqtinstall – LNJ Jul 04 '20 at 20:11
0

You could just forward X through ssh to your local machine..

See https://www.businessnewsdaily.com/11035-how-to-use-x11-forwarding.html

E.g. ssh -X root@headless_server_ip

Run your ./qt-unified-linux-x64-3.1.1-online.run and the installer GUI will pop up on your ssh client (that has an X server). Follow the install steps and .. voila..

Tudor
  • 163
  • 5