Step 1
apt purge mongodb-org*
It solves the problem «trying to overwrite '/usr/bin/install_compass', which is also in package mongodb-org-tools 4.2.11»
Step 2
apt-get install gnupg curl
Step 3
curl -fsSL https://pgp.mongodb.com/server-6.0.asc | \
sudo gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg \
--dearmor
Step 4
Replace
with:
Step 5
apt-get update
mongodb.com/docs/v6.0/tutorial/install-mongodb-on-debian/#reload-local-package-database
Step 6
apt-get install mongodb-org
mongodb.com/docs/v6.0/tutorial/install-mongodb-on-debian/#install-the-mongodb-packages
Result
mongod --version