Code in this video_How to Install MongoDB 6/7 Community Edition on Debian 11
sudo apt install curl gnupg -y 📌 for MongoDB 7 curl -fsSL https://pgp.mongodb.com/server-7.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor 📌 for MongoDB 6 curl -fsSL https://pgp.mongodb.com/server-6.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg --dearmor 📌 for MongoDB 7 echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] http://repo.mongodb.org/apt/debian bullseye/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list 📌 for MongoDB 6 echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg] http://repo.mongodb.org/apt/debian bullseye/mongodb-org/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list echo "mongodb-org hold" | sudo dpkg --set-selections ; echo "mongodb-org-database hold" | sudo dpkg --set-selections ; echo "mongodb-org-server hold" | sudo dpkg --set-selections ; echo "mongodb-mongosh hold" | sudo dpkg --set-selections ; echo "mongodb-org-mongos hold" | sudo dpkg --set-selections ; echo "mongodb-org-tools hold" | sudo dpkg --set-selections