Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I display file permissions of rpm internal contents

Tags:

rpm

I want to see what permissions the files within an rpm will "have" after the rpm is installed. But without having to install the rpm.

like image 592
rogerdpack Avatar asked Aug 20 '15 16:08

rogerdpack


People also ask

How do I see what's inside an RPM?

You can use rpm command (rpm command) itself to list the files inside a RPM package. rpm is a powerful Package Manager, which can be used to build, install, query, verify, update, and erase individual software packages.

How do I list file permissions in Linux?

To view the permissions for all files in a directory, use the ls command with the -la options. Add other options as desired; for help, see List the files in a directory in Unix. In the output example above, the first character in each line indicates whether the listed object is a file or a directory.

How can I see RPM contents without installing?

Listing of the files inside an RPM package You can get a listing of the files inside an RPM by performing an RPM query and adding the “-p” switch: $ rpm -q -l -p bash-3.1-16.1. x86_64. rpm /bin/bash /bin/sh /etc/skel/.


2 Answers

The --dump option to rpm gives you this information (as well as other information).

rpm -qp --dump "$RPM_PACKAGE_FILENAME"
like image 71
Etan Reisner Avatar answered Oct 13 '22 15:10

Etan Reisner


Here's a way that shows you permissions "like ls does":

 $ rpm -q --qf "[%-15{=NAME} %-36{FILENAMES} %{FILEMODES:perms}\n]" -p $FILENAME
 FILENAME            /etc/pam.d/sudo                      -rw-r--r--
 FILENAME            /etc/file/name/here                  -rw-r--r--
 ....

ref

like image 28
rogerdpack Avatar answered Oct 13 '22 14:10

rogerdpack