Can my system run 64 bit linux

How to determine whether a given Linux is 32 bit or 64 bit?

How can I know from this that the given OS is 32 or 64 bit? This is useful when writing configure scripts, for example: what architecture am I building for?

21 Answers 21

Try uname -m . Which is short of uname —machine and it outputs:

x86_64 ==> 64-bit kernel i686 ==> 32-bit kernel 

Otherwise, not for the Linux kernel, but for the CPU, you type:

Under «flags» parameter, you will see various values: see «What do the flags in /proc/cpuinfo mean?» Among them, one is named lm : Long Mode (x86-64: amd64, also known as Intel 64, i.e. 64-bit capable)

Or using lshw (as mentioned below by Rolf of Saxony), without sudo (just for grepping the cpu width):

lshw -class cpu|grep "^ width"|uniq|awk '' 

Note: you can have a 64-bit CPU with a 32-bit kernel installed.
(as ysdx mentions in his/her own answer, «Nowadays, a system can be multiarch so it does not make sense anyway. You might want to find the default target of the compiler»)

grep flags /proc/cpuinfo only tells you wether the CPU is 64bit. As I understand the question it was about the OS. uname -m only tells me «i686».

I have a 32 bit kernel on 64 bit hardware and get «x86_64» from ‘uname -m’ (on Debian). The man page for uname says that -m shows the machine hardware name, so that seems correct.

If I have a 32-bit kernel running on a 64-bit machine/ processor, what would uname -i , uname -p and uname -m show?

@JavierNovoaC. tm (Thermal Monitor) indicates Automatic clock control. It has nothing to do with distinguishing a 32-bit processor. In fact, lm (long mode) is present if and only if you have a 64-bit CPU. So that’s why you should only rely on lm. otherwise the answer given by Thomas Watnedal is the best. This answer is just wrong and has misled many people plz moderators do something about it.

If you were running a 64 bit platform you would see x86_64 or something very similar in the output from uname -a

To get your specific machine hardware name run

which returns either 32 or 64

That means the CPU is 64-bit, but you’ve only installed a 32-bit operating system upon it, even though you could have used a 64-bit one.

Читайте также:  Utorrent on linux mint

Steve Kemp is right, so be careful (Mac OS X 10.5 on 2009 MacBooks comes to mind, where the OS is 32-bit but its capable of running 64-bit apps)

The uname -m is not useful for the QP’s configure as it can give the wrong result. The getconf LONG_BIT get the default bit size of the C library which may not be the correct size for a specified, by CC , compiler.

getconf LONG_BIT may provide 32 ig it has been built as a 32 bit application (typically 64 bit kernel running a 32 bit userland).

lscpu will list out these among other information regarding your CPU:

Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit . 

Outputs the physical capabilities of the CPU, useful, but not reliable for the current userspace of the current OS.

Totaly wrong. The question is what OS is running. 42 upvotes? I would spend a down vote but it would drown.

Another useful command for easy determination is as below:

I guess it all depends on what the questioner means by «64-bit» — it used to mean the natural size of integers, but it’s now often used to mean the addressing size instead.

but is twice as fast to type

This returns the process types that the kernel can support. It is possible and even reasonable to run a 32 bit userspace on a 64bit kernel.

I was wondering about this specifically for building software in Debian (the installed Debian system can be a 32-bit version with a 32 bit kernel, libraries, etc., or it can be a 64-bit version with stuff compiled for the 64-bit rather than 32-bit compatibility mode).

Debian packages themselves need to know what architecture they are for (of course) when they actually create the package with all of its metadata, including platform architecture, so there is a packaging tool that outputs it for other packaging tools and scripts to use, called dpkg-architecture. It includes both what it’s configured to build for, as well as the current host. (Normally these are the same though.) Example output on a 64-bit machine:

DEB_BUILD_ARCH=amd64 DEB_BUILD_ARCH_OS=linux DEB_BUILD_ARCH_CPU=amd64 DEB_BUILD_GNU_CPU=x86_64 DEB_BUILD_GNU_SYSTEM=linux-gnu DEB_BUILD_GNU_TYPE=x86_64-linux-gnu DEB_HOST_ARCH=amd64 DEB_HOST_ARCH_OS=linux DEB_HOST_ARCH_CPU=amd64 DEB_HOST_GNU_CPU=x86_64 DEB_HOST_GNU_SYSTEM=linux-gnu DEB_HOST_GNU_TYPE=x86_64-linux-gnu 

You can print just one of those variables or do a test against their values with command line options to dpkg-architecture.

