How do you install mongodb in Linux using apt-get command?
Here is a tutorial to learn how to install mongodb using apt-get command.
Step 1: Open terminal with su access and enter the command as shown below:
apt-get install mongodb -y
Step 2: After completion, the install command exits and instructs the user to restart the running instances of mongodb if it is running already.
Result of the Command Execution shown below:
root@hiox:~ apt-get install mongodb -y
Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
libmono data tds2.0 cil libsmbclient libpolkit backend 1 0
libmono c5 1.0 cil libplist1 libjna java jsvc libnet daemon perl
libpcsclite1 libtalloc2 libjaxp1.3 java libswscale0 libcdio10 libdb je java
hdparm libmono npgsql2.0 cil junit4 espeak libmono security2.0 cil
libgsf 1 common libmtp8 libmono addins gui0.2 cil libg15daemon client1
libnb apisupport1 java libmono wcf3.0 cil liboro java libgail18 libarchive1
libmono peapi2.0 cil libavutil49 libntfs10 libappframework java libpth20
libmono system data1.0 cil ttf dejavu extra liblcms1 libnb javaparser java
libhal storage1 libdb4.7 java libmono simd2.0 cil libmono system2.0 cil
libmono1.0 cil libcdio paranoia0 libgnome2 0 libmono system ldap1.0 cil
libxerces2 java libmono0 libcupsimage2 libiceutil33 gamin libgphoto2 port0
usbmuxd libsensors4 libgcj bc gcj 4.4 base libxxf86dga1
libmono getoptions1.0 cil libgudev 1.0 0 libgnomecanvas2 0
libmono cscompmgd8.0 cil libsamplerate0 libmono data1.0 cil libsnmp15
libmono sharpzip0.84 cil libmono sqlite2.0 cil libmono ldap1.0 cil
libnunit2.4 cil esound clients smbclient libjtidy java libbonobo2 common
libjzlib java libsgutils2 2 libprotobuf5 gnome mime data
libmono management2.0 cil libicu4j java x11 utils libmagickcore2
libfreemarker java libservlet2.4 java libdb4.7 java gcj rrdtool dnsutils
libcommons beanutils java libgnomeui 0 gvfs backends obex data server
libyaml syck perl libparted0debian1 libgluezilla libmono corlib2.0 cil
udisks libimobiledevice0 junit icedtea netx cli common libqt4 network
libmono system web mvc1.0 cil libqt4 dbus libasm2 java libxxf86vm1 libproxy0
libjack0 xterm default jdk doc libnm util1 libmono cairo2.0 cil libtagc0
libmono relaxng1.0 cil libgl1 mesa dri libbonobo2 0 libtdb1 libdbi perl
libmagickwand2 libgnomevfs2 common libavfilter0 libnb platform devel java
libgl1 mesa glx libspeex1 libdate manip perl munin node liblog log4perl perl
java common dosfstools libmono i18n west2.0 cil javahelp2 libwbclient0
librrd4 icedtea 6 jre cacao gcj 4.4 jre lib libsqlite0 libswingx java
libdotconf1.0 libmono microsoft7.0 cil default jre headless
libmono system messaging2.0 cil libhtml template perl libavdevice52
libmono system web1.0 cil libjs prototype libavahi glib1 gnome keyring
subversion openvpn blacklist policykit 1 libmono accessibility1.0 cil
libcommons logging java libmono webbrowser0.5 cil libmono posix2.0 cil
mysql server core 5.1 jetty mono runtime mtools libcanberra gtk module
libcommons compress java libcanberra0 openjdk 6 jre lib libsdl1.2debian alsa
libmono addins0.2 cil libgnome2.24 cil libswingworker java libwavpack1
libqt4 opengl libsoup gnome2.4 1 libmysqlclient16
libmono system runtime2.0 cil mono 2.0 devel libavcodec52 metacity common
libgcj10 jruby1.1 libfuse2 librrds perl mono csharp shell libgamin0
libsnmp base libqt4 sql sqlite libnss mdns librsvg2 common libg15render1
libsvn1 openjdk 6 jre headless libportaudio2 libavahi core6 libcue1
libnet cidr perl libindicator0 samba common libffi5 libgtkspell0
libmono i18n1.0 cil ant libmono oracle1.0 cil xbitmaps libnb platform11 java
libmono messaging2.0 cil libgp11 0 default jdk libmono rabbitmq2.0 cil
libjsch java libsvn java libgcr0 libjetty java doc libsdl1.2debian libxaw7
libgdu0 libxml commons resolver1.1 java libpkcs11 helper1 libcobertura java
libgnome2 common libhal1 default jre libjs scriptaculous
libmono winforms1.0 cil libmono db2 1.0 cil libdbusmenu glib1 ant optional
libqtcore4 binfmt support libesd0 libmono system data2.0 cil libgif4
libgnome vfs2.0 cil libcommons net java libresid builder0c2a libmono2.0 cil
libmono system ldap2.0 cil speech dispatcher libmono bytefx0.7.6.1 cil
mysql client core 5.1 libmono data tds1.0 cil libgnomevfs2 0 espeak data
mono gac libnm glib2 libsnmp session perl libxt dev libmono sharpzip2.6 cil
libmono getoptions2.0 cil tzdata java libmono data2.0 cil libevent 1.4 2
libdbusmenu gtk1 radiusclient1 libglade2.0 cil libmono npgsql1.0 cil
libgsf 1 114 libtheora0 libmono ldap2.0 cil
libmono messaging rabbitmq2.0 cil libmono security1.0 cil libopenobex1
libspeexdsp1 libnet server perl lm sensors libart2.0 cil python dbus
powermgmt base libdbd mysql perl libntfs 3g75 libneon27 gnutls ffmpeg
libmono peapi1.0 cil libglib2.0 cil libao2 mono 2.0 gac libpostproc51
liblzo2 2 libmono system1.0 cil policykit 1 gnome libxmu6 libcanberra gtk0
libvorbisfile3 libspeechd2 libqt4 sql esound common monodoc base libxpm4
libflac8 libqt4 svg libgconf2.0 cil libnb java3 java libservlet2.5 java
openssl blacklist libmono sharpzip0.6 cil libradius1
libmono cscompmgd7.0 cil libraw1394 11 libespeak1 libshout3 libgsm1
fancontrol libatasmart4 libservlet2.3 java libmono sqlite1.0 cil
libmono sharpzip2.84 cil libvorbisenc2 munin common libmpdclient2 libqt4 xml
libmono relaxng2.0 cil libschroedinger 1.0 0 libgs8 libavformat52
libmono microsoft build2.0 cil libslf4j java libcommons daemon java
libnfsidmap2 libdc1394 22 libmono dev psfontmgr python gobject ntfsprogs
libswing layout java ttf dejavu libplrpc perl libusbmuxd1 libappindicator0
libregexp java libgnomeui common libmono cecil private cil
libmono corlib1.0 cil wwwconfig common libgnome keyring0 libdaemon0
libsocket6 perl libxtst6 libsidplay2 libqtgui4 libmono microsoft8.0 cil
libg15 1 avahi daemon libzeroc ice33 libmono system web2.0 cil ghostscript
libtag1c2a librsvg2 2 libbonoboui2 0 libmono cairo1.0 cil libnet snmp perl
libmpg123 0 libmad0 libmono accessibility2.0 cil libpolkit agent 1 0
ant optional gcj libpq5 python support libgpgme11 libart 2.0 2 librpcsecgss3
libid3tag0 libavahi compat libdnssd1 ca certificates java
libio multiplex perl libcdio cdda0 libhamcrest java liblucene2 java
libgvfscommon0 libmono i18n west1.0 cil libpulse0 liboil0.3 openjdk 6 doc
libmono bytefx0.7.6.2 cil gvfs libcommons collections3 java
libbeansbinding java mono devel samba common bin libcelt0 0 libgcj common
openvpn libqt4 sql mysql netcat traditional fuse utils
libmono system messaging1.0 cil libexif12 libglu1 mesa libpaper utils
libvorbis0a libgtk2.0 cil libgssglue1 openjdk 6 jdk libmono posix1.0 cil
libmetacity private0 ant gcj libbonoboui2 common libcommons digester java
libaudio2 libxv1 portmap libini4j java libjson glib 1.0 0 libjetty java
openjdk 6 jre libmono i18n2.0 cil libmpcdec3 libpam gnome keyring
liblog4j1.2 java mysql common libnb svnclientadapter java
libmono oracle2.0 cil libjline java mysql server 5.1 gnome icon theme
libmono system runtime1.0 cil libusb 1.0 0 indicator application
javascript common ntfs 3g libsndfile1 libmng1 libbluetooth3 libnb ide12 java
dvb apps gsfonts libnunit cil dev libgnomecanvas2 common libgdiplus libmms0
libmono winforms2.0 cil libpaper1 libltdl7 mysql client 5.1 libmono cil dev
libsoup2.4 1 libio socket inet6 perl libgphoto2 2 libogg0 mono gmcs libfaad2
libtag1 vanilla libaudiofile0
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
mongodb
0 upgraded, 1 newly installed, 0 to remove and 76 not upgraded.
Need to get 0B/7,505kB of archives.
After this operation, 21.1MB of additional disk space will be used.
Selecting previously deselected package mongodb.
(Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 79590 files and directories currently installed.)
Unpacking mongodb (from .../mongodb_1%3a1.2.2 1ubuntu1.1_amd64.deb) ...
Processing triggers for ureadahead ...
Processing triggers for man db ...
Setting up mongodb (1:1.2.2 1ubuntu1.1) ...
mongodb start/running, process 11476
root@hiox:~