E: Unable to correct problems, you have held broken packages. – MongoDB Installation Ubuntu 22.04

E: Unable to correct problems, you have held broken packages. – MongoDB Installation Ubuntu 22.04

Solution/ Fix of the following errors
The following packages have unmet dependencies:
mongodb-org-mongos : Depends: libssl1.1 (>= 1.1.1) but it is not installable
mongodb-org-server : Depends: libssl1.1 (>= 1.1.1) but it is not installable
E: Unable to correct problems, you have held broken packages.

FYI: I have used the following solution on digital ocean droplet. It should work on any server with Ubuntu 22.04

GET MERN OR NODE.JS application installed on your Ubuntu server for 49.99$ only

MongoDB 6.0 Installation on Ubuntu 22.04
curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add –

echo “deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse” | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list

Install libSSL

curl -LO http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb

sudo dpkg -i ./libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb

Install Mongodb
sudo apt install -y mongodb-org

Check version
mongod -version

Start Mongodb
sudo systemctl start mongod

Check Status
sudo systemctl status mongod

Enable on boot
sudo systemctl enable mongod

Enter in to MongoDB Shell
mongosh
show dbs

Previous Post
Fetch WordPress Blog Posts – Next.js (Server Side Props)
Next Post
5 Reasons Why Shopify is the Best E-Commerce Platform for Your Business