On Wed, Aug 21, 2024 at 13:39:22 +0200, to...@tuxteam.de wrote:
> On Wed, Aug 21, 2024 at 06:34:30AM -0500, Richard Owlett wrote:
> > I know I've asked this before, but couldn't thread.
> > /etc/debian_version reports release active, but I need to know 32 or 64 bit.
> > TIA
> 
> uname -a
> 
> This tells you the *kernel* version. Note that for most architectures,
> the 64 bit version can run 32 bit applications fine if you make sure to
> have the libs installed.
> 
> So "the release 'is' 64 bit" or "... 32 bit" is misleading.

I've always favored "file /bin/ls" to get the architecture.

hobbit:~$ file /bin/ls
/bin/ls: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically 
linked, interpreter /lib64/ld-linux-x86-64.so.2, 
BuildID[sha1]=15dfff3239aa7c3b16a71e6b2e3b6e4009dab998, for GNU/Linux 3.2.0, 
stripped

It's extremely likely that whatever arch /bin/ls uses is the "primary"
arch for the system.  It works on every Linux system I've encountered,
even if the kernel doesn't match it.

Of course, for Debian specifically, there's also

    dpkg --print-architecture

If that agrees with file /bin/ls, then you've got one more level of trust.

Reply via email to