Download Linux distributions from a terminal using the OSGET utility

What is the first thing you do when you want to install any Linux distribution? You go to the respective page to Download the ISO file. But If I say you can download the ISO file directly from a terminal without getting your hand dirty.

The conventional method to download ISO is best when you have access to Graphical User Interface (GUI), but what to do when you just have a command-line interface? In this situation, you seek another system and get back with an ISO image, quite awful aha!

If you are too possessive with a command line, then you must try it.

What is OSGET utility?

OSGET is a command-line application to download ISO from a terminal. Moreover, it has the capability to searchlist OSupdate repositories to fetch the latest version of os, and transmission-CLI support included for torrent links.

Syntax

The Basic syntax of OSGET is as follows.

 $ osget [options] [operatingsystem] [operatingsystem2] 
  • [options]: use for listing Linux OS, download location, etc.
  • [operatingsytem]: mention the distribution name.
  • [operatingsystem2]: capable of downloading multiple ISO.

If you just hit osget on a terminal, it will show you a list of options and an example to download OS.

Download & Install OSGET

I’m assuming git is already installed in your system. If it is missing, please install it before proceeding ahead.

The steps to install OSGET is quite simple, open a terminal and type the following command to download the installer script.

$ git clone https://github.com/gnarlin/osget.git
$ cd osget
$ ls

Once you pass the ls command, it shows you a list of files available in the osget directory.

Debian & Ubuntu-based distribution can use the .deb package to Install OSGET, pass the following command to install, and make sure to replace X.X with a file version.

$ sudo apt install ./osget_X.X_all.deb
$ sudo dpkg -i osget_X.X_all.deb

Other distributions can use the below script.

$ sudo ./install.sh --install

Uses of OSGET in Linux

Once the installation is over you can use OSGET to list, search, download, update, and modify osget.conf.

List Linux distributions using OSGET

You can list out all the available Linux Distributions using –list or -l options. When you invoke the below command, it will show you a list of operating systems, including different releases and versions.

$ osget ---list
$ osget --list | less
osget --list to display list of os
osget –list to display the list of os

Search Linux distributions using OSGET

As of now, 180+ Linux distributions is available to download, including various releases & version. Instead of listing out, you can use search options to find specific releases or distributions like a below output

$ osget --search manjaro
$ osget -s manjaro-xfce
Search Linux distrubutions using OSGET
Search Linux distributions using OSGET

Download Linux distributions using OSGET

As far as you know, the iso name you can start the downloading. If you are not sure about the ISO name, please use the above command, and once you get the proper file name, type the below command and ensure to replace the ISO filename; else, end up with Debian ISO.

$ osget debian-11.0.0-amd64-netinst

You can also provide a specific directory to download an ISO image. For that, you can use –directory or -d.

$ osget -d ~/Downloads/ debian-11.0.0-amd64-netinst

Although you can change the default Download location to store ISO files, you need to modify the osget.conf file.

$ sudo nano /etc/osget/osget.conf

Once you open the file, search for “DOWNLOAD_DIR=” if it is commented, then please remove # and add the new path location, save and close.

Change the default location
Change the default location

By default, OSGET uses wget utility to download a file. If a magnet link is available for the corresponding ISO, then OSGET will use transmission-CLI to manage torrent.

Update OSGET to fetch the latest resource from an online repository

A newer release of ISO can be found only if you update the OSGET. To update OSGET, use –update or -u with sudo privileges.

$ sudo osget -u
osget -update command output
osget –update command output

Uninstall OSGET

You can use the same script to uninstall OSGET from your system. Go to the directory where the script is present and paste the below code.

$ sudo ./install-sh --uninstall

Wrap up

Finally, you can download the ISO file using a command line. There are many features that can be implemented to make it robust and scalable. While using it, I found some errors like mirror down, and there is no alternative way to rescue it.

I’m not sure whether OSGET supports bandwidth controlthread for better usability.

Anyway, special thanks to Freyr Ólafsson, who has started this project, and I believe if you guys can support him to develop an application, that would be great.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments