2

I am trying to install mongodb on my laptop with Ubuntu 16.04 LTS. When I executed this command

echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list

this error showed up:

 sudo: unable to resolve host architect

Note: I have tried with [ arch=i686,i686 ] which is my pc architecture. What's the problem?

Kaz Wolfe
  • 33,802
  • 20
  • 111
  • 168
nurulnabi
  • 121
  • 2
  • 2
    does the error says architect or architecture? is it translated? – Zanna Jan 29 '17 at 19:06
  • This does **not** appear to be a duplicate. This is about *host architecture*, while the other question involves *hostname*. Also, the solution to the other question will definitely not work here. – earthmeLon Jan 29 '17 at 23:13
  • @earthmeLon Sudo doesn't handle anything regarding host architecture, but it does handle hostname lookups. – Kaz Wolfe Jan 29 '17 at 23:36
  • @Zanna AFAIK, `sudo` doesn't handle architecture management, so it should be impossible for `sudo` to error out on architecture, either. Further, one doesn't really resolve architectures. :P – Kaz Wolfe Jan 29 '17 at 23:39
  • @KazWolfe yeah I thought this post couldn't be about architecture really – Zanna Jan 30 '17 at 03:54

1 Answers1

1

I'm not sure where you got that command, but the following command would have worked:

echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list

Now that you already have /etc/apt/sources.list.d/mongodb-org-3.4.list, you need to edit it (ie: with vim or nano) so that contains a single line that reads:

deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse

Be sure to run apt-get update to sync and update available packages, and add 10gen's apt key.

earthmeLon
  • 11,042
  • 1
  • 36
  • 60