[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

This is an old revision of the document!


Checking a Slackware Version

To check which version of Slackware we have two means that are widely used and practical, the first is to read the slackware-version file, which is located in the /etc/directory. For this you can run the cat command indicating the input file, or simply open it with your favorite editor.

Slackware Version Archive

$ cat /etc/slackware-version
Slackware 14.2 

The slackware-version file will also be updated if you upgrade your version. Sure.

os-release Archive

The second method is the most complete, there is a file that is present in practically all Linux distributions, say it is a POSIX standard to have this file indicating a lot of basic system information.

This file is called os-release and is also located in /etc/. To make your reading you can use the same methods as above with the cat command or your favorite editor.

$ cat /etc/os-release
NAME=Slackware
VERSION="14.2"
ID=slackware
VERSION_ID=14.2
PRETTY_NAME="Slackware 14.2"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:slackware:slackware_linux:14.2"
HOME_URL="http://slackware.com/"
SUPPORT_URL="http://www.linuxquestions.org/questions/slackware-14/"
BUG_REPORT_URL="http://www.linuxquestions.org/questions/slackware-14/" 
There is a lot of very valuable information in this file. They can be easily used in your Shell script using the source command or. to upload this information. A very simple example using bash:
$ source /etc/os-release
$ echo "Distribuição: $NAME"
Distribuição: Slackware
$ echo "Versão: $VERSION"
Versão: 14.2
$ echo "URL SITE: $HOME_URL"
URL SITE: http://slackware.com/

Unix Way

Or you can use a more UNIX way of handling things using old rice and beans … So you can also collect the necessary data. For this we execute a pipeline line storing inside a variable called version as an example.

$ version=$(grep '^VERSION=' /etc/os-release | cut -d '=' -f 2 | sed 's/"//g')
$ echo "$version"
14.2

Sources

 howtos:misc:checking_a_slackware_version ()