• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

What is the difference between the -i and -U options used in rpm command in Linux

by admin

RPMs can be installed from the command line like the following:

# rpm -Uvh [package-name]-[version].rpm

or

# rpm -ivh [package-name]-[version].rpm

Option -U is for upgrade operation that means installing a new version of a package and removing all previous versions of the same package and also removing obsoleted packages. If you have not installed a package previously, the upgrade operation will install the package.

Option -i is for install operation. It used for installing a package for the first time. It doesn’t remove any package so it can be also used for installing multiple versions of a package. If you use -i and an older version of a package is already installed then after the successful installation of a newer version, both versions of a package will be installed in the system at the same time, the older version won’t be removed. But many packages don’t allow to have installed more versions at the same time and during installation of different versions of the same package conflicts often occurs. One exception is a kernel package that can be installed in more versions.

Recommendations on using option -i and -U

It is recommended to use the option “-i” instead of “-U” for installing a new version of the kernel. If you use “-i” then an old version of kernel stays in the system and if the new version of the kernel doesn’t work then you can return to the old version.

So you should almost always use -U for installing and updating packages. The special case when you should use -i is e.g. kernel package. Additional information is available by typing man rpm at the command line.

# man rpm

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to block non-root user from creating crontab entry in Linux
  2. lvdisplay error: “Failed to create directory /var/lock/lvm. File-based locking initilisation failed.”
  3. How To Execute The Pstack Command On CentOS/RHEL
  4. quotaon command examples in Linux
  5. How to Set Proxy Settings on Linux command line or Terminal
  6. arp: command not found
  7. Unix file basics : Inode, Soft Vs Hard link, Device files, Named pipes
  8. Repairing filesystem issues at Boot in CentOS/RHEL 7 and 8
  9. How to use perf tool for tracing similar to dtrace
  10. CentOS / RHEL : How to add a new Physical Volume to an existing Volume Group

You May Also Like

Primary Sidebar

Recent Posts

  • vgextend Command Examples in Linux
  • setpci command – configure PCI device
  • db_load command – generate db database
  • bsdtar command – Read and write tape archive files

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright