16

I have searched, but not found an option that tells me what version of binutils I have on My Ubuntu. Or at least I don't know how to interpret it.

gcc -v - tells nothing about binutils

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

jww
  • 83,594
  • 69
  • 338
  • 732
thedarkside ofthemoon
  • 2,041
  • 4
  • 26
  • 44

3 Answers3

19

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

Helio
  • 955
  • 7
  • 16
8

I tested it only with the Debian 8, but I think it must be working with other Debian-based operation systems (Ubuntu, Mint, other).


dpkg -l | grep binutils

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

apt-cache policy binutils

$ 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 (stripped)

$ 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
PADYMKO
  • 3,291
  • 2
  • 31
  • 36
0

Try this:

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

This gets all the binaries in the binutils packages and queries each one with its --version parameter. I echo an empty string for those that expect input in the terminal.

MrYo
  • 1,559
  • 3
  • 16
  • 33