How to find out which version of Binutils is installed on Ubuntu?

I searched but did not find an option that tells me which version of binutils I have on My Ubuntu. Or at least I don’t know how to interpret it.

gcc -v - doesn't say anything about binutils

ld -v - tells me GNU ld (GNU Binutils for Ubuntu) 2.24 . Does this mean that I have binutils 2.24?

+8
ubuntu binutils
source share
3 answers

Yes, with ld -v you can view the binutils version (2.24 in your case)

+10
source share

I tested it only with Debian 8, but I think it should work with other Debian-based operating systems (Ubuntu, Mint, etc.).


dpkg -l | grep binutils

 $ dpkg -l | grep binutils ii binutils 2.25-5+deb8u1 amd64 GNU assembler, linker and binary utilities 

apt-cache binutils policy

 $ apt-cache policy binutils binutils: Installed: 2.25-5+deb8u1 Candidate: 2.25-5+deb8u1 Version table: *** 2.25-5+deb8u1 0 500 http://ftp.ru.debian.org/debian/ jessie-proposed-updates/main amd64 Packages 100 /var/lib/dpkg/status 2.25-5 0 500 http://ftp.ru.debian.org/debian/ jessie/main amd64 Packages 500 http://httpredir.debian.org/debian/ jessie/main amd64 Packages 

apt-cache show binutils (removed)

 $ apt-cache show binutils Package: binutils Version: 2.25-5+deb8u1 Installed-Size: 20566 Maintainer: Matthias Klose < doko@debian.org > Architecture: amd64 Replaces: binutils-gold (<< 2.20.51.20100415), binutils-mingw-w64-i686 (<< 2.23.52.20130612-1+3), binutils-mingw-w64-x86-64 (<< 2.23.52.20130612-1+3) Provides: binutils-gold, elf-binutils Depends: libc6 (>= 2.14), zlib1g (>= 1:1.2.0) Suggests: binutils-doc (>= 2.25-5+deb8u1) .............................. 

ld --version

 $ ld --version GNU ld (GNU Binutils for Debian) 2.25 

ar -version

 $ ar --version GNU ar (GNU Binutils for Debian) 2.25 
+5
source share

Try the following:

 sh <(dpkg -L binutils | awk '/bin\// {print $0 " --version"}') | \ grep Binutils | sort -u | column -t 

This receives all binaries in binutils packages and requests, each of which has its -version option. I repeat the empty line for those who are waiting for input in the terminal.

0
source share

All Articles