8

Supposing that I am going to install a package, what's the difference between these two commands: rpm -ivh <package> and yum install <package>

same question for example with rpm -Uvh <package> and yum update <package> (for updating issue)

Slipeer
  • 3,295
  • 2
  • 21
  • 33
h_h10a
  • 217
  • 2
  • 7

3 Answers3

12

For rpm you must specify where to get the file with the new version of the package.

yum, which is a more intelligent management system, try to find a new version of the package in their repositories, will look for the package dependencies, will look for the fastest repository mirror (and make a lot of other pleasantrie)

Slipeer
  • 3,295
  • 2
  • 21
  • 33
  • For the difference between -ivh and -Uvh see here: https://stackoverflow.com/questions/27794089/difference-between-rpm-ivh-and-rpm-uvh/27794125. Basically `U` will install and remove old versions and `i` will just install. – duct_tape_coder Feb 12 '20 at 21:19
  • Additionally, you can use `yum localinstall ` to intelligently install dependencies as needed. – duct_tape_coder Feb 12 '20 at 21:21
  • Furthermore, `yum` is the default package manager for Enterprise Linux (RHEL/CentOS) but other distributions may use other managers such as `apt-get`. – duct_tape_coder Feb 12 '20 at 21:27
5
  • rpm - RPM Package Manager.
  • yum - is an interactive, rpm based, package manager.

there is no difference if you're installing single file as both yum which is wrapper for rpm and they both offers same core functionality, however yum can do more as yum works with repo(s) and it can handle updates & has plugins, while rpm works with file(s).

alexus
  • 13,112
  • 32
  • 117
  • 174
0

If you want to know if a package was installed using rpm or through yum, issue "yum list installed" and check the 3rd column. If it is:

---"installed" then it was installed using rpm command

---"@base" or other repo, it means it has been installed through yum from a repo

---"@"example_filename. A filename after @ means it has been installed using "yum localinstall package.rpm", so a local rpm install through yum

It's best to install through yum because it also resolves dependencies. And if you compile from source code&install (e.g. you can't find the needed package for your distro), these installs are not registered in rpmdb so yum and rpm will not display and manage those installations afterwards.

Bogu
  • 1
  • 1