I'm working on a script to install a package from a URL. The script needs to install the package if it isn't installed and forcibly replace the existing version with the specified RPM if it is already installed. Unfortunately both yum install and yum update return 1 if the package is already at the right version. How do I just tell yum to absolutely, positively install an RPM and only return an exit code if there's an actual error?
How to install or upgrade package with yum with a zero exit code?
yum
Instead of your script calling yum to do the download and install, I would just make the script download the file (with e.g. curl or wget) and then force the installation of the downloaded .rpm file:rpm --install --force file_name.rpmAs the OP indicated, rpm can donwload the URL directly without a problem. From the man page:INSTALLING, UPGRADING, AND REMOVING PACKAGES:   rpm {-i|--install} [install-options] PACKAGE_FILE ...   rpm {-U|--upgrade} [install-options] PACKAGE_FILE ...   rpm {-F|--freshen} [install-options] PACKAGE_FILE ...   <snip>   In  these  options, PACKAGE_FILE can be either rpm binary file or ASCII   package manifest (see PACKAGE SELECTION OPTIONS), and may be  specified   as  an  ftp  or  http URL, in which case the package will be downloaded   before being installed. See FTP/HTTP OPTIONS for information  on  rpm's   internal ftp and http client support.