6

apt-cache search returns list of available packages. In my case I would like to look at the list of files that would be installed on my PC in case I install the package usb-creator-gtk.

Something like dpkg-query -L does for an already installed package.

Thanks for help.

gertvdijk
  • 69,427
user52151
  • 265

2 Answers2

8

You've got at least these two options.

First one, use apt-file for packages you haven't installed yet.

$ sudo apt-get install apt-file
$ sudo apt-file update
$ apt-file list usb-creator-gtk
usb-creator-gtk: /usr/bin/usb-creator-gtk
usb-creator-gtk: /usr/lib/python2.7/dist-packages/usbcreator/frontends/gtk/__init__.py
usb-creator-gtk: /usr/lib/python2.7/dist-packages/usbcreator/frontends/gtk/frontend.py
[...]

Second one, use the packages.ubuntu.com website to locate the package, then all the way down on the page in the "Download" section, you'll find a link [list of files]. Example for your package in Bionic (18.04) is here.

Either way, please remember that packages might install more files in their install scripts!

wjandrea
  • 14,504
gertvdijk
  • 69,427
0

Use apt list | grep {name} to display packages whose names include {name}.

For example, apt list | grep nouveau or apt list | grep nouveau* will show several packages containing 'nouveau' in their names.

Below is my terminal results...

$ apt list | grep nouveau*

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libdrm-nouveau2/jammy-updates,now 2.4.113-2~ubuntu0.22.04.1 amd64 [installed,automatic] libdrm-nouveau2/jammy-updates 2.4.113-2~ubuntu0.22.04.1 i386 nouveau-firmware/jammy,jammy 20091212-0ubuntu1 all xserver-xorg-video-nouveau-hwe-18.04/jammy 3:14.6 amd64 xserver-xorg-video-nouveau/jammy,now 1:1.0.17-2build1 amd64 [installed,automatic]