Last active
October 9, 2020 18:57
-
-
Save juanje/c33ae8aa113cac644d89328999b7d6e6 to your computer and use it in GitHub Desktop.
RPM tips & tricks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Just a place to write down notes for old time Debian/Ubuntu user | |
# that has just moved into Fedora/RedHat world | |
# Show which package provides the file '/bin/ls' | |
# Similar to 'dpkg -S /bin/ls' | |
$ rpm -qf /bin/ls | |
coreutils-8.5-7.fc14.i686 | |
# The same but showing only the package name (without version) | |
$ rpm -qf /bin/ls --queryformat '%{NAME}\n' | |
coreutils | |
# Search for installed package | |
$ rpm -q BitTorrent | |
BitTorrent-5.2.2-1.noarch | |
# List files from installed package | |
$ rpm -ql BitTorrent | |
/usr/bin/bittorrent | |
/usr/bin/bittorrent-console | |
... | |
# See the package's scripts (postinstall, preuninstall, postunnstall...) | |
$ rpm -q --scripts httpd | |
postinstall scriptlet (using /bin/sh): | |
if [ $1 -eq 1 ] && [ -x /usr/bin/systemctl ]; then | |
# Initial installation | |
/usr/bin/systemctl --no-reload preset httpd.service htcacheclean.service httpd.socket || : | |
fi | |
preuninstall scriptlet (using /bin/sh): | |
if [ $1 -eq 0 ] && [ -x /usr/bin/systemctl ]; then | |
# Package removal, not upgrade | |
/usr/bin/systemctl --no-reload disable --now httpd.service htcacheclean.service httpd.socket || : | |
fi | |
... | |
# List all installed packages (dpkg -l) | |
$ rpm -qa | |
# List the last installed packages | |
$ rpm -qa --last | |
# Rebuild (editing) a RPM file | |
$ rpmrebuild -enp package.rpm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment