How do I check if I have a 32-bit or a 64-bit OS?

  • I downloaded and installed Ubuntu from the official site. However, I don't know if I installed the 32-bit or 64-bit version.

    In Windows 7 I could right click My Computer and it listed which version it was.

    Is there an easy way to check in Ubuntu?

    Installation architecture and kernel architecture are two different things. For example I implemented debian multiarch support via`dpkg --add-architecture amd64` and installed some `amd64` packages in my 32 bit Ubuntu 16.04. Now I run 32 bit installation with 64 bit kernel without problem. So while `dpkg --print-architecture` prints `i386`, `uname -m` prints `x86_64`. Refer to https://wiki.debian.org/Multiarch/HOWTO (it's a tricky process)

  • Rinzwind

    Rinzwind Correct answer

    9 years ago

    I know at least 2 ways. Open a terminal(Ctrl+Alt+T) and type:

    1. uname -a

      Result for 32-bit Ubuntu:

      Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux

      whereas the 64-bit Ubuntu will show:

      Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

      Shorter version:

      $ uname -i
      x86_64
      

      or

    2. file /sbin/init

      Result for 32-bit Ubuntu:

      /sbin/init: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped

      whereas for the 64-bit version it would look like:

      /sbin/init: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped

      Same for systems using systemd (16.04):

      file /lib/systemd/systemd

      Result for 64-bit:

      /lib/systemd/systemd: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=54cc7ae53727d3ab67d7ff5d66620c0c589d62f9, stripped

    Method 2, which consists of "sniffing" the (binary) content of a widely available executable, is quite indirect and awkward. While it works for most setups, the mere *presence* of a 64bit executable should not be a reliable way of detecting the *running* OS architecture. Specially when you consider `multiarch`, `ia32_libs` and, specially in your `init` example, `upstart`

    You are probably right, but Method 1 displayed me a `i686` neither of 32 or 64 output was displayed for me

    @aleks that is 32 bit (see the highlighted text: ` i686 i686 i386` in the answer)

    it is 32 bit, I have used the second method, but the first did't show me anything that looked like `i386` :) but your answer helped. thanks a lot

    `# file /sbin/init` -- `/sbin/init: symbolic link to `upstart'` -- `# file /sbin/upstart` -- `/sbin/upstart: ELF 64-bit LSB shared object, x86-64...`

    To method 1: You get the item highlighted with bold letters also by just running `uname -i` or `uname --hardware-platform`. No need for `uname -a` with lots of confusing stuff. The other i686 items are displayed by `uname -m`/`uname --machine` (first item) and `uname -p`/`uname --processor` (second item), but I don't know how their meaning differs from each other. On my machine, all of the three display "i686"...

    Exactly, uname shows only one i686 on my 10.10 system, then i686 for all three fields after upgrading to 14.04 (I didn't check anywhere in between). Whereas, I think checking `/sbin/init` is guaranteed to work (at least while we still have it--I'm thinking that goes away with systemctl). If init is 32-bit, you have a 32-bit system.

    @Auspex trough the years (from Unix on) it has been pretty weird to get this answered correctly. I agree init is the best but also that it will dissappear :D Lucky for us 32-bit is almost dead :-X

    In my Ubuntu 16.04 /sbin/init is a symbolic link to /lib/systemd/systemd. `file /lib/systemd/systemd` worked fine.

    what if I get armv7l from uname -i? Is that 32 or 64 bit?

    ARMv7 (and below) is 32-bit. ARMv8 introduces the 64-bit instruction set.

    I don't know if you want to add this or not, but if you pass the `-L` flag to `file` to make `file` follow symbolic links automatically--that is, run `file -L /sbin/init`--then it will work on all versions of Ubuntu. It will work whether or not `/sbin/init` is a symlink (and whether it's upstart or systemd).

    For `Raspebrry Pi Zero W Raspbian Stretch` method #1 returns: `uname -a` --> `Linux raspberrypi 4.9.59+ #1047 Sun Oct 29 11:47:10 GMT 2017 armv6l GNU/Linux` or `uname -i` --> `unknown`. Method #2 returns `file /lib/systemd/systemd` --> `ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=8c1f19d39febf97f068d5e2726b345ad348030b6, stripped`

  • Ubuntu 12.04+ with Unity

    • Hit Command(mac) or Window key.
    • Type Details, and select "Details" icon
    • Read "OS type" field
    • 64 bit OS will read "64-bit"

    enter image description here

    Alternative to get the above screen:

    • click System Menu (gear at top right corner)
    • click "About this Computer"

    I know the terminal responses are good but I guess this is the GUI answer. :)

    Ubuntu 11.04 with Unity

    • Hit Command(mac) or Window key.
    • Type System info, and select System Info icon
    • Read "OS type" field
    • 64 bit OS will read "64-bit"

    +1: The GUI way is preferred over terminal commands for a user that is used to Windows and specifically asked for an *easy* way.

    Also, another (GUI) way to get to the same screen: `System Menu (top right corner, near the clock) -> System Settings -> Details`

    With an easy way most definitely in mind: please, anyone running older Ubuntus, provide your GUI equivalent! Especially for Lucid Lynx (as the LTS is supported till 2015 and hence might well be running on people's hand-me-down laptops.)

    @J-P: For older Ubuntus, such as Lucid Lynx, the easiest GUI way I know of is Gnome's **System Monitor**. Its `System` tab shows the architecture.

    The GUI window is lovely, but imagine if you will for a minute if your running the server edition without the GUI installed?

    The GUI way is usually very nice but it's also very likely that in 1 or 2 years it won't work like that anymore. On the other hand the CLI way will likely still work after many years. Unfortunately the CLI way has a barrier to entry though.

    For 17.10 open "Settings" instead and choose Details in the left column.

  • A very easy and short way is:

    Open the Terminal, write the following and press Enter.

    getconf LONG_BIT
    

    The resulting number (in my case 64) is the answer.

    terminal - getconf LONG_BIT

    On my 32 bit system, this gives the correct answer as well. Of all the command listed in various answers, the output of this one is the most straightforward.

    Except: $ getconf LONGBIT getconf: Unrecognised variable `LONGBIT'

    You're missing the underscore @Auspex LONG_BIT

    @Michael Damn, so I was. I don't know how I managed that, and having upgraded those two machines to 64 bit in the past month, it's pretty much moot now ;-) Thanks, anyway!

  • Reference: How Do I Know if I’m Running 32-bit or 64-bit Linux?

    Use the command:

    uname -m
    

    You will typically get:

    i686
    

    for 32-bit (or possibly i586 or i386), and:

    x86_64
    

    for 64-bit.

    hard to believe that /etc/release doesn't seem to mention it.

    `uname -mpi` gives all of the things mentioned in `uname -a`, even though they are usually all the same...

  • Open terminal and try the arch command. If its output is x86_64 then it's 64 bit. If it says i686, i386, etc. then it's 32 bit.

    However, the best way to determine the architecture is to run the arch command and google the output.

    `arch` is just the same as `uname -m` (even stated in the manpage). ;-)

    On my computer (Ubuntu 9.04), the arch command doesn't seem to exist. So I'd say uname -m is more reliable.

    @JonathanSternberg: it was added a few months later, developed by the same authors of `uname` and included in the same `coreutils` package. So from Ubuntu 10.04 onwards both commands are available.

  • dpkg --print-architecture command will display whether you have installed a 32 bit or 64 bit Ubuntu OS.

    On 64 bit systems

    $ dpkg --print-architecture
    amd64          
    

    On 32 bit systems

    $ dpkg --print-architecture
    i386
    

    `

    The only method so far to correctly detect a 32bit OS running a 64bit kernel.

  • Architecture Checker

    enter image description here

    Download Link

    1. Download It
    2. Extract it.
    3. Mark the file Architecture Checker.sh Executable and run it.

    The script is basically this:

    #!/bin/bash
    ARCH=$(uname -m)
    if [ "$ARCH" = "i686" ]; then
     zenity --info --title="Architecture Checker" --text="Your Architecture is 32-Bit"
    fi
    if [ "$ARCH" = "x86_64" ]; then
     zenity --info --title="Architecture Checker" --text="Your Architecture is 64-Bit"
    fi
    

    This will need to be in a executable text file, and zenity will need to be installed.

    Honestly need to download and extract that 8 line file? Just put it in a code block here.

    and when the output of `uname -m` is not `i686`... nice use of `zenity`, could use `notify-send` though.

  • Go to the System Settings and under the System section, hit Details. You will get every detail including your OS, your processor as well as the fact whether the system is running a 64-bit or a 32-bit version.

    That seems wonderful. But I don't know how to "Go to the System Settings". (BTW) I'm using 12.4 MATE.

  • Open the Ubuntu Software Center and search for lib32. If that turns up any results, you are on a 64-bit install (the results are compatibility libraries for running 32-bit applications on a 64-bit install).

    Not exactly a better answer, but at least it doesn't require a terminal... ;-)

    Edit

    I found an even easier one: open Help -> About Mozilla Firefox and you will see it right there... ;-)

    At the bottom it displays the "user agent string", e.g. on my 64-bit system:

    Mozilla/5.0 (X11; U; Linux x86_64; nl; rv:1.9.2.12) Gecko/20101027 Ubuntu/10.10 (maverick) Firefox/3.6.12
    

    or on my 32-bit system:

    Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.9.2.12) Gecko/20101027 Ubuntu/10.10 (maverick) Firefox/3.6.12
    

    x86_64 is 64-bit, i686 is 32-bit

    (But this is still not the answer that should be there ;) )

    Pure GUI, sure, but quite a fragile one... packages whose names (*or descriptions*) contain `lib32` is surely *not* a reliable way of detecting architecture.

  • The power button (top-most, extreme right) has an "About this Computer" option. :)

    not on 12.04 LTS

License under CC-BY-SA with attribution


Content dated before 6/26/2020 9:53 AM