5

I had mongodb 2.6.11 installed on my CentOS sandbox server.

Dec 03 22:24:38 Updated: mongodb-org-mongos-2.6.11-1.x86_64
Dec 03 22:25:07 Updated: mongodb-org-tools-2.6.11-1.x86_64
Dec 03 22:25:08 Updated: mongodb-org-shell-2.6.11-1.x86_64
Dec 03 22:26:39 Updated: mongodb-org-server-2.6.11-1.x86_64
Dec 03 22:29:37 Updated: mongodb-org-2.6.11-1.x86_64

I wanted to upgrade that sandbox to the latest mongodb version. So, I followed the directions here:

https://docs.mongodb.com/master/tutorial/install-mongodb-on-red-hat/

In particular, I had to create a /etc/yum.repos.d/mongodb-org-3.4.repo file. That worked fine.

# mongod -version
db version v3.4.2

Now, I'd like to convince myself that I can downgrade mongodb back to version 2.6.11 if I needed to.

When I try to downgrade I get an error:

# yum downgrade mongodb-org
Error: Package: mongodb-org-3.4.1-1.el6.x86_64 (mongodb-org-3.4)
      Requires: mongodb-org-mongos = 3.4.1
      Installed: mongodb-org-mongos-3.4.2-1.el6.x86_64 (@mongodb-org-3.4)
          mongodb-org-mongos = 3.4.2-1.el6
      Available: mongodb-org-mongos-2.6.0-0.1.rc0.x86_64 (mongodb)
          mongodb-org-mongos = 2.6.0-0.1.rc0
      . . . . . 
      Available: mongodb-org-mongos-2.6.12-1.x86_64 (mongodb)
           mongodb-org-mongos = 2.6.12-1
      Available: mongodb-org-mongos-3.4.0-1.el6.x86_64 (mongodb-org-3.4)
           mongodb-org-mongos = 3.4.0-1.el6
      Available: mongodb-org-mongos-3.4.1-1.el6.x86_64 (mongodb-org-3.4)
           mongodb-org-mongos = 3.4.1-1.el6
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

The skip-broken suggestion failed.

# yum downgrade --skip-broken mongodb-org
Loaded plugins: fastestmirror
Setting up Downgrade Process
Repository 'CentOS-EPEL' is missing name in configuration, using id
Loading mirror speeds from cached hostfile
* CentOS-EPEL: mirrors.xmission.com
* base: mirror.raystedman.net
* extras: denver.gaminghost.co
* updates: mirror.sesp.northwestern.edu
Resolving Dependencies
--> Running transaction check
---> Package mongodb-org.x86_64 0:3.4.1-1.el6 will be a downgrade
--> Processing Dependency: mongodb-org-tools = 3.4.1 for package:  mongodb-org-3.4.1-1.el6.x86_64
--> Processing Dependency: mongodb-org-shell = 3.4.1 for package: mongodb-org-3.4.1-1.el6.x86_64
--> Processing Dependency: mongodb-org-server = 3.4.1 for package: mongodb-org-3.4.1-1.el6.x86_64
--> Processing Dependency: mongodb-org-mongos = 3.4.1 for package: mongodb-org-3.4.1-1.el6.x86_64
---> Package mongodb-org.x86_64 0:3.4.2-1.el6 will be erased

Packages skipped because of dependency problems:
    mongodb-org-3.4.1-1.el6.x86_64 from mongodb-org-3.4

In /etc/yum.repos.d I now have two .repo files:

mongodb-org-3.4.repo
mongodb.repo

mongodb.repo has this:

[mongodb]
gpgcheck=0
name=MongoDB/10gen Repository
enabled=1
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/

And, mongodb-org-3.4.repo, has this:

[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc

How can I get back to mongodb 2.6.11?

Update: 2/24/17

I was able to remove the five mongo packages.

# rpm -qa | grep mongo
mongodb-org-mongos-3.4.2-1.el6.x86_64
mongodb-org-tools-3.4.2-1.el6.x86_64
mongodb-org-server-3.4.2-1.el6.x86_64
mongodb-org-shell-3.4.2-1.el6.x86_64
mongodb-org-3.4.2-1.el6.x86_64

# yum remove mongodb-org
# yum remove mongodb-org-shell
# yum remove mongodb-org-mongos
# yum remove mongodb-org-tools
# yum remove mongodb-org-server

And then I renamed the 3.4 mongo .repo file:

# cd /etc/yum.repos.d
# mv mongodb-org-3.4.repo mongodb-org-3.4.repo.NOT
# yum install mongodb

Then I installed mongodb (because I got the familiar conflicts trying to install mongodb-org).

# mongo  -version
MongoDB shell version: 2.4.14

But, I'm still stuck as I couldn't install all of the mongo packages in mongodb-org and, when I tried to upgrade mongo, hoping to get to 2.6.11, I'm told that no packages are marked for upgrade.

Sol
  • 347
  • 1
  • 4
  • 12

1 Answers1

2

you should use the asterisk in the query for include all related dependencies in downgrade process:

yum downgrade 'mongodb-org*'

(The quotes prevent the shell from trying to expand the wildcard.)

Andrew Schulman
  • 8,811
  • 21
  • 32
  • 47