zerotier / ZeroTierOne

A Smart Ethernet Switch for Earth
https://zerotier.com
Other
14.55k stars 1.7k forks source link

Linux Mint 22 (Wilma) Installation failure (Breaks package and update managers) #2353

Closed Squelch closed 2 months ago

Squelch commented 2 months ago

Due to the nature of this bug, both of the natively installed package managers (Software Manager and Synaptic Package Manager) as well as the Update Manager will no longer work. See the bottom of this post for error details and repair.

Expected:

Using the installation scripts, the correct package repository to be added to the package manager and the appropriate ZeroTier package for the OS to be installed.

Observed:

The script runs, installs the GPG keys and adds the zerotier.list entry to /etc/apt/sources.list.d. However, the script them fails with a malformed URI.

Reproduction:

On Linuc Mint 22, attempt to install ZeroTier using either of the supplied scripts on https://www.zerotier.com/download/#entry-5

Additional information:

os-release

NAME="Linux Mint"
VERSION="22 (Wilma)"
ID=linuxmint
ID_LIKE="ubuntu debian"
PRETTY_NAME="Linux Mint 22"
VERSION_ID="22"
HOME_URL="https://www.linuxmint.com/"
SUPPORT_URL="https://forums.linuxmint.com/"
BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
PRIVACY_POLICY_URL="https://www.linuxmint.com/"
VERSION_CODENAME=wilma
UBUNTU_CODENAME=noble

Script output

$ curl -s 'https://raw.githubusercontent.com/zerotier/ZeroTierOne/master/doc/contact%40zerotier.com.gpg' | gpg --import &&  if z=$(curl -s 'https://install.zerotier.com/' | gpg); then echo "$z" | sudo bash; fi
gpg: key 1657198823E52A61: "ZeroTier, Inc. (ZeroTier Support and Release Signing Key) <contact@zerotier.com>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1
gpg: WARNING: no command supplied.  Trying to guess what you mean ...
gpg: Signature made Fri 31 May 2024 16:56:02 BST
gpg:                using RSA key 74A5E9C458E1A431F1DA57A71657198823E52A61
gpg:                issuer "contact@zerotier.com"
gpg: Good signature from "ZeroTier, Inc. (ZeroTier Support and Release Signing Key) <contact@zerotier.com>" [unknown]
gpg: WARNING: The key's User ID is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 74A5 E9C4 58E1 A431 F1DA  57A7 1657 1988 23E5 2A61
[sudo] password for squelch:         

*** ZeroTier Service Quick Install for Unix-like Systems

*** Tested OSes / distributions:

***   MacOS (10.13+) (just installs ZeroTier One.pkg)
***   Debian Linux (7+)
***   RedHat/CentOS Linux (6+)
***   Fedora Linux (16+)
***   SuSE Linux (12+)
***   Mint Linux (20+)
***   Kali Linux (2024.1+)

*** Supported architectures vary by OS / distribution. We try to support
*** every system architecture supported by the target.

*** Please report problems by opening a GitHub issue or Pull Request at: 
*** https://github.com/zerotier/install.zerotier.com
*** Please include the content of `/etc/os-release` for your distribution.

*** Detecting Linux Distribution

*** Detected Linux Mint, creating /etc/apt/sources.list.d/zerotier.list
Hit:1 http://mirror.plusserver.com/ubuntu/ubuntu noble InRelease
Hit:2 http://mirror.plusserver.com/ubuntu/ubuntu noble-updates InRelease                                                                                                                                                      
Hit:3 http://security.ubuntu.com/ubuntu noble-security InRelease                                                                                                                                                               
Hit:4 http://mirror.plusserver.com/ubuntu/ubuntu noble-backports InRelease                                                                                                                                                     
Ign:5 http://download.zerotier.com/'virginia debian InRelease                                                                                                                                                               
Hit:6 https://brave-browser-apt-release.s3.brave.com stable InRelease                     
Hit:7 https://packages.microsoft.com/repos/code stable InRelease                          
Err:8 http://download.zerotier.com/'virginia debian Release         
  404  Not Found [IP: 104.22.60.150 80]
Ign:9 https://fastly.linuxmint.io wilma InRelease
Hit:10 https://fastly.linuxmint.io wilma Release
Reading package lists... Done
E: The repository 'http://download.zerotier.com/'virginia debian Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
gpg is already the newest version (2.4.4-2ubuntu17).
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.

*** Installing zerotier-one package...
E: Malformed entry 1 in list file /etc/apt/sources.list.d/zerotier.list (URI parse)
E: The list of sources could not be read.
E: Malformed entry 1 in list file /etc/apt/sources.list.d/zerotier.list (URI parse)
E: The list of sources could not be read.

*** 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

Contents of /etc/apt/sources.list.d/zerotier.list

deb [signed-by=/usr/share/keyrings/zerotier-debian-package-key.gpg] virginiadebian/ main

Fixing package and update managers

Attempting to use the graphical package managers, update manager, or apt from CLI will no longer work after the failure of Zerotier to install.

Below are likely errors encountered in each application which remain unusable until the problem is rectified CLI:

$ apt update
E: Malformed entry 1 in list file /etc/apt/sources.list.d/zerotier.list (URI parse)
E: The list of sources could not be read.

Update Manager: Update-Manager

Software Manager: Software-Manager

Synaptic Package Manager: Synaptic-Package-Manager

Furthermore, viewing Software sources to attempt to rectify the problem does not show the rogue entry and may show an error too: Software-Sources

The only recourse to fix this problem is to remove the offending file using the console: sudo rm /etc/apt/sources.list.d/zerotier.list

See comment 4 below for a prefered alternative that overwites the offending file and resumes normal operation.

laduke commented 2 months ago

Thanks for writing this up. See https://github.com/zerotier/install.zerotier.com If you can figure out the fix and PR it, that'd be welcome.

Squelch commented 2 months ago

Thanks for the pointer, and I shall direct my efforts to the installer repositary going forward.

My fist concern was documenting the problem and providing a fix for package managers for ZeroTier users that are newcomers to Linux Mint and maybe unfamiliar with the OS.

I see that there is already an issue related to this problem #76 there. Investigations are already underway to find a fix for the correct target package.

Squelch commented 2 months ago

The patch to fix this issue has already been submitted by @jeremiah-k against the installer repositary. I have tested it on a separate VM and it correctly identifies and targets the correct Ubuntu Noble package for successful installation. I have provided a review and approval for the patch, and it has been merged.

At the time of this comment, the fix is not live. However, @jeremiah-k also provided a correctly targeted script invocation for use in the meantime.

Quote @jeremiah-k

curl -s https://raw.githubusercontent.com/zerotier/install.zerotier.com/3573e9c87522d0e459770df60ee424e92bcb9a68/htdocs/install.sh | sudo bash

Make sure you get the whole string, there's a copy button on the right side of the codeblock.

Squelch commented 2 months ago

The installer is now working correctly.