Failed to install zerotier

I am getting the following error when trying to install zerotier.

here is the command used to try to install it

curl -s 'https://raw.githubusercontent.com/zerotier/ZeroTierOne/main/doc/contact%40zerotier.com.gpg' | gpg --import && \  
if z=$(curl -s 'https://install.zerotier.com/' | gpg); then echo "$z" | sudo bash; fi

Out put

 curl -s 'https://raw.githubusercontent.com/zerotier/ZeroTierOne/main/doc/contact%40zerotier.com.gpg' | gpg --import && \  
if z=$(curl -s 'https://install.zerotier.com/' | gpg); then echo "$z" | sudo bash; fi
gpg: chave 1657198823E52A61: "ZeroTier, Inc. (ZeroTier Support and Release Signing Key) <contact@zerotier.com>" nĂŁo mudada
gpg: NĂşmero total processado: 1
gpg:              nĂŁo modificados: 1
 : comando nĂŁo encontrado
gpg: AVISO: nenhum comando fornecido.  A tentar adivinhar o que vocĂŞ quer dizer...
gpg: Assinatura feita qui 29 ago 2024 14:50:04 -03
gpg:                usando RSA chave 74A5E9C458E1A431F1DA57A71657198823E52A61
gpg:                emissor "contact@zerotier.com"
gpg: Assinatura correta de "ZeroTier, Inc. (ZeroTier Support and Release Signing Key) <contact@zerotier.com>" [desconhecido]
gpg: AVISO: Esta chave não está certificada com uma assinatura confiável!
gpg:          Não há indicação de que a assinatura pertence ao dono.
Impressão digital da chave primária: 74A5 E9C4 58E1 A431 F1DA  57A7 1657 1988 23E5 2A61
[sudo] senha para heitor:         

