Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

zypper list files in non-installed package

Tags:

rpm

zypper

Using zypper search, I can find the package. I know that I could use

rpm -qlp <package.rpm>

to list the files, but I don't have it; since it is in one of the zypper repositories. Is there something like this?

zypper list-files-in <package>

NOTE : I am creating a self-answered Q&A for other people trying to solve the same problem

like image 399
Chris Maes Avatar asked Aug 07 '19 15:08

Chris Maes


People also ask

Where are zypper repos stored?

6, “Managing Repositories with Zypper” for details on repository management. The default download directory is /var/cache/zypper/source-download . You can change it using the --directory option.

What is the difference between rpm and zypper?

What is difference between RPM and zypper? RPM is useful for installing/uninstalling a single software package. With zypper, you can install/uninstall packages, patterns, products and patches. You can also manage your repositories with zypper.


1 Answers

There does not seem to be an option in zypper to do this in one command, but you could:

Fetch the files without installing (Note: if this command threatens you to uninstall packages that is not a problem; with the --download-only flag zypper will stop after downloading)

zypper in --download-only <package>

Find the file:

find /var/cache/zypp -iname "package*rpm"

List the files in an uninstalled package:

rpm -qlp /var/cache/zypp/packages/<repo_alias>/suse/<arch>/<package-file-name>

Now you can clean up the files you downloaded (and some other cache) if you want:

zypper clean
like image 190
Chris Maes Avatar answered Oct 19 '22 02:10

Chris Maes