Updates can only be done for the next major version. If you want do update from 6 to 8, you need to do it in two steps.
To update a local mongodb you have to do the following steps:
- Check/Set Feature Compatibility Version: Upgrade from 7 to 8
- Stop mongod:
sudo systemctl stop mongod - Uninstall mongod:
sudo apt-get purge "mongodb-org*" - Install new version: Install Version 8
- Check Version:
mongod -version - Start service:
sudo systemctl start mongod