*** 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
bash: linha 301: [[: 21.3: erro de sintaxe: operador aritmético inválido (token de erro é ".3")
Atingido:1 http://sft.if.usp.br/ubuntu jammy InRelease
Obter:2 http://sft.if.usp.br/ubuntu jammy-updates InRelease [128 kB]                                                                                                                                                                         
Atingido:3 https://brave-browser-apt-release.s3.brave.com stable InRelease                                                                                                                                                                   
Obter:4 https://cli.github.com/packages stable InRelease [3.917 B]                                                                                                                                                                           
Atingido:5 http://sft.if.usp.br/ubuntu jammy-backports InRelease                                                                                                                                                                             
Err:4 https://cli.github.com/packages stable InRelease                                                                                                                                                                                       
  As seguintes assinaturas eram inválidas: EXPKEYSIG 23F3D4EA75716059 GitHub CLI <opensource+cli@github.com>
Atingido:6 https://packages.microsoft.com/repos/ms-teams stable InRelease                                                                                                                                                                    
Ign:7 https://mint-packages.c3sl.ufpr.br virginia InRelease                                                                                                                                                                                  
Atingido:8 https://packages.microsoft.com/repos/code stable InRelease                                                                                                                                                                        
Atingido:9 https://mint-packages.c3sl.ufpr.br virginia Release                                                                                                                                                                               
Atingido:10 https://dl.google.com/linux/chrome/deb stable InRelease                                                                                                                                                                          
Obter:11 http://sft.if.usp.br/ubuntu jammy-updates/main i386 Packages [690 kB]                                                                                                                                                               
Obter:12 http://apt.insync.io/mint victoria InRelease [5.544 B]                                                                                                                                                                              
Obter:13 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB]                                                                                                                                                                 
Obter:14 http://sft.if.usp.br/ubuntu jammy-updates/main amd64 Packages [1.988 kB]                                                                                                                                                            
Atingido:16 https://downloads.k8slens.dev/apt/debian stable InRelease                                                                                                                                                                        
Ign:17 https://releases.warp.dev/linux/deb stable InRelease                                                                                                                                                                                  
Obter:18 http://sft.if.usp.br/ubuntu jammy-updates/universe i386 Packages [730 kB]                                                                                                                                                           
Obter:19 http://sft.if.usp.br/ubuntu jammy-updates/universe amd64 Packages [1.123 kB]                                                                                                                                                        
Atingido:20 https://releases.warp.dev/linux/deb stable Release                                                                                                                                                                               
Ign:22 https://apt.datadoghq.com stable InRelease                                                                                                                                                                                            
Atingido:23 https://apt.datadoghq.com stable Release                                                                                                                                                                                         
Atingido:25 https://deb.tableplus.com/debian/22 tableplus InRelease                                                                                                                                                
Obter:26 https://pkgs.tailscale.com/stable/ubuntu jammy InRelease                                                                                                              
Atingido:27 https://ppa.launchpadcontent.net/agornostal/ulauncher/ubuntu jammy InRelease                                                          
Atingido:28 https://ppa.launchpadcontent.net/fish-shell/release-3/ubuntu jammy InRelease
Baixados 4.804 kB em 3s (1.921 kB/s)
Lendo listas de pacotes... Pronto
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://brave-browser-apt-release.s3.brave.com stable InRelease' doesn't support architecture 'i386'
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://cli.github.com/packages stable InRelease: As seguintes assinaturas eram inválidas: EXPKEYSIG 23F3D4EA75716059 GitHub CLI <opensource+cli@github.com>
W: Falhou ao buscar https://cli.github.com/packages/dists/stable/InRelease  As seguintes assinaturas eram inválidas: EXPKEYSIG 23F3D4EA75716059 GitHub CLI <opensource+cli@github.com>
W: Falhou o download de alguns ficheiros de Ă­ndice. Foram ignorados ou os antigos foram usados em seu lugar.
Lendo listas de pacotes... Pronto
Construindo árvore de dependências... Pronto
Lendo informação de estado... Pronto        
gpg já é a versão mais recente (2.2.27-3ubuntu2.1).
0 pacotes atualizados, 0 pacotes novos instalados, 0 a serem removidos e 1 nĂŁo atualizados.
main: linha 247: [[: 21.3: erro de sintaxe: operador aritmético inválido (token de erro é ".3")
main: linha 249: [[: 21.3: erro de sintaxe: operador aritmético inválido (token de erro é ".3")
Unsupported distribution linuxmint 21.3

You have a compound problem:

  1. “Unsupported distribution linuxmint 21.3”

And:

  1. A multi-arch package is in a broken state.

(This often happens when dpkg --add-architecture i386 is used to install libraries for old binary applications.)

You must resolve both problems before installing ZeroTier.

Installing on Linux Mint 21.3 added this twist:

The install.zerotier.com script does not work for release numbers like xx.y!
To do a first-time zerotier install on a host running Mint 21.3 using the curl cmd and install script below, I had to modify the /etc/os-release file to
fake a release number of Mint 21:

NAME=“Linux Mint”
#VERSION=“21.3 (Virginia)”
VERSION=“21 (Virginia)” # <—
ID=linuxmint
ID_LIKE=“ubuntu debian”
#PRETTY_NAME=“Linux Mint 21.3”
PRETTY_NAME=“Linux Mint 21” # <—
#VERSION_ID=“21.3”
VERSION_ID=“21” # <—
…

I suspect only one of those changes would be sufficient (probably VERSION_ID)
but I was in a hurry and did not experiment to find out :slight_smile:

1 Like

Good catch. The bug is near line 306 in the installation script, where the -gt chokes on the non-integer MINT_VERSION.

	if [[ "$VERSION_ID" -gt "$MAX_SUPPORTED_MINT_VERSION" ]]; then
		write_apt_repo $ID $MAX_SUPPORTED_MINT_VERSION $ZT_BASE_URL_HTTP $MAX_SUPPORTED_MINT_VERSION_NAME
	else 
		write_apt_repo $ID $VERSION_ID $ZT_BASE_URL_HTTP ${MINT_CODENAME_MAP[${VERSION_CODENAME}]}
	fi

Testing for Mint in the same way that Ubuntu is tested might be a solution.