The Linux RPM system is so convoluted and difficult to use that I've had to resort to this page of notes on how to do things.
RPMs are a great example of how to make something actually difficult to use. For an alternative, take a look at the NetBSD Package System. It actually works, it is simple, and you don't need to make a list of "how to do things with it"... You just do them.
You need to be careful installing things if you need multiple versions on the system. Upgrade or Freshen (upgrade only things which are already installed) delete the old version of a package.
Both kind of systems have a native package format that holds packages.
Then, the cool thing is that both of them have automated package managers which figure out dependencies and other problems, and take care of download the packages that you need to install the package that you want!
Notes on package stuff, trying to find when a package was installed:
rpm -q -a
rpm -q -f filename
rpm -q -l package_name
rpm -q -l -p package_file.rpm
rpm -q -R -p package_file.rpm
rpm -qpR package_file.rpm
cat /etc/redhat-release
rpm2cpio package_file.rpm | cpio -t
rpm -qa --last
<name>-<version>-<release>.<os>.<architecture>.rpm
-devel
, which
indicates a package has the headers for compiling to use
that package, instead of just linking against the package
for pre-compiled things.
Yum is an automated package tool along the lines of apt for use with RedHat Packages. It takes care of dependencies and other issues that you would otherwise have to do manually by checking RPM dependencies and downloading and installing them all in the correct order.
Yum stands for YellowDog Update Manager, go figure.
yum --showduplicates list package-name
yum remove package-name
yum install yum-versionlock
yum versionlock package-name
yum whatprovides /a/path
Debian & Ubuntu use a different package format than the RPM favored by RedHat-like linux systems. It's called dpkg. The funky thing is that most users on those platforms use the automated tool apt instead of the base package format.
dpkg --get-selections
dpkg --list 'shell-regexp'
dpkg -S filename
dpkg -L package_name
dpkg -s package_name
dpkg --info package_file.deb
apt install --simulate package_file.deb
cat /etc/debian_version
dpkg --fsys-tarfile package_file.deb | tar tf -
dpkg-query -S file
dpkg-query -l name