Friday 9 April 2010

How to know your debian/ubuntu version and architecture

Which Ubuntu version do you have?

$ cat /etc/issue
Ubuntu 9.04


Which debia?

$ cat /etc/debian_version
5.0


Take all the info of your linux installation:

In a 32 bits:
$ uname -a
Linux pmg-linux 2.6.28-18-generic #60-Ubuntu SMP Fri Mar 12 04:40:52 UTC 2010 i686 GNU/Linux


If your architecture is 64 bits you should see the "x86_64"

$ uname -a
Linux pmg64_linux 2.6.26-2-amd64 #1 SMP Thu Nov 5 02:23:12 UTC 2009 x86_64 GNU/Linux


Another way of taking info:

$ cat /proc/version
Linux version 2.6.28-18-generic (buildd@rothera) (gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4) ) #60-Ubuntu SMP Fri Mar 12 04:40:52 UTC 2010

3 comments:

Anonymous said...

Thanks.

To know easier if the installed Ubuntu is of 32 or 64 bits:
uname -m
If it shows i686 or i386 it means 32 bits.
If it shows x86_64 it means 64 bits.

If the CPU is of 32 bits Ubuntu must be of 32 bits.
If the CPU is of 64 bits it can work in 64 or 32 bits. So we can choose: Ubuntu can be of 32 bits or of 64 bits.

To know if the CPU is of 32 or 64 bits:
a) grep -w lm /proc/cpuinfo
If we see lm in red is of 64 bits. Otherwise is of 32 bits.
b) sudo lshw | grep “description: CPU” -A 12 | grep width
It says clearly what we want to know.

Anonymous said...

Another way to know if the installed Ubuntu is of 32 or 64 bits:
getconf LONG_BIT

Anonymous said...

Thanks. A command for both informations here:

We can also run ...
lscpu
… and have a look just to the first 2 lines of the output:
“Architecture” informs about the installed Linux version: "i686" represents one of 32 bits, while "x86_64" stands for a 64 bits one.
"CPU op-mode(s)" informs about the CPU. "32-bit" represents one of 32 bits, while "32-bit, 64-bit" or "64-bit" stands for a 64 bits one.