8

How do i check the version of coreutils? gnu coreutils says they are at version 5. Im sure Ubuntu is a variation on that. I tried:

info coreutils
File: coreutils.info,  Node: coreutils invocation,  Prev: Standards conformance,  Up: Common options

2.14 ‘coreutils’: Multi-call binary

is the version really 2.14? that seem really dated. Is that right? Or am I checking the wrong thing?

j0h
  • 14,825

5 Answers5

11

Short answer - check the Installed field in the output of apt-cache policy :

testdir:$ apt-cache policy coreutils
coreutils:
  Installed: 8.21-1ubuntu5.1
  Candidate: 8.21-1ubuntu5.1
      Version table:
 *** 8.21-1ubuntu5.1 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
        100 /var/lib/dpkg/status
     8.21-1ubuntu5 0
        500 http://us.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497
  • +1. But, I'm wondering if answer can be improved by letting user tell if package is core to Ubuntu-Server/Desktop or was installed manually by them. Or do they really care in the case of coreutils? – WinEunuuchs2Unix May 28 '18 at 19:22
  • @WinEunuuchs2Unix On Ubuntu coreutils are a default package. mv and cp are all parts of that package, and Ubuntu, well, has to have them for POSIX standard compliance, therefore has to have coreutils package by default. There's ways to check what's been installed by default, but in this case it isn't necessary. – Sergiy Kolodyazhnyy May 28 '18 at 19:25
  • After I posted my comment I checked and apt-mark showmanual | grep coreutils says coreutils. Interesting. I had just used the truncate command last night which is part of coreutils which is why this question came up on my radar. There was a bug in maveric version where auto-installed showed up as manually installed: https://askubuntu.com/questions/12279/why-are-almost-all-packages-marked-as-manually-installed – WinEunuuchs2Unix May 28 '18 at 19:32
  • @WinEunuuchs2Unix Auto-installed means it was installed as dependency, btw. It doesn't mean it's a default package that comes with Ubuntu installation. For example, one of my indicators requires zenity as dependency, so on Lubuntu it'd be auto-installed,too, when you install my indicator. Makes sense ? – Sergiy Kolodyazhnyy May 28 '18 at 19:40
  • Kind of, but I'm running out to go shopping :) – WinEunuuchs2Unix May 28 '18 at 19:44
  • @WinEunuuchs2Unix Lol, go on. I things to do, too, coffee for instance, and laundry – Sergiy Kolodyazhnyy May 28 '18 at 19:47
  • Link to perfect bachelor laundry timer WIP: https://askubuntu.com/q/1039357/307523 – WinEunuuchs2Unix May 28 '18 at 20:52
4

Use dpkg -s to see which version of a package is installed.

sudo dpkg -s coreutils

That should give you something like this:

Package: coreutils
Essential: yes
Status: install ok installed
Priority: required
Section: utils
Installed-Size: 6020
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Multi-Arch: foreign
Version: 8.21-1ubuntu5.1
...

As you can see, I have version 8.21-1ubuntu5.1 installed.

Tobias
  • 1,608
4

My fifty cents :)

  • With dpkg-query

    % dpkg-query --show coreutils
    coreutils   8.23-4ubuntu2
    
  • With axi-cache

    % axi-cache policy coreutils
    coreutils:
      Installed: 8.23-4ubuntu2
      Candidate: 8.23-4ubuntu2
      Version table:
     *** 8.23-4ubuntu2 0
            500 http://archive.ubuntu.com/ubuntu/ wily/main amd64 Packages
            100 /var/lib/dpkg/status
    
A.B.
  • 90,397
2

The latest version of coreutils is 8.24, looking at the GNU mirror.

In Ubuntu repositories, the latest version is 8.23 for 15.04/15.10/16.04:

Package coreutils

precise (12.04LTS) (utils): GNU core utilities 
8.13-3ubuntu3.3 [security]: amd64 i386
precise-updates (utils): GNU core utilities 
8.13-3ubuntu3.3: amd64 i386
trusty (14.04LTS) (utils): GNU core utilities 
8.21-1ubuntu5.1 [security]: amd64 i386
trusty-updates (utils): GNU core utilities 
8.21-1ubuntu5.1: amd64 i386
vivid (utils): GNU core utilities 
8.23-3ubuntu1: amd64 i386
wily (utils): GNU core utilities 
8.23-4ubuntu2: amd64 i386
xenial (utils): GNU core utilities 
8.23-4ubuntu2: amd64 i386
muru
  • 197,895
  • 55
  • 485
  • 740
2

You can do dpkg -s <packagename>

Output of that command would be this for coreutils:

Section: utils
Installed-Size: 12955
Maintainer: Michael Stone <mstone@debian.org>
Architecture: armhf
Multi-Arch: foreign
Version: 8.23-4
Replaces: mktemp, realpath, timeout
Pre-Depends: libacl1 (>= 2.2.51-8), libattr1 (>= 1:2.4.46-8), libc6 (>= 2.17), libselinux1 (>= 2.1.13)
Conflicts: timeout
Description: GNU core utilities
 This package contains the basic file, shell and text manipulation
 utilities which are expected to exist on every operating system.

 Specifically, this package includes:
 arch base64 basename cat chcon chgrp chmod chown chroot cksum comm cp
 csplit cut date dd df dir dircolors dirname du echo env expand expr
 factor false flock fmt fold groups head hostid id install join link ln
 logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup nproc numfmt
 od paste pathchk pinky pr printenv printf ptx pwd readlink realpath rm
 rmdir runcon sha*sum seq shred sleep sort split stat stty sum sync tac
 tail tee test timeout touch tr true truncate tsort tty uname unexpand
 uniq unlink users vdir wc who whoami yes
Homepage: http://gnu.org/software/coreutils
Alex Lowe
  • 471