How to download actuall deb file automaticly?


i lately switched my obsidian installation from flatpak to deb package.
I always writing a shell script of my installations, so that I can easily set up on a new PC.

For installing obsidian from deb file I write this little script:

wget -O obsidian.deb
sudo gdebi -n obsidian.deb
rm obsidian.deb

With this implementation I am not really satisfied, because the version number is part of the link, so there is always used exactly this version. I would prefer to always getting the newest version, but I can’t find a link, that always directs to the newest deb file.

Is there an easy way the get the link to the newest deb file?
(Parsing the website wouldn’t be to unstable in my opinion and the GitHub API needs credentials, which seems too cumbersome to me.)

You can reuse the version checking pattern used by the Obsidian flatpak:

You can do this for example:


set -oeu pipefail

DOWNLOAD_URL="$(wget -q "${RELEASES_URL}" -O - | jq -r '.assets[] | select(.name | endswith("_amd64.deb")) | .browser_download_url')"

wget "${DOWNLOAD_URL}" -O "${PACKAGE}"

sudo gdebi -n "${PACKAGE}"
rm "${PACKAGE}"

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.