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

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • 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 Enable/Disable CPUs (Limiting CPU count) in CentOS / RHEL
  2. How to use Magic SysRq tool in CentOS / RHEL
  3. The Squid Service in Failed State with Error: “Failed to make swap directory /var/spool/squid/00: (13) Permission denied”
  4. Understanding linux parted utility
  5. CentOS / RHEL 5 : How to install and configure vsftpd server
  6. How to Create yum Repository in CentOS/RHEL
  7. CentOS / RHEL 7 : Understanding Kexec and Kdump
  8. How To Create An Almost Root Equivalent Users But Not Root Identical User in Linux
  9. How to Enable Password Aging in Linux with NIS
  10. How to create a networking bridge under CentOS/RHEL

You May Also Like

Primary Sidebar

Recent Posts

  • Oracle Database – Configuring Secure Application Roles
  • Extend rule sets by using factors in Oracle Database Vault
  • What are Command Rules in oracle Database
  • Using Rule Sets in Oracle Database Vault
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary