0

We use RPMS for our packaging and yum to update our environments.

We have an rpm package-5.1.1-3 installed in our production server and in our yum repository we have 2 newer versions such as package-5.1.3-3 and package-5.2-27.

Using yum, we tried to install package-5.1.3-1 but yum installed package-5.2-27.

It caused serious problems in production.

If we remove 5.2-27 package from our custom yum repository and try installing 5.1.3-1, it's installing as expected.

I think yum should allow installation of specific version of RPMS and I remember doing this few times. I tried to debug but no success.

Package already installed:

root@snelloru]# rpm -qa|grep package
pacakge-database-5.1.1-3
package-5.1.1-3

Installing higher version(5.1.3-1)

yum install package-5.1.3-1
Loaded plugins: rhnplugin, security
Excluding Packages in global exclude list
Finished
Setting up Install Process
Package matching package-5.1.3-1.x86_64 already installed. Checking for update.
Resolving Dependencies
--> Running transaction check
--> Processing Dependency: package = 5.1.1-3 for package: package-database
---> Package package.x86_64 0:5.1.3-1 set to be updated
--> Running transaction check
---> Package package-database.x86_64 0:5.2-23 set to be updated
--> Processing Dependency: package = 5.2-23 for package: package-database
--> Running transaction check
---> Package package.x86_64 0:5.1.3-1 set to be updated
---> Package package.x86_64 0:5.2-23 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================
 Package             Arch      Version      Repository    Size
===============================================================
 package             x86_64    5.2-23       repo          22 M
 package-database    x86_64    5.2-23

Output of yum list --showduplicates package package-database

root@snelloru]# yum list --showduplicates package package-database
Loaded plugins: allowdowngrade, security
rightscale-epel                                       |  951 B     00:00
Installed Packages
package.x86_64                        5.1.1-3            installed
package-database.x86_64               5.1.1-3            installed
Available Packages
package.x86_64                        5.1-126            repo
package.x86_64                        5.1.1-3            repo
package.x86_64                        5.1.2-3            repo
package.x86_64                        5.1.3-1            repo
package.x86_64                        5.2-25             repo
package.x86_64                        5.2-26             repo
package.x86_64                        5.2-27             repo
package-database.x86_64               5.1-126            repo
package-database.x86_64               5.1.1-3            repo
package-database.x86_64               5.1.2-3            repo
package-database.x86_64               5.1.3-1            repo
package-database.x86_64               5.2-2              repo
package-database.x86_64               5.2-3              repo
package-database.x86_64               5.2-4              repo
package-database.x86_64               5.2-24             repo
package-database.x86_64               5.2-25             repo
package-database.x86_64               5.2-26             repo
package-database.x86_64               5.2-27             repo

My observation:

If we try to install package of same version which is already installed in the server but with different release number, its working as expected.

For example if we have 5.2-10 installed in the server and if we try to install 5.2-20 its working as expected though we have higher releases like 5.2-25..5.2-28 are present in repo.

Its not working only when we have different version of rpm is installed

Any ideas on this??

3
  • You can ask for a specific packave version, but only if it is still available in the repository. Given that distribution repositories are cleaned out aggressively, old versions don't stay around long (if at all). Why do you want to go to an old version in the first place?
    – vonbrand
    Commented Jun 25, 2014 at 20:01
  • I am not trying to install any package from distribution. Its our own software package. We generate packages everyday keep them in RPM repository and install them using YUM. We have all older versions stored in our repo and I am expecting yum to install older version when it is present in the RPM repository.
    – Sridhar
    Commented Jun 25, 2014 at 20:27
  • Do you need to feed it the --allow-downgrade flag because it's already aware of the newer version? Also, yum-versionlock may become necessary on that machine forever after.
    – warren
    Commented Jun 25, 2014 at 22:36

1 Answer 1

0

Try: yum upgrade-to package-5.1.3

2
  • Thanks Eran, its working as expected but I am not confidant enough to use upgrade-to instead of install, as updrage will delete obsolete packages. We use yum to install our packages in production environments. Is this is normal behavior or yum to always pick latest version even if you specify version number???
    – Sridhar
    Commented Jun 26, 2014 at 17:42
  • yum install will install the scpecific version you are asking for. In your example above, package-5.1.3-1 is already installed, so yum tried to upgrade. Note, however, that if you have a package foo that depends on bar, and you have 1.0 and 2.0 versions for both, if you run yum install foo-1.0 it will install bar-2.0 as dependency and not 1.0 because you didn't specify version for bar, so yum picks up the latest. In this case, use yum install bar-1.0 foo 1.0. Commented Jun 29, 2014 at 5:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .