如果apt install
报告某个程序已安装,我如何才能找出apt install
该程序的安装位置?请注意which
,whereis
不一定只报告该信息。apt
有自己的命令吗?谢谢。
另外,我能否找出apt install
上次安装程序的时间?只需查看可执行文件的 mtime 即可吗?是否apt
提供了一些方法来做到这一点?
例如:
$ sudo apt install wine-stable
[sudo] password for t:
Reading package lists... Done
Building dependency tree
Reading state information... Done
wine-stable is already the newest version (3.0.1~bionic).
wine-stable set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
答案1
有很多方法可以实现这一点,我常用的方法是(因为它很简单)
apt-file show chromium-browser
apt-file
如果选择此方法,则必须添加。
guiverc@d960-ubu2:~$ apt-file show chromium-browser
chromium-browser: /etc/chromium-browser/customizations/00-example
chromium-browser: /etc/chromium-browser/default
chromium-browser: /etc/default/chromium-browser
chromium-browser: /usr/bin/chromium-browser
chromium-browser: /usr/lib/chromium-browser/MEIPreload/manifest.json
chromium-browser: /usr/lib/chromium-browser/MEIPreload/preloaded_data.pb
chromium-browser: /usr/lib/chromium-browser/WidevineCdm/manifest.json
chromium-browser: /usr/lib/chromium-browser/chrome-sandbox
chromium-browser: /usr/lib/chromium-browser/chrome_100_percent.pak
chromium-browser: /usr/lib/chromium-browser/chrome_200_percent.pak
chromium-browser: /usr/lib/chromium-browser/chromium-browser
chromium-browser: /usr/lib/chromium-browser/headless_lib.pak
chromium-browser: /usr/lib/chromium-browser/icudtl.dat
chromium-browser: /usr/lib/chromium-browser/keyboard_resources.pak
chromium-browser: /usr/lib/chromium-browser/libs
chromium-browser: /usr/lib/chromium-browser/locales/en-US.pak
chromium-browser: /usr/lib/chromium-browser/mus_app_resources_100.pak
chromium-browser: /usr/lib/chromium-browser/mus_app_resources_200.pak
chromium-browser: /usr/lib/chromium-browser/mus_app_resources_strings.pak
chromium-browser: /usr/lib/chromium-browser/natives_blob.bin
chromium-browser: /usr/lib/chromium-browser/resources.pak
chromium-browser: /usr/lib/chromium-browser/snapshot_blob.bin
chromium-browser: /usr/lib/chromium-browser/swiftshader/libEGL.so
chromium-browser: /usr/lib/chromium-browser/swiftshader/libGLESv2.so
chromium-browser: /usr/lib/chromium-browser/transport_security_state_generator
chromium-browser: /usr/lib/chromium-browser/v8_context_snapshot.bin
chromium-browser: /usr/lib/chromium-browser/views_mus_resources.pak
chromium-browser: /usr/lib/chromium-browser/xdg-mime
chromium-browser: /usr/lib/chromium-browser/xdg-settings
chromium-browser: /usr/share/applications/chromium-browser.desktop
chromium-browser: /usr/share/apport/package-hooks/chromium-browser.py
chromium-browser: /usr/share/doc/chromium-browser/README.source
chromium-browser: /usr/share/doc/chromium-browser/changelog.Debian.gz
chromium-browser: /usr/share/doc/chromium-browser/copyright
chromium-browser: /usr/share/doc/chromium-browser/copyright.problems.gz
chromium-browser: /usr/share/gnome-control-center/default-apps/chromium-browser.xml
chromium-browser: /usr/share/icons/hicolor/128x128/apps/chromium-browser.png
chromium-browser: /usr/share/icons/hicolor/22x22/apps/chromium-browser.png
chromium-browser: /usr/share/icons/hicolor/24x24/apps/chromium-browser.png
chromium-browser: /usr/share/icons/hicolor/256x256/apps/chromium-browser.png
chromium-browser: /usr/share/icons/hicolor/48x48/apps/chromium-browser.png
chromium-browser: /usr/share/icons/hicolor/64x64/apps/chromium-browser.png
chromium-browser: /usr/share/icons/hicolor/scalable/apps/chromium-browser.svg
chromium-browser: /usr/share/lintian/overrides/chromium-browser
chromium-browser: /usr/share/man/man1/chromium-browser.1.gz
chromium-browser: /usr/share/pixmaps/chromium-browser.png
供参考:命令之前的额外空格(在我的提示之后)是为了使命令不会显示在我的命令中history
。如果您是远程的(例如,您通过 ssh 进入您的盒子),这当然不起作用,或者它已被保护以防止这种情况发生。
但是如果你想要让它保持轻便,我建议dpkg -L
按照@steeldriver 的建议(它是默认安装的),而且很可能是 apt-show 使用的工具:)
至于什么时候你可以使用类似
zcat /var/log/apt/hist* |grep chromium-browser -B 2 -A 2
在我的日志中搜索“chromium-browser”;显示该行(前后各加两行,以确保我能看到日期/时间)。@AlexP 在他的评论中提到了这一点。我的盒子的输出示例如下
Start-Date: 2017-11-16 13:53:13
Commandline: apt install glances htop iftop cowsay fortune figlet nfs-common chromium-browser
Requested-By: guiverc (1000)
Install: python-six:amd64 (1.10.0-4, automatic), ttf-bitstream-vera:amd64 (1.10-8, automatic), fortune-mod:amd64 (1:1.99.1-7), fonts-lyx:amd64 (2.2.3-1, automatic), python3-pystache:amd64 (0.5.4-6, automatic), liblapack3:amd64 (3.7.1-3ubuntu2, automatic), javascript-common:amd64 (11, automatic), python3-dateutil:amd64 (2.6.0-1, automatic), iftop:amd64 (1.0~pre4-4), figlet:amd64 (2.2.5-3), blt:amd64 (2.5.3+dfsg-3, automatic), python2.7-minimal:amd64 (2.7.14-2ubuntu2, automatic), python2.7:amd64 (2.7.14-2ubuntu2, automatic), python3-netifaces:amd64 (0.10.4-0.1build4, automatic), libjs-jquery:amd64 (3.1.1-2, automatic), python-matplotlib-data:amd64 (2.0.0+dfsg1-2ubuntu3, automatic), python3-matplotlib:amd64 (2.0.0+dfsg1-2ubuntu3, automatic), fortunes-min:amd64 (1:1.99.1-7, automatic), python3-psutil:amd64 (5.0.1-1build2, automatic), libquadmath0:amd64 (7.2.0-8ubuntu3, automatic), python3-numpy:amd64 (1:1.12.1-3.1ubuntu4, automatic), python:amd64 (2.7.14-2ubuntu1, automatic), python3-cycler:amd64 (0.10.0-1, automatic), librecode0:amd64 (3.6-23, automatic), htop:amd64 (2.0.2-1), python3-pyparsing:amd64 (2.1.10+dfsg1-1, automatic), python3-docker:amd64 (1.9.0-1, automatic), libpython-stdlib:amd64 (2.7.14-2ubuntu1, automatic), hddtemp:amd64 (0.3-beta15-52, automatic), chromium-browser:amd64 (62.0.3202.89-0ubuntu0.17.10.1386), libgfortran4:amd64 (7.2.0-8ubuntu3, automatic), python3-pysnmp4:amd64 (4.3.2-2, automatic), libtirpc1:amd64 (0.2.5-1.2, automatic), libjs-jquery-ui:amd64 (1.12.1+dfsg-5, automatic), tk8.6-blt2.5:amd64 (2.5.3+dfsg-3, automatic), glances:amd64 (2.10-2), python3-tk:amd64 (3.6.3-0ubuntu1, automatic), python3-tz:amd64 (2017.2-2, automatic), lm-sensors:amd64 (1:3.4.0-4, automatic), python3-influxdb:amd64 (4.1.1-1, automatic), libblas3:amd64 (3.7.1-3ubuntu2, automatic), chromium-browser-l10n:amd64 (62.0.3202.89-0ubuntu0.17.10.1386, automatic), cowsay:amd64 (3.03+dfsg2-3), python3-websocket:amd64 (0.44.0-0ubuntu2, automatic), rpcbind:amd64 (0.2.3-0.6, automatic), python-minimal:amd64 (2.7.14-2ubuntu1, automatic), python3-bottle:amd64 (0.12.13-1, automatic), nfs-common:amd64 (1:1.3.4-2.1ubuntu2), libjs-angularjs:amd64 (1.5.10-1, automatic), libjs-lodash:amd64 (4.17.4+dfsg-1, automatic), python3-pyasn1:amd64 (0.1.9-2, automatic), libnfsidmap2:amd64 (0.25-5.1, automatic), cowsay-off:amd64 (3.03+dfsg2-3, automatic)
End-Date: 2017-11-16 13:54:13