Fetching latest Kubo progromatically

Hi!

I’m trying to make a bash script to install the latest Kubo, make a systemd service for it, and start running a node that way. In the docs for installing Kubo (source) it explicitly mentions the current release number in the wget command (for example, as of this writing, the wget is to https://dist.ipfs.tech/kubo/v0.14.0/kubo_v0.14.0_linux-amd64.tar.gz ). I’d like the script to know how to fetch the latest version as opposed to freezing it on 0.14.0. Is there any way to hit a “latest” api? Something like wget -r --no-parent -A '*_linux-amd64.tar.gz' https://dist.ipfs.tech/kubo/latest/?

2 Likes

Well https://dist.ipfs.tech/kubo/versions contains the latest version, so from there you can do:

x=$(curl https://dist.ipfs.tech/kubo/versions);v=${x#*$'\n'};curl "https://dist.ipfs.tech/kubo/$v/kubo_${v}_linux-amd64.tar.gz" -O

Expanded out:

x=$(curl https://dist.ipfs.tech/kubo/versions);
v=${x#*$'\n'};
curl "https://dist.ipfs.tech/kubo/$v/kubo_${v}_linux-amd64.tar.gz" -O

Version file is stored in x, then v contains the latest non-rc version. From there curl is used again to download the actual package.

wget example:

x=$(wget -qO- https://dist.ipfs.tech/kubo/versions);
v=${x#*$'\n'};
wget "https://dist.ipfs.tech/kubo/$v/kubo_${v}_linux-amd64.tar.gz"
1 Like