To view the scripts being executed by an RPM, use rpm -qp --scripts packagename
Tag: rpm
Linux: Identifying Large Packages
The disk filled up on our primary server, and there wasn’t anything obvious like a decade worth of log files to clean up. I had to resort to uninstalling ‘stuff’ (it was, after all, installing ‘stuff’ that created the problem … tons of X11-related stuff for troubleshooting purposes). There is a way to list installed packages by size:
rpm -qia|awk '$1=="Name" { n=$3} $1=="Size" {s=$3} $1=="Description" {print s " " n }' |sort -n
Extracting RPM Packages
I’ve encountered a few scenarios of late where I couldn’t install an RPM package but needed its content. One is the security config at work where I have sudo access for cp but not install rights. Sigh! But more recently, I needed to compare a library from an updated package to the currently installed one. Listing package content confirms it is the same file name and path.
[root@fedora02 tmp]# rpm -q --filesbypkg -p ./mariadb-libs-10.2.13-2.fc27.i686.rpm mariadb-libs /etc/my.cnf.d/client.cnf mariadb-libs /usr/lib/.build-id mariadb-libs /usr/lib/.build-id/7c mariadb-libs /usr/lib/.build-id/7c/c8e65deafbdcc28b3089da60f295a6f757cf4f mariadb-libs /usr/lib/libmariadb.so.3
Extracting the rpm allowed me to actually compare the files, swap back and forth to see which worked, etc.
[lisa@fedora tmp]# rpm2cpio mariadb-libs-10.2.13-2.fc27.x86_64.rpm | cpio -idmv