ZeroTierOne icon indicating copy to clipboard operation
ZeroTierOne copied to clipboard

Incorrect OS detection for Linux Mint via installer script

Open x12Mike opened this issue 2 years ago • 8 comments

Summary

When trying to use the installer curl -s https://install.zerotier.com | sudo bash for Linux Mint 20.3, the installation fails with a libssl version error.

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 zerotier-one : Depends: libssl1.0.0 (>= 1.0.2~beta3) but it is not installable
E: Unable to correct problems, you have held broken packages.

*** Package installation failed! Unfortunately there may not be a package
*** for your architecture or distribution. For the source go to:
*** https://github.com/zerotier/ZeroTierOne

Confirmed libssl was, in fact, installed:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
libssl1.1 is already the newest version (1.1.1f-1ubuntu2.10).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Problem

As I diagnosed this, the installer detects Linux Mint, regardless of which version, as Ubuntu 16.04 (xenial).

Relevant code snippet from installer:

if [ -f /etc/lsb-release -a -n "`cat /etc/lsb-release 2>/dev/null | grep -F -i LinuxMint`" ]; then
# Linux Mint -> Ubuntu 'xenial'
echo '*** Found Linux Mint, creating /etc/apt/sources.list.d/zerotier.list'
echo "deb ${ZT_BASE_URL_HTTP}debian/xenial xenial main" >/tmp/zt-sources-list

Quick Fix

I modified the /etc/apt/sources.list.d/zerotier.list file to reflect Ubuntu Focal (20.04), which is what Linux Mint 20.3 is based on.

deb http://download.zerotier.com/debian/focal focal main

Long Term Fix idea

Modify the installer so when it finds Linux Mint, it checks the /etc/os-release for the Ubuntu codename. The basic idea of below is to determine the Ubuntu equivalent, and if it cannot, either fail, or statically set a base Ubuntu release it can fall back to. In this example, I used bionic.

Disclaimer, this is ugly code. :)

if [ -f /etc/lsb-release -a -n "`cat /etc/lsb-release 2>/dev/null | grep -F -i LinuxMint`" ]; then
    # Determine the Ubuntu codename for Linux Mint
    if [ -f /etc/os-release -a -n "`cat /etc/os-release 2>/dev/null | grep -R -i UBUNTU_CODENAME`" ]; then
      CODENAME=`grep UBUNTU_CODENAME /etc/os-release | cut -d '=' -f 2`
    else
    # Ubuntu 16.04 = xenial
    # Ubuntu 18.04 = bionic
    # Ubuntu 20.04 = focal
    # Default to bionic as it's 2 LTS releases behind
      CODENAME="bionic"
fi
# Linux Mint -> Ubuntu 'xenial'
echo '*** Found Linux Mint, creating /etc/apt/sources.list.d/zerotier.list'
echo "deb ${ZT_BASE_URL_HTTP}debian/$CODENAME $CODENAME main" 

x12Mike avatar Mar 10 '22 23:03 x12Mike

Similar for Ubuntu Focal... Script, curl -s https://install.zerotier.com | sudo bash installs for Bionic when run on Focal... OK, easy fix to edit /etc/apt/sources.list.d/zerotier.list but, surely, this shouldn't be necessary

jradxl avatar Mar 12 '22 17:03 jradxl

The same thing happens if you try to use LMDE. It is detected as Linux Mint and tries to use Ubuntu rather than Debian Buster.

johncarterofmars avatar Mar 18 '22 01:03 johncarterofmars

I am on Mint 20.3. I edited /etc/apt/sources.list.d/zerotier.list as root. Removed "deb http://download.zerotier.com/debian/xenial xenial main". Replaced it with "deb http://download.zerotier.com/debian/focal focal main". I then save the file and run curl -s https://install.zerotier.com | sudo bash again. But it's still giving the same error:

Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies: zerotier-one : Depends: libssl1.0.0 (>= 1.0.2~beta3) but it is not installable E: Unable to correct problems, you have held broken packages.

*** Package installation failed! Unfortunately there may not be a package *** for your architecture or distribution. For the source go to: *** https://github.com/zerotier/ZeroTierOne

When I open /etc/apt/sources.list.d/zerotier.list, I see that it mysteriously reverted back to "deb http://download.zerotier.com/debian/xenial xenial main". What happened?

hub2git avatar Apr 09 '22 23:04 hub2git

@hub2git Once you update the /etc/apt/sources.list.d/zerotier.list from xenial to focal, you can just run apt update and then apt install zerotier-one.

Edit: You shouldn't try the curl install method a second time as it will overwrite your zerotier.list file.

x12Mike avatar Apr 10 '22 00:04 x12Mike

It would be great if manual repository installation instructions were published as an alternative to the convenience script, for example like Docker do here.

When the script fails like this without rolling back the changes it is frustrating to not know what it changed on the system. It would also allow for cleaner integration in configuration management systems like Ansible.

carlsa avatar Apr 13 '22 14:04 carlsa

It would be great if manual repository installation instructions were published as an alternative to the convenience script, for example like Docker do here.

When the script fails like this without rolling back the changes it is frustrating to not know what it changed on the system. It would also allow for cleaner integration in configuration management systems like Ansible.

I think it would also be a good idea to include the installer script in this repo so PR's can be created to address things like this. Then someone could do a PR to the documentation to break out each step like the Docker doc that you mentioned.

x12Mike avatar Apr 17 '22 01:04 x12Mike

Going off at a slight tangent, Ubuntu 22.04 (jammy) is now out - and doesn't seem to include libssl1.1, so none of the obvious choices (bionic/focal/bookworm) for repositories contain an installable package :(

srd424 avatar Apr 22 '22 10:04 srd424

Hello everyone. We're actively working on fixing the packaging situation. Stay tuned. -s

someara avatar Apr 22 '22 15:04 someara