apt show 命令能否显示软件包是否已安装在操作系统中?

apt show 命令能否显示软件包是否已安装在操作系统中?

命令

apt show packagename

如果找到了 packagename,则显示有关它的信息,但是此命令(或其他命令)是否也可以显示 packagename 现在是否已安装? 2) 它是从哪个存储库安装的?

谢谢!

答案1

我可能会用它apt-cache policy来查看当前启用的源提供了哪些相关软件包,以及我当前正在使用的软件包的版本(或者没有安装

guiverc@d960-ubu2:~$   apt-cache policy ubuntu-desktop
ubuntu-desktop:
  Installed: 1.488
  Candidate: 1.488
  Version table:
 *** 1.488 100
        100 /var/lib/dpkg/status
     1.487 500
        500 http://archive.ubuntu.com/ubuntu kinetic/main amd64 Packages

@Raffaapt show建议

当安装包时实际上会显示一行额外的内容,例如“APT-手动安装:是

在我的盒子上得到相同的结果

guiverc@d960-ubu2:~$    apt show ubuntu-desktop
Package: ubuntu-desktop
Version: 1.488
Status: install ok installed
Priority: optional
Section: metapackages
Source: ubuntu-meta
Maintainer: Ubuntu Developers <[email protected]>
Installed-Size: 54.3 kB
Provides: packagekit-installer
Depends: alsa-base, alsa-utils, anacron, at-spi2-core, bc, ca-certificates, dmz-cursor-theme, fonts-dejavu-core, fonts-freefont-ttf, foomatic-db-compressed-ppds, gdm3, ghostscript-x, gnome-control-center, gnome-menus, gnome-session-canberra, gnome-settings-daemon, gnome-shell, gnome-shell-extension-appindicator, gnome-shell-extension-desktop-icons-ng, gnome-shell-extension-ubuntu-dock, gstreamer1.0-alsa, gstreamer1.0-packagekit, gstreamer1.0-plugins-base-apps, inputattach, language-selector-common, language-selector-gnome, libatk-adaptor, libnotify-bin, libsasl2-modules, libu2f-udev, nautilus, openprinting-ppds, pipewire-pulse, printer-driver-pnm2ppa, rfkill, software-properties-gtk, spice-vdagent, ubuntu-desktop-minimal, ubuntu-drivers-common, ubuntu-release-upgrader-gtk, ubuntu-session, ubuntu-settings, unzip, update-manager, update-notifier, wireless-tools, wireplumber, wpasupplicant, xdg-user-dirs, xdg-user-dirs-gtk, xkb-data, xorg, yelp, zenity, zip
Recommends: aisleriot, apport-gtk, appstream, apt-config-icons-hidpi, avahi-autoipd, avahi-daemon, baobab, bluez, bluez-cups, branding-ubuntu, brltty, cheese, cups, cups-bsd, cups-client, cups-filters, deja-dup, dirmngr, eog, evince, file-roller, fonts-indic, fonts-kacst-one, fonts-khmeros-core, fonts-lao, fonts-liberation, fonts-liberation2, fonts-lklug-sinhala, fonts-noto-cjk, fonts-noto-color-emoji, fonts-opensymbol, fonts-sil-abyssinica, fonts-sil-padauk, fonts-thai-tlwg, fonts-tibetan-machine, fonts-ubuntu, fwupd, fwupd-signed, gamemode, gir1.2-gmenu-3.0, gnome-accessibility-themes, gnome-bluetooth, gnome-calculator, gnome-calendar, gnome-characters, gnome-disk-utility, gnome-font-viewer, gnome-initial-setup, gnome-keyring, gnome-logs, gnome-mahjongg, gnome-mines, gnome-power-manager, gnome-remote-desktop, gnome-sudoku, gnome-system-monitor, gnome-terminal, gnome-text-editor, gnome-todo, gpg-agent, gsettings-ubuntu-schemas, gvfs-fuse, hplip, ibus, ibus-gtk, ibus-gtk3, ibus-table, im-config, kerneloops, laptop-detect, libglib2.0-bin, libnss-mdns, libpam-fprintd, libpam-gnome-keyring, libpam-sss, libproxy1-plugin-gsettings, libproxy1-plugin-networkmanager, libreoffice-calc, libreoffice-gnome, libreoffice-impress, libreoffice-math, libreoffice-ogltrans, libreoffice-pdfimport, libreoffice-style-breeze, libreoffice-writer, libspa-0.2-bluetooth, libwmf0.2-7-gtk, memtest86+, mousetweaks, nautilus-sendto, nautilus-share, network-manager, network-manager-config-connectivity-ubuntu, network-manager-openvpn-gnome, network-manager-pptp-gnome, orca, packagekit, pcmciautils, plymouth-theme-spinner, policykit-desktop-privileges, printer-driver-brlaser, printer-driver-c2esp, printer-driver-foo2zjs, printer-driver-m2300w, printer-driver-min12xxw, printer-driver-ptouch, printer-driver-pxljr, printer-driver-sag-gdi, printer-driver-splix, remmina, rhythmbox, seahorse, shotwell, simple-scan, snapd, speech-dispatcher, system-config-printer, systemd-oomd, thunderbird, thunderbird-gnome-support, totem, transmission-gtk, ubuntu-docs, ubuntu-report, ubuntu-wallpapers, usb-creator-gtk, whoopsie, xcursor-themes, xdg-desktop-portal-gnome, xdg-utils, yaru-theme-gnome-shell, yaru-theme-gtk, yaru-theme-icon, yaru-theme-sound
Download-Size: unknown
APT-Manual-Installed: yes
APT-Sources: /var/lib/dpkg/status
Description: The Ubuntu desktop system
 This package depends on all of the packages in the Ubuntu desktop system
 .
 It is also used to help ensure proper upgrades, so it is recommended that
 it not be removed.

N: There is 1 additional record. Please use the '-a' switch to see it

相关内容