Bug 5742 - Graphical installer does not work out of the box on Fedora 23 or Ubuntu 15.10
Summary: Graphical installer does not work out of the box on Fedora 23 or Ubuntu 15.10
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Server Installer (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.7.0
Assignee: Pierre Ossman
URL:
Keywords: hean01_tester, relnotes, samuel_tester
Depends on:
Blocks: 4586 5829
  Show dependency treegraph
 
Reported: 2015-12-04 14:22 CET by Karl Mikaelsson
Modified: 2022-06-13 15:28 CEST (History)
3 users (show)

See Also:
Acceptance Criteria:


Attachments

Description Karl Mikaelsson cendio 2015-12-04 14:22:52 CET

    
Comment 1 Pierre Ossman cendio 2015-12-08 11:04:46 CET
In these cases the problem is that PyGTK2 is not installed by default anymore on these distributions.
Comment 3 Pierre Ossman cendio 2016-06-27 15:25:15 CEST
A refresher for current versions:

Ubuntu 16.04 Desktop: Python 2, but no PyGTK2
Ubuntu 16.04 Server: No GUI, no Python 2 [1]

Fedora 24 Workstation: No Python 2
Fedora 24 Server: No GUI, no Python 2

[1] But libgtk2 oddly enough
Comment 4 Pierre Ossman cendio 2016-06-27 15:37:59 CEST
Both Ubuntu Desktop and Fedora Workstation include Zenity though, so you get a graphical error message. Not sure what the scope of this bug is.
Comment 5 Pierre Ossman cendio 2016-06-29 14:26:19 CEST
We'll try to take a few small steps to make this less painful, until we have something more long term in place (bug 4586).
Comment 6 Pierre Ossman cendio 2016-06-29 14:28:03 CEST
As a start I've added a platform specific note for Fedora. Will do the same for
Ubuntu.
Comment 7 Pierre Ossman cendio 2016-06-29 14:35:16 CEST
Note also added for Ubuntu.
Comment 17 Pierre Ossman cendio 2016-07-06 16:54:48 CEST
I also had a look at openSUSE, but they have yet to start deprecating Python 2. The minimal install includes Python 2, and the default desktop (KDE) includes PyGTK. This is true for both Leap and Tumbleweed.
Comment 23 Pierre Ossman cendio 2016-07-08 11:09:28 CEST
Works rather well now. The installer now starts (in GUI if necessary) on these platforms:

 - Fedora 24 Workstation
 - Fedora 24 Server
 - Ubuntu 16.04 Desktop
 - Ubuntu 16.04 Server
 - Kubuntu 16.04

(Note however that support for DNF and APT can still be missing. see bug 5202 and bug 4586.)
Comment 24 Peter Åstrand cendio 2016-08-08 13:18:09 CEST
Nightly build cannot install:

# /home/tlbuilder/buildarea/trunk/ctc/installer/install-server
/home/tlbuilder/buildarea/trunk/ctc/installer/install-server: line 26: /home/tlbuilder/buildarea/trunk/ctc/installer/libs/libexec/syscheck.sh: No such file or directory
Comment 25 Pierre Ossman cendio 2016-08-18 15:24:01 CEST
That is not the proper path to the installer:

$ /home/tlbuilder/buildarea/trunk/ctc/server-bundle/install-server
Could not start PyGTK. Using text mode fallback...

This program must be run as root.
Do you want to try re-launching the installer through 'sudo' [Yes/no]?
Comment 26 Henrik Andersson cendio 2016-08-22 14:34:39 CEST
I have tested installation on following dists:

  - Ubuntu 16.04LTS
  - Ubuntu Server 16.04LTS
  - Sles12SP1
  - Debian 8
  - Fedora 24

Which provides combinations of python2 and pyktg2 availability. Tested both UI and console. Everything works as expected.
Comment 27 Henrik Andersson cendio 2016-08-22 14:37:03 CEST
Find one bug were the package installation was made in a inherited tty, reproduce from terminal:

 1. unzip server bundler
 2. enter unpacked directory and ru 'nautilus .'
 3. click on install-server and nothing visually happens. the sudo and installation is redirected to the terminal were nautilus is started.
Comment 28 Henrik Andersson cendio 2016-08-25 16:00:37 CEST
Additionally, when Ubuntu removed python2 package the package installer module python-apt package was also removed. Which means that package installation doesn't work out of the box on Ubuntu 16.04LTS.

We could hijack this bug to install python-apt as prerequisite for running tl-setup to solve this issue.

Currently this is documented as platform specific notes.
Comment 29 Karl Mikaelsson cendio 2016-08-29 14:11:41 CEST
(In reply to comment #27)
> Find one bug were the package installation was made in a inherited tty,
> reproduce from terminal:
> 
>  1. unzip server bundler
>  2. enter unpacked directory and ru 'nautilus .'
>  3. click on install-server and nothing visually happens. the sudo and
> installation is redirected to the terminal were nautilus is started.

I've tried reproducing this error on Ubuntu 16.04 Server and here's what I've found so far:

 1. $ sudo apt install ubuntu-desktop
 2. Start a new graphical session.
 3. $ sudo apt remove python2.7
 4. $ sudo apt autoremove (probably optional)
 5. $ pkill nautilus
 6. $ nautilus tl-*-server
 7. Double-click "ThinLinc Server Installer" in the Nautilus window

In the terminal behind the Nautilus window, this output can be seen looping over and over:

> Error: No Python 2.x interpreter found.
>
> A Python 2.x interpreter is required for ThinLinc.
> I was trying to use the Python interpreter named 'python'.
>
> If Python is installed under a different name, set the PYTHON
> environment variable to the Python binary to use. Example:
> PYTHON=/usr/bin/python2.4 /home/cendio/server-bundle-nightly/install-server
>
> To install Python, please run this command:
>
> sudo apt install python
>
> Would you like  to run this command now?
>
>
> $ sudo apt install python
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> The following additional packages will be installed:
> libpython-stdlib libpython2.7-minimal libpython2.7-stdlib python-minimal
> python2.7 python2.7-minimal
> Suggested packages:
> python-doc python-tk python2.7-doc binfmt-support
> The following NEW packages will be installed:
> libpython-stdlib libpython2.7-minimal libpython2.7-stdlib python
> python-minimal python2.7 python2.7-minimal
> 0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
> Need to get 3,907 kB of archives.
> After this operation, 16.6 MB of additional disk space will be used.
> Do you want to continue? [Y/n] Abort.
>
> Installation completed successfully.
> Restarting /home/cendio/server-bundle-nightly/install-server...
>
>
> Error: No Python 2.x interpreter found.
>
> A Python 2.x interpreter is required for ThinLinc.
> I was trying to use the Python interpreter named 'python'.
>
> If Python is installed under a different name, set the PYTHON
> environment variable to the Python binary to use. Example:
> PYTHON=/usr/bin/python2.4 /home/cendio/server-bundle-nightly/install-server
>
> To install Python, please run this command:
>
> sudo apt install python
>
> Would you like  to run this command now?
>
>
> $ sudo apt install python
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> The following additional packages will be installed:
> libpython-stdlib libpython2.7-minimal libpython2.7-stdlib python-minimal
> python2.7 python2.7-minimal
> Suggested packages:
> python-doc python-tk python2.7-doc binfmt-support
> The following NEW packages will be installed:
> libpython-stdlib libpython2.7-minimal libpython2.7-stdlib python
> python-minimal python2.7 python2.7-minimal
> 0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
> Need to get 3,907 kB of archives.
> After this operation, 16.6 MB of additional disk space will be used.
> Do you want to continue? [Y/n] Abort.
>
> Installation completed successfully.
> Restarting /home/cendio/server-bundle-nightly/install-server...
>
>
> Error: No Python 2.x interpreter found.
>
> A Python 2.x interpreter is required for ThinLinc.
> I was trying to use the Python interpreter named 'python'.
>
> If Python is installed under a different name, set the PYTHON
> environment variable to the Python binary to use. Example:
> PYTHON=/usr/bin/python2.4 /home/cendio/server-bundle-nightly/install-server
>
> To install Python, please run this command:
>
> sudo apt install python
>
> Would you like  to run this command now?
>
>
> $ sudo apt install python
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> The following additional packages will be installed:
> libpython-stdlib libpython2.7-minimal libpython2.7-stdlib python-minimal
> python2.7 python2.7-minimal
> Suggested packages:
> python-doc python-tk python2.7-doc binfmt-support
> The following NEW packages will be installed:
> libpython-stdlib libpython2.7-minimal libpython2.7-stdlib python
> python-minimal python2.7 python2.7-minimal
> 0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
> Need to get 3,907 kB of archives.
> After this operation, 16.6 MB of additional disk space will be used.
> Do you want to continue? [Y/n] Abort.
>
> Installation completed successfully.
> Restarting /home/cendio/server-bundle-nightly/install-server...
>
>
> Error: No Python 2.x interpreter found.
>
> A Python 2.x interpreter is required for ThinLinc.
> I was trying to use the Python interpreter named 'python'.
>
> If Python is installed under a different name, set the PYTHON
> environment variable to the Python binary to use. Example:
> PYTHON=/usr/bin/python2.4 /home/cendio/server-bundle-nightly/install-server
>
> To install Python, please run this command:
>
> sudo apt install python
>
> Would you like  to run this command now?
>
>
> $ sudo apt install python
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> ^C
Comment 30 Karl Mikaelsson cendio 2016-08-29 15:29:46 CEST
While investigating, I noticed that syscheck.sh was marked as a /bin/bash file, but since it's sourced from a /bin/sh file, it needs to be /bin/sh.
Comment 38 Karl Mikaelsson cendio 2016-09-01 13:23:53 CEST
With all these commits, I believe this bug is done again.

syscheck.sh should now prefer to use the graphical tools if they're available, and fall back to text mode.

If we're running on a system with the apt package manager, syscheck.sh will offer to install python-apt.
Comment 39 Henrik Andersson cendio 2016-09-02 12:59:08 CEST
One problem is that zenity uses WINDOWID from env to set transient window. In the issue were nautilus is started from terminal, zenity dialogs are transient to terminal window and not nautilus, eg hidden behind nautilus.

One workaround is to unset windowid when calling zenity like:

  env -u WINDOWID zenity --calendar
Comment 40 Henrik Andersson cendio 2016-09-05 08:27:41 CEST
Verified graphical and text installation using Fedora 24 and Ubuntu 16.04 LTS works as expected. Also verified that when running nautilus from terminal and starting ThinLinc installer works as expected.
Comment 43 Peter Åstrand cendio 2016-09-07 15:11:16 CEST
I'm not sure if this is expected or not, but this is what I get on a minimal SLES12SP1 installation, when installing via SSH with X11 forward enabled:

# ./install-server

Error: PyGTK not found.

PyGTK is required for ThinLinc's graphical installer.
To install PyGTK, please run this command:

    sudo zypper install python-gtk

Would you like to run this command now?

Alternatively, run this program from a terminal without the
DISPLAY environment variable set to get the text mode fallback.

(Y/n)? y

Could not find a terminal program. Exiting.
Comment 45 Karl Mikaelsson cendio 2016-09-08 13:12:47 CEST
(In reply to comment #43)
> I'm not sure if this is expected or not, but this is what I get on a minimal
> SLES12SP1 installation, when installing via SSH with X11 forward enabled:
> 
> # ./install-server
> 
> Error: PyGTK not found.
> 
> PyGTK is required for ThinLinc's graphical installer.
> To install PyGTK, please run this command:
> 
>     sudo zypper install python-gtk
> 
> Would you like to run this command now?
> 
> Alternatively, run this program from a terminal without the
> DISPLAY environment variable set to get the text mode fallback.
> 
> (Y/n)? y
> 
> Could not find a terminal program. Exiting.

Fixed in r31675.
Comment 46 Henrik Andersson cendio 2016-09-13 15:16:09 CEST
I was about to install build 5231 on Elementary OS which is a ubuntu fork. No python2 installed and I was asked about to install it. However a error message dialog said that I have no terminal. Installed Xterm and it worked as expected. 
The dialog should hint about which terminal to install probably xterm.
Comment 49 Henrik Andersson cendio 2016-09-16 06:33:56 CEST
The conclusion that xdg-terminal from xdg-utils was wrong. The actual code used is in syscheck.sh within _doinstall() function. This message can be updated to include an hint about installing a known terminal.
Comment 52 Henrik Andersson cendio 2016-09-26 10:03:24 CEST
On a debian 8 minimal install sudo is not available. Running install server as ROOT gives me following strange behavior, sudo not found, installation of package success, restart install server telling me that i need to install the previous "installed" package over and over again..

At least, do a check if user running the install server already is root to skip using sudo.


    (Y/n)? y

    $ sudo apt install python
    ./install-server: 126: /root/tl-4.6.0post-server/libs/libexec/syscheck.sh: 
    sudo:   not found

    Installation completed successfully.
    Restarting ./install-server...
Comment 56 Peter Åstrand cendio 2016-09-28 12:57:59 CEST
I get this on Ubuntu 16.04.01 desktop:

...
Preparing to unpack .../python-cairo_1.8.8-2_amd64.deb ...
Unpacking python-cairo (1.8.8-2) ...
Selecting previously unselected package python-gobject-2.
Preparing to unpack .../python-gobject-2_2.28.6-12ubuntu1_amd64.deb ...
Unpacking python-gobject-2 (2.28.6-12ubuntu1) ...
Selecting previously unselected package python-gtk2.
Preparing to unpack .../python-gtk2_2.24.0-4ubuntu1_amd64.deb ...
Unpacking python-gtk2 (2.24.0-4ubuntu1) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Setting up python-cairo (1.8.8-2) ...
Setting up python-gobject-2 (2.28.6-12ubuntu1) ...
Setting up python-gtk2 (2.24.0-4ubuntu1) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
bash: line 3: local: can only be used in a function

bash: line 5: [: -ne: unary operator expected
Installation completed successfully.
Please restart ./install-server to continue.

Press Enter to close this terminal...
Comment 58 Samuel Mannehed cendio 2016-10-03 16:11:04 CEST
(In reply to comment #56)
> I get this on Ubuntu 16.04.01 desktop:
> 
> ...
> bash: line 3: local: can only be used in a function
> 
> bash: line 5: [: -ne: unary operator expected

Verified that I get this when trying to run install-server on Ubuntu 16.04 using 4.7.0beta1 and that it is fixed with build 5252.

I think the experience of installing ThinLinc 4.7.0 on Ubuntu 16.04 is really nice!

Note You need to log in before you can comment on or make changes to this bug.