RPM DPKG Rosetta Stone

From ITRS
Jump to: navigation, search
Operation rpm/yum dpkg/apt
List installed packages rpmquery -a dpkg -l
List all packages yum list all apt-cache pkgnames
Remove installed package rpm -e PACKAGE dpkg -r PACKAGE
Install local package rpm -i P.RPM dpkg -i P.DEB
Install unsigned local package and dependencies yum localinstall --nogpgcheck P.RPM gdebi P.DEB
List files owned by package rpmquery -l PACKAGE dpkg -L PACKAGE
List files in a package file rpmquery -lp P.RPM dpkg -c P.DEB
Find installed package that owns a file rpmquery -f /bin/ls dpkg --search /bin/ls
Find potentially not yet installed package that owns a file repoquery -f /bin/ls apt-file find "^/bin/ls$" -x
Find package that provides the "repoquery" command in PATH repoquery -f $(which repoquery) apt-file find $(which repoquery)
Show information from a package file rpmquery -ip P.RPM dpkg -I P.DEB
Show information about an installed package rpmquery -i PACKAGE dpkg -p PACKAGE
Show size of installed package rpmquery --queryformat '%{SIZE}\n' PACKAGE aptitude show PACKAGE | grep -E '^Uncompressed Size:'
Find the package that provides a file named Xlib.h repoquery --whatprovides '*/Xlib.h' apt-file find Xlib.h
Install the package that provides the file /usr/include/X11/Xlib.h yum install /usr/include/X11/Xlib.h apt-get install $(apt-file find /usr/include/X11/Xlib.h | cut -d ':' -f 1)
Verify installed package rpmverify PACKAGE debsums -as PACKAGE
Verify all installed packages rpmverify -a debsums -as
Download source package yumdownloader --source PACKAGE apt-get source -d PACKAGE
Download, extract and patch source tree yumdownloader --source PACKAGE; rpmdev-extract P.src.rpm; cd P.src; rpmbuild-in-dir --nodeps -bp *.spec apt-get source PACKAGE
Install source package build dependencies yum-builddep PACKAGE apt-get build-dep PACKAGE
Build source package rpmbuild -ba SPECS/p.spec cd SRC; dpkg-buildpackage
Install debug information for PACKAGE and all its dependencies (e.g. to get a detailed gdb backtrace) debuginfo-install PACKAGE Ubuntu, Debian
  • NOTE: Use "repoquery -C" to stop it from a potentially slow download of new repository data and run completely from cache. Most apt-get users would want this.
  • NOTE: "rpmquery" is equivalent to "rpm -q", "rpmverify" is equivalent to "rpm -V". The first form provides easier command completion and fewer options per command.

Building RPMs for Fedora and RHEL

Install RPM, edit config files, then upgrade
File marked as Changed in update RPM? On-disk file untouched On-disk file edited
[default] No File from update File from update
Yes File from update File from update
%config No File from update Edited file
Yes File from update File from update, edited file in .rpmsave
%config(noreplace) No File from update Edited file
Yes File from update Edited file, file from the update in .rpmnew
%config status changed in the spec file
File marked as Changed in update RPM? On-disk file edited
Was %config(noreplace), becomes %config Yes File from update, edited file in .rpmsave
Was %config, becomes %config(noreplace) Yes Edited file, file from the update in .rpmnew

Building DEBs

See Also

Comments

blog comments powered by Disqus