I have no idea how dpkg-architecture deduces the architecture, but you could look at its documentation or source code (dpkg-architecture and much of the dpkg system in general are Perl).

Источник

How do I know that my CPU supports 64bit operating systems under Linux?

Once you have checked the flags, then install the kernel package. Debian and Ubuntu, can run a 64bit kernel with a 32 bit userland. Installing the kernel is quick. Do not remove the old 32bit one, as you may need to go back to it.

Читайте также:  Linux intel 3945abg driver

5 Answers 5

I think the easiest way is by:

This answer is the best. It shows you an explicit «32-bit» or «64-bit». I don’t see why people choose the other answer over this one. You don’t even need to grep anything. Just doing lscpu is so simple. If they don’t have the lscpu command then I could see why they voted for the other one.

The command that is the most portable across the largest variety of platforms is arguably the most useful.

Find ‘lm’ flag. If it’s present, it means your CPU is 64bit and it supports 64bit OS. ‘lm’ stands for long mode.

grep flags /proc/cpuinfo | grep » lm «

Note the spaces in » lm » . If it gives any output at all, your CPU is 64bit.

Update: You can use the following in terminal too:

lshw -C processor | grep width

This works on Ubuntu, not sure if you need to install additional packages for Fedora.

If your CPU is a 64bit one (x86-64), you can use it with a 64 bit OS.

@trusktr: Yes. but all the other ways require Linux to be installed already. Not much help if you have an old Win32 machine and want to know if it will run a 64 bit *nix OS

via this command dmidecode -t processor we can check the processor capability.

That outputs a ton of other stuff, and splits «64-bit capable» on a different line than it’s vague heading («Characteristics»), so it’s difficult to parse.

Don’t rely on the high scoring answers to this question because these methods are not always correct.

I’ve a computer with a Intel Atom N230 CPU which according to all of the tests mentioned is capable to support 64 bit OS’es.

According to http://en.wikipedia.org/wiki/Intel_Atom#32-bit_and_64-bit_hardware_support the CPU is not capable of running 64 bit OS’es. I’ve tried to install a 64 bit Linux OS and it indeed refuses to do so. Installing a 32 bit Linux OS works.

You must log in to answer this question.

Linked

Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.7.13.43531

Linux is a registered trademark of Linus Torvalds. UNIX is a registered trademark of The Open Group.
This site is not affiliated with Linus Torvalds or The Open Group in any way.

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Источник

Читайте также:  Linux mail настройка smtp

Is My System Capable of 32 or 64 Bit Linux?

There are a number of situations where you may not be sure if your CPU supports 32 or 64 bit Linux. If you want to know, it’s pretty easy to see if it supports 32 or 64 bit. If nothing else, it’s always good to know what your CPU architecture is and thus know which distros are compatible with your hardware.

You simply might not know this information. You wouldn’t be alone in that. These sort of questions pop up fairly regularly at the various support sites.

Maybe you were still new to Linux when you installed? Or maybe you’re working on a system that you yourself didn’t install? Perhaps you just don’t remember? There are a number of reasons why you’d want to know and why you might not already know.

Anyhow, this should be a relatively short article. There’s only so much fluff that I can add! I’m gonna tell you how to know for sure what architecture you can use.

Is my CPU 32 or 64 bit?

It was not that long ago that I saw someone asking this question at a forum I frequent. They wanted to know if their CPU supported 64 bit. The answer, which was well intended, was that they should run this command:

Which would indeed output this sort of text:

That’s great, but it’s not actually informative – as an answer to this specific question. What that command and output determine is that you’re using a specific variation of Linux. Granted, it’s true for those CPUs that support 62 bit and have a 62 bit CPU installed. It’s not always certain to be true, however.

For example, if you were using a 32 bit distro then the output from the ‘uname’ command would be 32 bit. You can run 32 bit Linux versions on 64 bit CPUs and the output will only be accurate so far as the version installed. After all, a 32 bit distro will run just fine on 64 bit hardware. Even if your hardware supports 64 bit, the uname command will output something about i686 if you have a 32 bit distro installed.

So, you could realistically have an output that says something about 32 bit while being perfectly capable of running 64 bit Linux versions. Using the uname command doesn’t tell you the hardware capability (necessarily). It tells you what is currently in use.

How do we know for sure? Well, there are a number of ways, but the easiest way that I can think of and it requires the terminal. Go ahead and open your terminal emulator by pressing CTRL + ALT + T on your keyboard.

Источник

Оцените статью
Adblock
detector