yum update, how to make rpm package updateable

Solution 1:

The only thing you need to do to make it work is make sure the version number or release number for the same version in the .spec file is higher then the current version installed. Then when added to your repo and a createrepo is run yum will pick it up and update

Solution 2:

The answer is not as simple as sticking an RPM with a newer revision in the repo.

There are things to be done on the server side and on the client side.

Server Side

  1. Copy RPM to repo
  2. cd /path/to/repo (let's assume /var/www/html/repo)
  3. sudo createrepo --update . This will update the repo's database to include the new RPM
  4. sudo chmod -R ugo+rX /var/www/html/repo/ This will make the new RPM visible

Client Side

  1. sudo yum clean all This will get rid off all the cached info related to the repo.
  2. sudo yum info rpmname You should now see that the latest rpm version is available.
  3. sudo yum -y update rpmname You should be updated.

I got very frustrated with all the answers (here, there, and everywhere) that glossed over all of these details. Anyone going through the process of creating a repo with updates is going to test it. The test will go like this:

Server Side, Add new RPM to repository, run createrepo, change permissions Client Side, yum -y install rpmname. User, "Cool it worked. Now let's try doing and update."

Server Side, Add RPM with newer revision, run createrepo, change permissions Client Side, yum -y upgrade rpmname, "No Packages marked for Update" User, "What the #?!@ I just followed all of the instructions I found on the web and this didn't work!"

On the client side, yum will cache information about the repository including the newest available release. The next time the client does an update or info command yum will not go back to the internet and check the repository. Yum will use the cached version of the repo.


Solution 3:

If the RPM's version is greater than the installed version it will update.