how to install rpm on linux code example

Example 1: install rpm fedora

sudo rpm –i sample_file.rpm
1
To install or upgrade a package, use the -U command-line option:
rpm -U filename.rpm. For example, to install the mlocate RPM used as an example in this chapter, run the following command:
rpm -U mlocate-0.22.2-2.i686.rpm. ...
rpm -Uhv mlocate-0.22.2-2.i686.rpm. ...
rpm –e package_name. ...
rpm –qa. ...
rpm –qa | more.

Example 2: install rpm ubuntu

sudo add-apt-repository universe #Add the Universe Repository
sudo apt-get update
sudo apt-get install alien  #Install Alien package
sudo alien <name of package>.rpm   #Convert .rpm package to .deb
sudo dpkg -i <name of package>.deb #Install the Converted Package

sudo alien -i <name of package>.rpm    #Install RPM Package Directly Onto the System on Ubuntu