6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MongoDB 2.4(古いバージョン)をCentOSにインストール

Posted at

プロジェクトでMongoDBの2.4という少し古めのバージョンを使っていて、これに合わせたVM環境を構築した時のメモ。

インストール手順

MongoDBマニュアルのインストール手順に書いてある通りにyumリポジトリを追加。

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

yum listでパッケージ名を確認してみる。

$ yum list | grep mongo
mongo-10gen.x86_64                        2.4.12-mongodb_1               mongodb
mongo-10gen-server.x86_64                 2.4.12-mongodb_1               mongodb
:
mongodb-org.x86_64                        2.6.7-1                        mongodb
mongodb-org-mongos.x86_64                 2.6.7-1                        mongodb
mongodb-org-server.x86_64                 2.6.7-1                        mongodb
mongodb-org-shell.x86_64                  2.6.7-1                        mongodb
mongodb-org-tools.x86_64                  2.6.7-1                        mongodb
:

mongo-10gen-2.4.12とmongo-10gen-server-2.4.12を指定してインストールしようとしても2.6にアップデートしようとするのでキャンセル。

$ sudo yum install mongo-10gen-2.4.12 mongo-10gen-server-2.4.12
:
Setting up Install Process
Package mongo-10gen is obsoleted by mongodb-org, trying to install mongodb-org-2.6.7-1.x86_64 instead
Package mongo-10gen-server is obsoleted by mongodb-org-server, trying to install mongodb-org-server-2.6.7-1.x86_64 instead
:
==========================================================================================================
 Package                          Arch                 Version                Repository             Size
==========================================================================================================
Installing:
 mongodb-org                      x86_64               2.6.7-1                mongodb               4.6 k
 mongodb-org-server               x86_64               2.6.7-1                mongodb               9.0 M
Installing for dependencies:
 mongodb-org-mongos               x86_64               2.6.7-1                mongodb               6.8 M
 mongodb-org-shell                x86_64               2.6.7-1                mongodb               4.3 M
 mongodb-org-tools                x86_64               2.6.7-1                mongodb                90 M

さっきのページの下のほうに書いてある通り、アップデート対象からmongodb-orgを除外する。

/etc/yum.conf
exclude=mongodb-org,mongodb-org-server,mongodb-org-shell,mongodb-org-mongos,mongodb-org-tools

再度、mongo-10genを指定して実行すると、2.4がインストールできる。

$ sudo yum install mongo-10gen-2.4.12 mongo-10gen-server-2.4.12
:
==========================================================================================================
 Package                        Arch               Version                      Repository           Size
==========================================================================================================
Installing:
 mongo-10gen                    x86_64             2.4.12-mongodb_1             mongodb              72 M
 mongo-10gen-server             x86_64             2.4.12-mongodb_1             mongodb              12 M
6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?