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.
.list
file that includes the MongoDB repository? This will make it easier to verify – matigo Oct 12 '22 at 04:47ls
, andls -a
in linux to list up all the files that I post in question, I don't think I have MongoDB repository, cause I checked bysudo rm -r /var/log/mongodb /var/lib/mongodb
showsrm: cannot remove '/var/log/mongodb': No such file or directory rm: cannot remove '/var/lib/mongodb': No such file or directory
– j ton Oct 12 '22 at 06:22jammy
, shouldn't you usejammy
instead offocal
. I.e.,echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
– rickhg12hs Oct 12 '22 at 07:12apt-key
has been deprecated so the key that MongoDB supplies isn't ready for the newtrusted=keyfile
that is supposed to be used on the repo linedeb [arch=amd64 trusted=keyfile] ...
way of setting up the repos. I have been successful with still usingapt-key
, but that method will be going away, so I was looking for a more permanent solution. – Terrance Oct 12 '22 at 13:11/etc/apt/source.list.d/
directory then reupdate the sources withsudo apt update
and then try your installation again. However, I do think that with MongoDB 6.0 it is under a different name now as it installs the server asmongos
and notmongod
like in the past. The installation name I think is still the same asmongodb-org
for the apt name. – Terrance Oct 12 '22 at 17:39mongodb-org
for install. You will have to use the Focal repo formongod
and version 6.0.2. – Terrance Oct 13 '22 at 00:35