You can keep the RPM file anywhere (but not in /lib, /dev, /proc, /sys
). But if you execute the command from one place and the rpm is in another location, you will need to give the path to the RPM file. Example, the RPM "a.rpm" is located in /tmp and you're in /home/.
rpm -ivh a.rpm -> Doesn't work
rpm -ivh /tmp/a.rpm - Works
cd /tmp;rpm -ivh a.rpm - Works
Yes, you can delete the rpm file after the installation.