How to update mongodb from 3.2 to 3.4.10

I’ve tried following a lot of guides on updating mongo but none are working. This was my latest attempt:

username:~/workspace (master) $ sudo apt-get install -y mongodb-org=3.4.10 mongodb-org-server=3.4.10 mongodb-org-shell=3.4.10 mongodb-org-mongos=3.4.10 mongodb-org-tools=3.4.10                                                                            
Reading package lists... Done
Building dependency tree       
Reading state information... Done
mongodb-org is already the newest version.
The following package was automatically installed and is no longer required:
Use 'apt-get autoremove' to remove it.
The following extra packages will be installed:
  mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools
0 upgraded, 0 newly installed, 0 to remove and 275 not upgraded.
2 not fully installed or removed.
How odd... The sizes didn't match, email
Need to get 9585 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 trusty/mongodb-org/3.2/multiverse mongodb-org-server amd64 3.2.10 [9585 kB]
Fetched 9585 kB in 0s (26.3 MB/s)           
Setting up mongodb-org-server (3.2.10) ...
invoke-rc.d: unknown initscript, /etc/init.d/mongod not found.
dpkg: error processing package mongodb-org-server (--configure):
 subprocess installed post-installation script returned error exit status 100
dpkg: dependency problems prevent configuration of mongodb-org:
 mongodb-org depends on mongodb-org-server; however:
  Package mongodb-org-server is not configured yet.

dpkg: error processing package mongodb-org (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Also I thought I had ubuntu 16, but I get this:

username:~/workspace (master) $ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.3 LTS
Release:        14.04
Codename:       trusty

Do I need to update my workspace somehow?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.