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

@Raffa 建議apt 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

相關內容