An upgrade from 'hirsute' to 'jammy' is not supported with this tool - upgrade

i was upgrading ubuntu 21.04 hirsute to 22.04 by following this tutorial ,in step 6 it's failing it's throwing an following error please help me to fix this issue
Reading cache
Checking package manager
Can not upgrade
An upgrade from 'hirsute' to 'jammy' is not supported with this tool.
https://linuxconfig.org/how-to-upgrade-ubuntu-to-22-04-lts-jammy-jellyfish

UPDATE: thanks to smknstd, JoeCool, MDarrinT and PurplProto.
Script is working again.
You can chose 3 different methods:
# First method, upgrade to 22.04 with the official ubuntu method ( old-releases.ubuntu.com )
# Replace sources.list
text="deb http://old-releases.ubuntu.com/ubuntu/ hirsute main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ hirsute-updates main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ hirsute-security main restricted universe multiverse"
sudo echo "$text" | sudo tee /etc/apt/sources.list
# Prerequisites
sudo apt-get update
sudo apt-get install update-manager-core update-manager -y
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
# Download and run the ubuntu upgrade tool
wget http://archive.ubuntu.com/ubuntu/dists/jammy-updates/main/dist-upgrader-all/current/jammy.tar.gz
tar -xaf jammy.tar.gz
sudo ./jammy --frontend=DistUpgradeViewText
-------------------------------++++++++++++++++++++++++--------------------------------
# Second method, upgrade to 22.04 replacing the entire sources.list with the jammy repos
# Replace sources.list
text="deb http://archive.ubuntu.com/ubuntu/ jammy main universe restricted multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jammy main universe restricted multiverse
deb http://security.ubuntu.com/ubuntu jammy-security main universe restricted multiverse
deb-src http://security.ubuntu.com/ubuntu jammy-security main universe restricted multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-updates main universe restricted multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main universe restricted multiverse"
sudo echo "$text" | sudo tee /etc/apt/sources.list
# Bypass "An upgrade from 'xxx' to 'xxx' is not supported with this tool" error
sudo sed -i 's/continue/pass/g' /usr/lib/python3/dist-packages/UpdateManager/Core/MetaRelease.py
# Start upgrade
sudo apt-get update
sudo do-release-upgrade
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
sudo apt-get install -f -y
sudo apt-get autoremove --purge -y
-------------------------------++++++++++++++++++++++++--------------------------------
# Third method, upgrade to 22.04 replacing the current distro codename with jammy into the sources.list with sed
# Replace sources.list
sudo sed -i 's/hirsute/jammy/g' /etc/apt/sources.list
# Bypass "An upgrade from 'xxx' to 'xxx' is not supported with this tool" error
sudo sed -i 's/continue/pass/g' /usr/lib/python3/dist-packages/UpdateManager/Core/MetaRelease.py
# Start upgrade
sudo apt-get update
sudo do-release-upgrade
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
sudo apt-get install -f -y
sudo apt-get autoremove --purge -y
LInk to the complete github script here.

Well, I tried the approach above. It failed.
Going through the script, I decided to check the Ubuntu server for the packages. Strange, there are all these NotFound errors. Guess what? The apt files referenced were missing from the Ubuntu server.
Then I went in and changed all the hirsute labels to jammy in the /etc/apt/sources.list file. Once I did that, apt ran. I could then run the script indicated above and have it find the packages.
Now, it works. A couple of messages about php-fpm not being enabled under Apache HTTP, but since I run nginx, I hope it works.
And it worked. I had to run through the apt upgrade && apt update && apt dist-upgrade && apt autoremove to clean out the detritus, but I have a working install on LTS.

Before running the script, I had to modify my sources.list (/etc/apt/sources.list) and comment-out all lines leaving only these:
## EOL upgrade sources.list
# Required
deb http://old-releases.ubuntu.com/ubuntu/ jammy main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
Then it went first to 'impish' and then to 'jammy' by running the script twice.
Or you can sudo do-release-upgrade after the first script; from 'impish' to 'jammy'.
Thank you and voted-up your answer.

official (unsupported) upgrade path from EOL is described here:
https://help.ubuntu.com/community/EOLUpgrades
and requires pointing apt to old-releases.ubuntu.com mirror

