When attempting to install MongoDB 3.0 on Ubuntu 14.04 32-bit using the official repository, you might encounter the frustrating "Can't find package mongodb-org" error. This occurs even after properly setting up the repository:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo apt-get update
The root cause is simple but not immediately obvious: MongoDB 3.0 and later versions officially dropped support for 32-bit systems. While the documentation doesn't explicitly state this limitation, the repository only contains 64-bit packages.
When you check the repository contents with:
apt-cache search mongodb-org
You'll find no results for 32-bit systems, while the same command on a 64-bit system shows available packages.
If you absolutely need MongoDB 3.0 on a 32-bit system, you have these options:
Option 1: Use MongoDB 2.6 (Last 32-bit Version)
The easiest solution is to install the last MongoDB version with 32-bit support:
sudo apt-get install -y mongodb
This will install MongoDB 2.4. To get 2.6 specifically:
sudo apt-get install -y mongodb-org=2.6.12 mongodb-org-server=2.6.12 mongodb-org-shell=2.6.12 mongodb-org-mongos=2.6.12 mongodb-org-tools=2.6.12
Option 2: Compile from Source
For advanced users, compiling MongoDB 3.0 from source is possible but complex:
sudo apt-get install -y build-essential scons libssl-dev libboost-all-dev
git clone https://github.com/mongodb/mongo.git
cd mongo
git checkout r3.0.15
scons all
Note that this approach isn't recommended for production environments due to potential stability issues.
Option 3: Use a Different Distribution
Some community-maintained repositories might have 32-bit builds, though these aren't officially supported:
sudo add-apt-repository ppa:some-community/mongodb-32bit
sudo apt-get update
sudo apt-get install mongodb-org
Before proceeding with any of these solutions, consider:
- 32-bit MongoDB has a 2GB data limitation
- No official security updates for 32-bit versions
- Performance will be significantly worse than 64-bit
The best long-term solution is to upgrade to a 64-bit system if possible, as MongoDB's development is entirely focused on 64-bit architectures.
When attempting to install MongoDB 3.0 on Ubuntu 14.04 32-bit systems using the official repository, users encounter a "package not found" error despite following all documented steps. The key symptom is:
E: Unable to locate package mongodb-org
Examining the repository structure reveals the root cause:
deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse
The apt-get update
output shows:
Ign http://repo.mongodb.org trusty/mongodb-org/3.0 InRelease
Hit http://repo.mongodb.org trusty/mongodb-org/3.0 Release.gpg
Hit http://repo.mongodb.org trusty/mongodb-org/3.0 Release
Hit http://repo.mongodb.org trusty/mongodb-org/3.0/multiverse i386 Packages
Ign http://repo.mongodb.org trusty/mongodb-org/3.0/multiverse Translation-en
MongoDB 3.0 and later versions officially do not support 32-bit architectures for production use. This isn't clearly stated in the installation docs because:
- 32-bit systems have inherent memory limitations that conflict with MongoDB's requirements
- The WiredTiger storage engine (default since 3.2) requires 64-bit architecture
- Official packages are only built for x86_64 systems
For development purposes on 32-bit systems, consider these approaches:
Option 1: Compile from Source
sudo apt-get install -y build-essential libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-thread-dev scons libpcre++-dev libreadline-dev libssl-dev
wget https://fastdl.mongodb.org/src/mongodb-src-r3.0.15.tar.gz
tar -zxvf mongodb-src-r3.0.15.tar.gz
cd mongodb-src-r3.0.15
scons --32 --disable-warnings-as-errors --ssl all
sudo scons --prefix=/opt/mongodb install
Option 2: Use MongoDB 2.6
The last version with official 32-bit support:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install mongodb-10gen=2.6.12
For production environments:
- Upgrade to a 64-bit OS is strongly recommended
- Consider MongoDB Atlas for cloud deployment
- Evaluate alternative databases like PostgreSQL if architecture constraints persist
Check your architecture with:
uname -m
For i686/i386 results, you'll need the alternative solutions above.