Find the version of the Linux distribution installed in your system

This post is a note to myself since I have come across the need of verifying the version of the Linux distribution installed on my system several times till date.

Method 1:

The standard technique I have been using till date to check the version of the Linux OS installed on my system was to execute: cat /etc/issue.

If you are using a customized version of the Linux based OS, the file, /etc/issue will probably display a custom message based on the OS distribution.

Method 2:

If you know that the Linux OS installed in your system is a variant of RHEL or Fedora, say CentOS, the command, cat /etc/redhat-release will provide the human readable release name of the installed OS followed by the version and the code name of the release.

If you are using other variants of the Linux OS, there is a high probability that the execution of the command, cat /etc/*-release may provide you with the necessary details.

Method 3:

If you are using a recent version of Linux distribution, the command: lsb_release -i -r will display the Distribution name (-i) and the Release number (-r).

On a side-note, if you are just looking for the version of the kernel and gcc that were used to build the release: cat /proc/version will provide the details.


References:
1. http://serverfault.com/questions/89654/what-version-of-rhel-am-i-using
2. http://serverfault.com/questions/188037/how-do-i-determine-what-version-of-red-hat-enterprise-linux-my-server-is-running
3. http://www.cyberciti.biz/faq/find-linux-distribution-name-version-number/
4. http://unix.stackexchange.com/questions/124667/how-to-know-which-linux-and-which-version-i-am-using

Advertisements

How did I solve Redis Installation failure in CentOS 6.5?

I decided to use Redis1 as a session store for my ExpressJS2-NodeJS3-Couchbase4 application.

The first step towards this was to download, compile and install Redis5.

The compressed tar.gz redis package is available at http://redis.io/download. I downloaded this package and extracted it in /opt directory. The installation page5 suggests executing the make command. In my case, the command failed with the below error:

....
make[3]: gcc: Command not found
make[3]: *** [net.o] Error 127
make[3]: Leaving directory `/opt/redis-2.8.9/deps/hiredis'
make[2]: *** [hiredis] Error 2
make[2]: Leaving directory `/opt/redis-2.8.9/deps'
make[1]: [persist-settings] Error 2 (ignored)
    CC adlist.o
/bin/sh: cc: command not found
make[1]: *** [adlist.o] Error 127
make[1]: Leaving directory `/opt/redis-2.8.9/src'
make: *** [all] Error 2

The solution for the above problem was to install gcc and make using the command: yum install gcc make.

Upon completion of the installation, I triggered, make once more. This time around, the make command failed and the errors indicated that few header files were missing.

make[1]: Entering directory `/opt/redis-2.8.9/src'
    CC adlist.o
In file included from adlist.c:34:
zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
zmalloc.h:55:2: error: #error "Newer version of jemalloc required"
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/opt/redis-2.8.9/src'
make: *** [all] Error 2

After scouting Internet for solutions67, I finally ended up with the below solution8.

cd /opt/redis-2.8.9/deps
make
cd ..
make

Compiling the contents of the deps (dependencies) folder before the issuing, make in the /opt/redis-2.8.9/ solved the problem.

If the make is successful, the redis-server binary would end up in the src folder (in my case, it would be /opt/redis-2.8.9/src). The server can be started using:

src/redis-server

Its time to start creating a start-up script (daemon process) and configure it to start during the runlevels 2, 3, 4 and 5.


References: