DPKG vs. RPM
No, I’m not going to compare DPKG and RPM (and definetly not APT and YUM/URPMI/RUG), but I use both (I use Ubuntu at home and on the laptop), and while I’m rather proficient with RPM, I often find myself dumbfounded as to how to do a specific action with DPKG.
Fortunately I’ve found this nice reference that compares DPKG and RPM command line switches. It does provide some of the things that I need to do with my package manager. Unfortunately, some of the more advanced functions (specifically queries) I need are not covered there.
So does anyone know how to to do, using dpkg:
rpm -qf <path to file>
– Check to which package a given file belongs. This is very important operation when you are trying to troubleshoot something.
rpm -q --scripts <package>
– List what scripts have run or will be run when a package was installed or will be removed. This is important for figuring out what mess a specific package have rendered on your system. with -qp
instead, this can be used to examine what mess a specific uninstalled packge will render on your system when it will be installed
rpm -q --provides <package>
(and other capabilities and dependencies stuff) is required to figure out what package depends on what and why.
Specifically the first I really need as I constantly use this. any comments are welcome, of course 🙂
`rpm -qf some-file` can be done by `dpkg –search some-file`
Yea, I kind of figured it out later. The problem though is that RPM actually has an index of all files – so
rpm -qf
is fast.dpkg-query -S
actually have to search through the file list for each installed package in dpkg database – and it can take a while on a system with many files that have lived a while (the dpkg databased gets slower and slower the more you install and upgrade packages).