我如何检查 coreutils 版本?

我如何检查 coreutils 版本?

我如何检查 coreutils 的版本?gnu coreutils 说它们是版本 5。我确信 Ubuntu 是它的变体。我试过:

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

2.14 ‘coreutils’: Multi-call binary

版本真的是 2.14 吗?这看起来真的很过时。对吗?还是我检查错了?

答案1

简短回答-检查Installed输出中的字段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

答案2

使用 dpkg -s 查看安装了哪个版本的包。

sudo dpkg -s coreutils

这应该给你类似这样的结果:

Package: coreutils
Essential: yes
Status: install ok installed
Priority: required
Section: utils
Installed-Size: 6020
Maintainer: Ubuntu Developers <[email protected]>
Architecture: amd64
Multi-Arch: foreign
Version: 8.21-1ubuntu5.1
...

如你所见,我安装了版本 8.21-1ubuntu5.1。

答案3

我的五十美分:)

  • dpkg-query

    % dpkg-query --show coreutils
    coreutils   8.23-4ubuntu2
    
  • 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
    

答案4

你可以做dpkg -s <packagename>

对于 coreutils 来说,该命令的输出如下:

Section: utils
Installed-Size: 12955
Maintainer: Michael Stone <[email protected]>
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

相关内容