DEV Community

Alfonso Strotgen
Alfonso Strotgen

Posted on

3 1

Download the latest release file from a Github repo

I have a simple post installation bash script for the software I use in my personal computer. I usually do a fresh install of Ubuntu / Pop!_OS for every new major release, so this file comes in very handy.

For the most part, this script consists of the typical sudo apt install ..., but there are some applications that are only distributed in .deb or similar packages. For example, to use Anki, the open-source flashcard program, you have to download a compressed file from their official Github repo and install it from source. To download the latest version, I use the following command:

wget -qO - https://api.github.com/repos/ankitects/anki/releases/latest \
| grep browser_download_url \
| grep amd64 \
| cut -d  '"' -f 4  \
| wget -cqi - -O Anki.tar.bz

To use this command, change accordingly:

  • Change ankitects/anki for the repo you need.
  • Change amd64 for the file name you need. In my case, the Linux files in the Anki repo have amd64 in their name. You could use deb, dmg, etc.
  • Change Anki.tar.bz for the name of the file you want. This is useful when the file name includes the version. I use this for running other commands as a next step, for example, uncompressing the file.

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay