Ubuntu小技巧:查看软件包版本及安装位置

本文以chromium浏览器软件来进行示例和讲解

查看软件版本信息

  • aptitude show xxx

安装aptitude:

sudo apt-get install aptitude

运行查看chromium-browser软件信息:

aptitude show chromium-browser

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
~$ aptitude show chromium-browser

Package: chromium-browser
Version: 69.0.3497.81-0ubuntu0.18.04.1
State: installed
Automatically installed: no
Priority: optional
Section: universe/web
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Uncompressed Size: 213 M
Depends: .......
PreDepends: dpkg (>= 1.15.6)
Recommends: chromium-browser-l10n
Suggests: webaccounts-chromium-extension, unity-chromium-extension, adobe-flashplugin
Conflicts: chromium-browser-inspector, chromium-browser-inspector:i386, chromium-browser:i386
Replaces: chromium-browser-inspector, chromium-browser-inspector:i386
Provides: chromium-browser-inspector, www-browser
Description: Chromium web browser, open-source version of Chrome
An open-source browser project that aims to build a safer, faster, and more stable way for all Internet users to experience the web.
Homepage: https://chromium.googlesource.com/chromium/src/

可见,aptitude show命令将输出所查软件的包名、版本、维护人、依赖包列表、描述、主页等等信息。结果信息相当丰富。

  • apt-show-versions xxx

安装 apt-show-versions:

sudo apt-get install apt-show-versions

运行查看chromium-browser软件信息:

apt-show-versions chromium-browser

1
2
3
4
~$ apt-show-versions chromium-browser

chromium-browser:amd64/bionic-security 69.0.3497.81-0ubuntu0.18.04.1 uptodate
chromium-browser:i386 not installed

可见,apt-show-versions命令仅只打印所查软件的版本信息。

查看软件包是否安装 - dpkg

dpkg -l | grep xxx

1
2
3
4
~$ dpkg -l | grep chromium-browser

ii chromium-browser 69.0.3497.81-0ubuntu0.18.04.1 amd64 Chromium web browser, open-source version of Chrome
ii chromium-browser-l10n 69.0.3497.81-0ubuntu0.18.04.1 all chromium-browser language packages

查看软件包安装位置 - dpkg

dpkg -L xxx

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
~$ dpkg -L chromium-browser

/.
/etc
/etc/chromium-browser
/etc/chromium-browser/customizations
/etc/chromium-browser/customizations/00-example
/etc/chromium-browser/default
/etc/chromium-browser/policies
/etc/chromium-browser/policies/managed
/etc/chromium-browser/policies/recommended
/etc/default
/etc/default/chromium-browser
/usr
/usr/bin
/usr/bin/chromium-browser
/usr/lib
/usr/lib/chromium-browser
/usr/lib/chromium-browser/MEIPreload
/usr/lib/chromium-browser/MEIPreload/manifest.json
......
显示 Gitment 评论