Related

How can I install Unity Hub on Ubuntu 22.04?

I have some troubles installing Unity Hub on my Ubuntu 22.04.
I've followed the instruction from official Unity site, but the hub seem not working well.
Only black screen is shown and nothing else.
I am very lost with it! :(
The following codes has been runned:
sudo sh -c 'echo "deb https://hub.unity3d.com/linux/repos/deb stable main" > /etc/apt/sources.list.d/unityhub.list'
wget -qO - https://hub.unity3d.com/linux/keys/public | sudo apt-key add -
sudo apt update
sudo apt-get install unityhub
Thank you for your reply!
To resolve this issue you can install libssl1.1
I was also facing the same issue so I made an script that make it easy to install Unity hub on Ubuntu latest versions
#!/bin/bash
#Lib issue Ubuntu
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb
chmod +x libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb
sudo dpkg -i libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb
echo "deb http://security.ubuntu.com/ubuntu impish-security main" | sudo tee /etc/apt/sources.list.d/impish-security.list
sudo apt-get update
sudo apt-get install libssl1.1
#unityhub
sudo sh -c 'echo "deb https://hub.unity3d.com/linux/repos/deb stable main" > /etc/apt/sources.list.d/unityhub.list'
wget -qO - https://hub.unity3d.com/linux/keys/public | sudo apt-key add -
sudo apt update
sudo apt-get install unityhub
HOW TO USE BASH
Make a file with install.sh on Desktop.
Paste this code on install.sh file.
Open Terminal in "Desktop" location.
type chmod +x install.sh then press Enter.
type ./install.sh and press Enter.
After all the installing, Restart PC and then run UnityHub.
Unity Editor fails to launch and complains about "no usable version of libssl was found"
Ubuntu 22.04 now ships with libssl3 by default and does not include libssl1.1. Unity currently uses .NET5 which requires libssl1.1. To
work around this issue you can install libssl1.1 from an older Ubuntu
release
https://packages.ubuntu.com/bionic/amd64/libssl1.1/download
In a terminal:
echo "deb http://security.ubuntu.com/ubuntu impish-security main" | sudo tee /etc/apt/sources.list.d/impish-security.list
sudo apt-get update
sudo apt-get install libssl1.1

postgresql-client-13 : Depends: libpq5 (>= 13~beta2) but 12.3-1.pgdg18.04+1 is to be installed

I want to try new PostgreSQL and follow this instruction. But installation fails:
$ sudo apt install postgresql-client-13
Reading package lists... Done
Building dependency tree
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:
postgresql-client-13 : Depends: libpq5 (>= 13~beta2) but 12.3-1.pgdg18.04+1 is to be installed
E: Unable to correct problems, you have held broken packages.
I also tried this instruction to resolve unmet dependencies
What did I wrong and how to install psql 13?
UPD
Content of my sources.list.d:
kes#kes-X751SA /etc/apt/sources.list.d $ cat pgdg.list
deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main
kes#kes-X751SA /etc/apt/sources.list.d $ cat pgdg-testing.list
deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg-testing main 13
Also:
$ sudo apt-cache policy postgresql-13
postgresql-13:
Installed: (none)
Candidate: 13~beta2-1.pgdg18.04+1
Version table:
13~beta2-1.pgdg18.04+1 100
100 http://apt.postgresql.org/pub/repos/apt bionic-pgdg-testing/13 amd64 Packages
Had the same problem.
in /etc/apt/sources.list.d/pgdg.list where you have
deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main
change it to
deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main 13
then run
sudo apt update
and then you can do
sudo apt install postgresql-13 postgresql-client-13
that worked on my machine.
Just FYI:
WARNING: The data format may change between beta releases. Be prepared
to pg_dump the database contents before you upgrade the package to a
newer beta or to a final release. Check the release notes before
upgrading.
try aptitude instead of apt-get
sudo apt-get install aptitude
sudo aptitude install <package-name>
https://askubuntu.com/a/1056378/1087086
Finally at my docker container I do next commands:
RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN yum -y install llvm5.0-devel
RUN yum -y install centos-release-scl-rh
RUN yum -y install llvm-toolset-7-clang
#RUN rpm -Uvh https://yum.postgresql.org/11/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm --replacepkgs
#RUN yum-config-manager --enable pgdg13-updates-testing
RUN yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
RUN yum -y install postgresql13 postgresql13-devel
Commented out lines were for case before 13.1 was released

How to upgrade Visual Studio Code editor?

What's the best way to upgrade Visual Studio Code on Linux Ubuntu?
For the time being I was periodically getting the newest version (.deb) from their official site: https://code.visualstudio.com/
sudo dpkg -i code_*.deb
Visual Studio Code enabled official Linux repositories on February 2017 (v1.10)
sudo add-apt-repository -y "deb https://packages.microsoft.com/repos/vscode stable main "
sudo apt update
sudo apt -y install code
You can upgrade / dist-upgrade as usual
sudo apt -y upgrade
sudo apt -y dist-upgrade
[1]: download the latest vscode (.deb) package to your computer on this
link :
https://go.microsoft.com/fwlink/?LinkID=760868
, or this there :
https://code.visualstudio.com/docs/
[2]: then open a terminal in the folder where you downloaded the .deb file and write:
sudo dpkg -i <the downloaded file>.deb
[3]: finally if you have apt-get do (if not install apt-get first):
sudo apt-get install -f
If you have installed it via the repository, exit VS Code then just do:
sudo apt update
sudo apt install code
This is the same command to install or upgrade to the latest version. You can see the version with:
code --version
Now the easiest and recommended way is to use snap:
sudo snap install --classic code
And updates are supposed to be automatic.
This works fine in ubuntu.
sudo apt-get update
sudo apt-get install code
When you install VSCode with the file .deb on Ubuntu 20.08, first, remove it:
sudo apt-get remove code
Add the repository in this link https://code.visualstudio.com/docs/setup/linux
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
Udate the package cache and reinstall
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install code
In the next time when you want to upgrade, just do:
sudo apt-get update
sudo apt-get upgrade code
Because your repository is missing information to upgrade VSCode, the above solution will fix it.
This is what I did to avoid the annoying message:
Remove vscode, if you already installed it.
sudo apt-get remove code
Add repositories, update and install:
sudo add-apt-repository -y "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main "
sudo apt update
sudo apt -y install code
If you have already installed VS code, go to the terminal and type two different commands:
sudo apt update
sudo apt-get upgrade code
The following commands work for me (for Linux) :
wget 'https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64' -O /tmp/code_latest_amd64.deb
sudo dpkg -i /tmp/code_latest_amd64.deb
Place those two commands into an executable Bash script called auto-update-VSCode, and you can simply run that from your shell any time Visual Studio Code says it's out of date.
I'm running Ubuntu 20.04 and this worked perfectly for me:
$ wget https://vscode-update.azurewebsites.net/latest/linux-deb-x64/stable -O /tmp/code_latest_amd64.deb
$ sudo dpkg -i /tmp/code_latest_amd64.deb
Best way to update Vscode in Ubuntu:
sudo apt-get update
sudo apt-get install code
sudo apt-get update
sudo apt-get install code

error in installing libpq-dev in ubuntu 14.04 after installing psycopg2

I am trying to install all requirements of a project so i run the command
pip install -r requirements.txt
but it gives the error
Downloading/unpacking psycopg2==2.6 (from -r requirements.txt (line 58))
Downloading psycopg2-2.6.tar.gz (367kB): 367kB downloaded
Running setup.py (path:/tmp/pip_build_root/psycopg2/setup.py) egg_info for package psycopg2
Error: b'You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.\n'
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
Error: b'You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.\n'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/psycopg2
Storing debug log for failure in /home/admin/.pip/pip.log
now i knew that i have to install postgresql-server so i used following command
sudo apt-get install postgresql
all good till now and then i ran
sudo apt-get install python-psycopg2
and then i ran my command to install requirements again but got the same error and then i searched on google and tried
sudo apt-get install libpq-dev
but i got following error
Reading package lists... Done
Building dependency tree
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:
libpq-dev : Depends: krb5-multidev but it is not going to be installed
Depends: comerr-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
now i am unable to detect and correct broken package...please help me...
I ran the following commands to repair broken package and then i successfully installed Psycopg2 and Postgresql ...
sudo apt-get update
sudo apt-get install python-dev
sudo apt-get install libpq-dev
sudo apt-get install krb5-multidev
sudo apt-get install libssl1.0.0=1.0.1f-1ubuntu2 ibcomerr2=1.42.9-3ubuntu1
sudo apt-get install libssl1.0.0=1.0.1f-1ubuntu2
sudo apt-get install ibcomerr2=1.42.9-3ubuntu1
sudo apt-get update
sudo apt-get install libpq-dev
apt-get install libssl-dev krb5-multidev comerr-dev
sudo apt-get install libssl-dev krb5-multidev comerr-dev
sudo apt-get dist-upgrade
sudo apt-get update
sudo apt-get install libssl-dev krb5-multidev comerr-dev
sudo apt-get install libcomerr2
sudo apt-get install comerr-dev
sudo apt-get install libcomerr2
sudo apt-get install comerr-dev
sudo apt-get install comerr-dev
sudo apt-get install 1.42.9-3ubuntu1.3
sudo apt-get install ibcomerr2=1.42.9-3ubuntu1
sudo apt-get install git
git clone https://github.com/kos0/addRemoveDistribution.git
cd addRemoveDistribution
sudo ./enableDisableDistribution.pl enable security
sudo ./enableDisableDistribution.pl enable updates
sudo apt-get update
sudo apt-get install libpq-dev
sudo apt-get update
pip install -r requirements.txt
Just follow only Steps
sudo apt-get install git
git clone https://github.com/kos0/addRemoveDistribution.git
cd addRemoveDistribution
sudo ./enableDisableDistribution.pl enable security
sudo ./enableDisableDistribution.pl enable updates
sudo apt-get update
sudo apt-get install libpq-dev
sudo apt-get update
I Fixed issue by those above steps

E: Unable to locate package mongodb-org

I am trying to download mongodb and I am following the steps on this link.
But when I get to the step:
sudo apt-get install -y mongodb-org
I get the following error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mongodb-org //This is the error
Why is this occurring and is there a work around?
I have faced the same issue but then fixed it by the changing the package file section command. The steps that I followed were:
First try with this command:
sudo apt-get install -y mongodb
This is the unofficial mongodb package provided by Ubuntu and it is not maintained by MongoDB and conflicts with MongoDB’s officially supported packages.
If the above command doesn't work then you can fix the issue by one of the following procedures:
Step 1: Import the MongoDB public key
In Ubuntu 18.*+, you may get invalid signatures. --recv value may need to be updated to EA312927.
See here for more details on the invalid signature issue: MongoDB GPG - Invalid Signatures
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
Step 2: Generate a file with the MongoDB repository url
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
Step 3: Refresh the local database with the packages
sudo apt-get update
Step 4: Install the last stable MongoDB version and all the necessary packages on our system
sudo apt-get install mongodb-org
Or if the unofficial mongodb package provided by Ubuntu is not maintained by MongoDB and conflict with MongoDB’s officially supported packages. Use the official MongoDB mongodb-org packages, which are kept up-to-date with the most recent major and minor MongoDB releases.
sudo apt-get install -y mongodb
Hope this will work for you also. You can follow this MongoDB
Update
The above instruction will install mongodb 2.6 version, if you want to install latest version for Ubuntu 12.04 then just omit the above step 2 and follow below instruction instead of that:
Step 2: Generate a file with the MongoDB repository url
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb.list
If you are using Ubuntu 14.04 then use bellow step instead of above step 2
Step 2: Generate a file with the MongoDB repository url
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
The true problem here may be if you have a 32-bit system. MongoDB 3.X was never made to be used on a 32-bit system, so the repostories for 32-bit is empty (hence why it is not found). Installing the default 2.X Ubuntu package might be your best bet with:
sudo apt-get install -y mongodb
Another workaround, if you nevertheless want to get the latest version of Mongo:
You can go to
https://www.mongodb.org/downloads
and use the drop-down to select "Linux 32-bit legacy"
But it comes with severe limitations...
This 32-bit legacy distribution does not include SSL encryption and is
limited to around 2GB of data. In general you should use the 64 bit
builds. See here for more information.
Try without '-org':
sudo apt-get install -y mongodb
Worked for me!
I'm running Ubuntu 14.04; and apt still couldn't find package; I tried all the answers above and more.
The URL that worked for me is this:
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
Source: http://www.liquidweb.com/kb/how-to-install-mongodb-on-ubuntu-14-04/
All steps are correct just change the Step 4 as below
Step 4: Install the last stable MongoDB version and all the necessary packages on our system
Command: sudo apt-get install mongodb
It has worked for me.
If you are currently using the MongoDB 3.3 Repository (as officially currently suggested by MongoDB website) you should take in consideration that the package name used for version 3.3 is:
mongodb-org-unstable
Then the proper installation command for this version will be:
sudo apt-get install -y mongodb-org-unstable
Considering this, I will rather suggest to use the current latest stable version (v3.2) until the v3.3 becomes stable, the commands to install it are listed below:
Download the v3.2 Repository key:
wget -qO - https://www.mongodb.org/static/pgp/server-3.2.asc | sudo apt-key add -
If you work with Ubuntu 12.04 or Mint 13 add the following repository:
echo "deb http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
If you work with Ubuntu 14.04 or Mint 17 add the following repository:
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
If you work with Ubuntu 16.04 or Mint 18 add the following repository:
echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
Update the package list and install mongo:
sudo apt-get update
sudo apt-get install -y mongodb-org
The currently accepted answer works, but will install an outdated version of Mongo.
The Mongo documentation states that: MongoDB only provides packages for Ubuntu 12.04 LTS (Precise Pangolin) and 14.04 LTS (Trusty Tahr). However, These packages may work with other Ubuntu releases.
So, to get the lastest stable Mongo (3.0), use this (the different step is the second one):
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb.list
apt-get update
apt-get install mongodb-org
Hope this helps.
I would like to add that as a previous step, you must check your GNU/Linux Distro Release, which will construct the Repo list url. For me, as I am using this:
DISTRIB_CODENAME=rafaela
DISTRIB_DESCRIPTION="Linux Mint 17.2 Rafaela"
NAME="Ubuntu"
VERSION="14.04.2 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.2 LTS"
The original 2nd step:
"Create a list file for MongoDB": "echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list"
Didn't work as intended because it generated an incorrect Repo url. Basically, it put the distribution codename "rafaela" within the url repo which doesn't exist. You can check the Repo url at your package manager under Software Sources, Additional Repositories.
What I did was to browse the site:
http://repo.mongodb.org/apt/ubuntu/dists/
And I found out that for Ubuntu, "trusty" and "precise" are the only web folders available, not "rafaela".
Solution: Open as root the file 'mongodb-org-3.1.list' or 'mongodb.list' and replace "rafaela" or your release version for the corresponding version (for me it was: "trusty"), save the changes and continue with next steps. Also, your package manager can let you change easily the repo url as well.
Hope it works for you.! ---
You first need to add the package database and add the PGP key.
Run the following.
#add pgp key
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
#add package file
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
#update package list
sudo apt-get update
#install mongo
sudo apt-get install -y mongodb-org
I had the same issue in 14.04, but I fixed it by these steps:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb- org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo apt-get update
sudo apt-get install -y mongodb
It worked like charm :)
sudo apt-get install -y mongodb
it works for 32-bit ubuntu, try it.best of luck.
This worked on Ubuntu 17.04
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
sudo apt-get update
sudo apt-get install -y mongodb-org
If you see a failure like:
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-tools_3.6.2_amd64.deb (--unpack):
trying to overwrite '/usr/bin/bsondump', which is also in package mongo-tools 3.2.11-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Then run this command:
echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" |
sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
and
sudo apt update
sudo apt install mongodb-org
References:
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
I had the same problems on Ubuntu 16.04 when I followed the steps posted on the official document.
Then I remove the text "[ arch=amd64,arm64 ]" in step2 and it works for me.
echo "deb https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
apt-get install -y mongodb-org