I'm downloading mongoDB on Linux Ubuntu Version 22.04.1 LTS, facing download error
I tried 3 solution from stack overflow discussion https://stackoverflow.com/questions/51417708/unable-to-install-mongodb-properly-on-ubuntu-18-04-lts, but still not work , keep facing
E: Unable to correct problems, you have held broken packages.
here are the 3 ways I tried:
(base) joy@joy-System-Product-Name:~$ sudo apt-get install -y mongodb-org
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
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.
I'm not sure what solution can perfectly solve my problem, that I need a hand here
more detail form beginning:
- 1.) I uninstall MongoDB, make sure no file or any stuff left
https://www.mongodb.com/basics/uninstall-mongodb
sudo service mongod stop
sudo apt-get purge mongodb-org*
sudo rm -r/var/log/mongodb /var/lib/mongodb
service mongod status
result:
(base) joy@joy-System-Product-Name:~$ sudo rm -r /var/log/mongodb /var/lib/mongodb
rm: cannot remove '/var/log/mongodb': No such file or directory
rm: cannot remove '/var/lib/mongodb': No such file or directory
(base) joy@joy-System-Product-Name:~$ service mongod status
Unit mongod.service could not be found.
- 2.) I tried the solution from discussion, first solution not work, still facing E: Package 'mongodb' has no installation candidate
(pic)I followed first solution -> failed
(base) joy@joy-System-Product-Name:~$ sudo apt-get purge mongodb-org*
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
... ...
... I skip a lot(Done) here ...
... ...
0 upgraded, 0 newly installed, 0 to remove and 96 not upgraded.
(base) joy@joy-System-Product-Name:~$ sudo apt-get install mongodb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package mongodb is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'mongodb' has no installation candidate
- 3.) Tried second solution not work, still facing E: Unable to correct problems, you have held broken packages.
tired second way to install
link- Install MongoDB Community Edition on Ubuntu
https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/
wget -qO - 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
sudo apt-get update
sudo apt-get install -y mongodb-org
The second way last step I face
E: Unable to correct problems, you have held broken packages.
I checked, I did't keep any file left
(base) joy@joy-System-Product-Name:~$ sudo apt-get install -y mongodb-org
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
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.
I list up all the file for what I have in linux cmd:
(pic) . list
, ls
for all the files
so is that I'm either facing
E: Package 'mongodb' has no installation candidate
or
E: Unable to correct problems, you have held broken packages.
(I assum I checked and deleted mongo file before run this)
when I tried about 10 solutions from discussions
tried use jammy
instead of focal
in
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
(pic)result 01
(pic)result 02
still facing:
E: Unable to correct problems, you have held broken packages.