Free tech support / small logo


What version of Linux am I running?

I have a Virtual Private Server or a dedicated server running Linux, but I'm not sure which version of Linux (Fedora, CentOS, Debian, etc.) the server is running. How do I find out?


Dave's Answer:

Your hosting provider, of course, should have told you what version of Linux you were using when they first set up the dedicated server or the Virtual Private Server for you. But if you don't remember, it's surprisingly non-intuitive to try and figure out which version of Linux your machine is running.

Unlike Windows or other operating systems that display the name of the operating system when you first sign on to the computer (Windows XP Home, Windows XP Pro, Windows Vista, Windows 7, etc.), a remote connection to a Linux machine won't automatically tell you what type of Linux you are using.

For the purposes of this article I'm assuming that you're connected to your Virtual Private Server or your dedicated server via a shell connection, one that lets you type commands and view the output. (This would normally be a telnet connection, or, more safely, a "secure shell" or SSH connection.)

When you initially use SSH to open a connection to your server, you might see a greeting like this:

ssh initial screen

But, you can find out what version of Linux your server is running, by executing this command:

cat /etc/*release*

In Linuxese, this means, "Show me the contents of all files in the "/etc/" directory that have the string "release" somewhere in their names." If you type that command, you should get output something like this:

cat release output

You can ignore any message like "cat: /etc/lsb-release.d: Is a directory" -- this just means that the command found an item in the "/etc/" directory that had "release" in its name -- "lsb-release.d" -- but it's a directory, so "cat" cannot show you the contents. Instead, "cat" displayed to me the contents of a file that happened to be named redhat-release, and that file shows that this machine is running "CentOS release 5.4 (Final)".

On machines running other distributions of Linux (also called other "distros", or sometimes "flavors"), you will get something different. On Suse Linux, the output will be something like:


SUSE LINUX 10.0 (X86-64) OSS
VERSION = 10.0

On Fedora Linux the output might say:


Fedora release 8 (Werewolf)

On Ubuntu it might look like:


DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=7.10
DISTRIB_CODENAME=gutsy
DISTRIB_DESCRIPTION="Ubuntu 7.10"

In addition, you can run the command

uname -a
to obtain output like the following:

uname output

Of these pieces of information, "2.6.18-028stab062.12" refers to the kernel version (the kernel refers to what could be considered the "heart" of the operating system, the software at the core of Linux without which it could not run at all). "SMP" stands for "symmetric multi-processing" and indicates that the machine includes two or more processors to help run programs faster. (Although keep in mind that on a Virtual Private Server, you're sharing those CPUs with other users.) "Thu Jun 25 20:03:10 MSD 2009" is the current date, and "i686 athlon i386" refers to the type of CPU (not the specific processor on your machine, but the CPU "architecture" or category of CPU that this type of Linux was built to run on).

If someone troubleshooting a problem for you asks you for "what type of Linux" you're running, most likely they are referring to the distro, which you can determine with "cat /etc/*release". But it can't hurt to include the output of "uname -a" as well.

Bennett Haselton is a technology and political blogger who can answer other questions besides this one, like how to bypass/disable the St. Bernard Internet filter.









Subscribe!
Never miss another Q&A article! Click to subscribe: Add to Google Reader Add to My Yahoo! Subscribe in NewsGator RDF XML
Comments

Wow, I've been reading this site for a few days and only just noticed that it's supposed to be a whiteboard!

The site's great but I always thought it was supposed to look like a (big) white page. Then I noticed the edges were quite thick, and, scrolling down, came to these strange shapes on the bottom. I couldn't make head or tail of them. The black thing looked like some sideways tire or button and then suddenly the whole thing snapped into focus as I realized the other things were dry-erase markers.

I guess everyone who's asked Dave a question figured it out long ago.

Posted by: Shambhu at December 11, 2009 4:13 PM

Shambhu, thanks! When we were designing it I was tempted to pay my developer to write some code so you could pick up the markers and scribble on the page, but decided no-one would ever notice or try it. :-)

Posted by: Dave Taylor at December 11, 2009 9:49 PM

I have something to say, now that you mention it, but ...
Starbucks coffee cup I do have a lot to say, and questions of my own for that matter, but first I'd like to say thank you for all your efforts on this Web site by buying you a cup of coffee!

I do have a comment, now that you mention it!











Remember personal info?


Please note that I will never send you any unsolicited email. Ever.

While I'm at it, please note that by submitting a question or comment you're agreeing to my terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site.









Recent Entries


Search
I Need Help!
Need Help? Ask Dave Taylor!

Linux Journal: Free Issue!


© 2002 - 2012 by Dave Taylor. All Rights Reserved.

Note: This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this web site or on any linked site.

[whiteboard marker tray]
"Ask Dave Taylor®" is a registered trademark of Intuitive Systems, LLC.