Installing mongodb 3.2 in Codio using the built-in Terminal (Ubuntu 14.04.3) - mongodb

I am trying to install mongodb 3.2 into codio using the terminal and I am following the guide on their website here. (I'm new to mongodb and nosql)
I got to Step 4 Installing mongodb using this command:
sudo apt-get install -y mongodb-org
Got the following at the end:
..
The following packages will be upgraded:
mongodb-org
1 upgraded, 0 newly installed, 0 to remove and 51 not upgraded.
2 not fully installed or removed.
Need to get 3,554 B of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://repo.mongodb.org/apt/ubuntu/ trusty/mongodb-org/3.2/multiverse mongodb-org amd64 3.2.2 [3,554 B]
Fetched 3,554 B in 0s (249 kB/s)
(Reading database ... 37250 files and directories currently installed.)
Preparing to unpack .../mongodb-org_3.2.2_amd64.deb ...
Unpacking mongodb-org (3.2.2) over (3.2.1) ...
Setting up mongodb-org-server (3.2.2) ...
start: Job failed to start
invoke-rc.d: initscript mongod, action "start" failed.
dpkg: error processing package mongodb-org-server (--configure):
subprocess installed post-installation script returned error exit status 1
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:
mongodb-org-server
mongodb-org
E: Sub-process /usr/bin/dpkg returned an error code (1)
Then I run
sudo service mongod start
or
sudo service mongodb start
Both commands will response with start: Job failed to start or mongodb: unrecognized service
Am I missing something here like e.g. mongodb requires other packages to be installed? following wrong guide version? do I need to create config file? if I do how? because it did not create one, or mongodb doesn't work on codio using the built-in terminal? Is mongodb-org-server already installed or running? I've been searching for exact or similar things, also tried different command but no luck.

This is because of the ulimit settings in the service script of mongod.
Mongodb recommends 64000 for 'open files' key in ulimit settings.
https://docs.mongodb.org/manual/reference/ulimit/#recommended-settings
In codio this is set to 4096.
run the below command in codio terminal and see the 'open files' setting.
ulimit -a
I don't think this value can be changed at OS level in codio. However, we can remove this setting (NOT recommended by MongoDb) from the upstart file.
Steps:
1. To keep it simple and less verbose, start with installing just mongodb-org-server instead of installing the complete mongodb-org.
sudo apt-get install -y mongodb-org-server
2. As we know it fails with errors - '..Job failed to start ..' bla..bla. Just ignore them for a min. Edit '/etc/init/mongod.conf' file as root in whatever editor you like. I like vim. :)
sudo vim /etc/init/mongod.conf
3. Comment out(type '#' at the beginning of the line) the line starts with 'limit nofile' as below. Then save and close the file.
#limit nofile 64000 64000
4. Now install the complete 'mongodb-org' package by running the command in terminal as shown below.
sudo apt-get install -y mongodb-org
5. Go ahead try mongo in terminal now. If the mongod service is running, it connects to the default db successfully.
Hope this helps.
Thank you.

Related

Installing Vivado ML 2021.2 in CentOs but process is hang in 'Generating installed device list'

anybody can help me figure out why the installation is hanging on 'Generating installed device list' and how to solve it without starting the process all over. I am working on CentOs.
Thanks in advance
I think this happens due to following missing packages:
libstdc++6:i386
libgtk2.0-0:i386
dpkg-dev:i386
ncurses5-compat-libs
python3-pip
libtinfo5
libncurses5
As BKN mentioned, you need to install the missing packages.
To avoid starting all over again, you can do the following:
Check the log: cat ~/.Xilinx/xinstall/*.log
Locate the error message. It should look something like:
2022-01-09 10:53:11,458 DEBUG: n.t:? - Executing script Generating installed device list: /tools/Xilinx/Vivado/2021.2/bin/vivado [-nolog, -nojournal, -mode, batch, -source, /tools/Xilinx/Vivado/2021.2/scripts/sysgen/tcl/xlpartinfo.tcl, -tclargs, /tools/Xilinx/Vivado/2021.2/data/parts/installed_devices.txt]
2022-01-09 12:05:35,319 DEBUG: n.t:? - Unable to run GenerateDevListFileLin, exit code: 130, stdout: , stderr: application-specific initialization failed: couldn't load file "librdi_commontasks.so": libtinfo.so.5: cannot open shared object file: No such file or directory failure msg:
application-specific initialization failed: couldn't load file "librdi_commontasks.so": libtinfo.so.5: cannot open shared object file: No such file or directory
2022-01-09 12:05:35,319 DEBUG: n.t:? - Executing script Generating installed device list for Model Composer: /tools/Xilinx/Vivado/2021.2/bin/vivado [-nolog, -nojournal, -mode, batch, -source, /tools/Xilinx/Model_Composer/2021.2/data/xmcGenBoardParts.tcl, -tclargs, /tools/Xilinx/Model_Composer/2021.2/../../Vivado/2021.2, librdi_dsp_tcltasks.so, /tools/Xilinx/Model_Composer/2021.2/data]
The log informs you exactly what the missing package is (in this case it was libtinfo), and also provides you with the script to run after you install the package:
/tools/Xilinx/Vivado/2021.2/bin/vivado -nolog -nojournal -mode batch -source /tools/Xilinx/Vivado/2021.2/scripts/sysgen/tcl/xlpartinfo.tcl -tclargs /tools/Xilinx/Vivado/2021.2/data/parts/installed_devices.txt
Notes:
Make sure to use the Vivado version (here it was 2021.2) and location (here it was /tools/Xilinx) according to your system.
You may need to run the script in sudo if the the permissions for writing are not available in user mode.
I also encounterd this problem on Archlinux with Vivado 2018.3.
But I just installed the library ncurses5-compat-libs, then the problem is solved.
Perhaps you can solve this by checking the library ncurses5-compat-libs.
Download the tar package instead of the self-extracting bin package
Update the java and python version
sudo apt-get install -y python3-pip
Install Dependencies
sudo apt-get install -y libstdc++6
sudo apt-get install -y libgtk2.0-0
sudo apt-get install -y dpkg-dev
NOTE: Without ibtinfo5 the application will not start and without libncurses5 the simulation will fail
`sudo apt-get install -y libtinfo5 libncurses5`
Restart the system
Untar that Vivado package
tar -xzvf Xilinx_Unified_2021.2_1021_0703.tar.gz
Locate the xsetup file in the package
Install the package in batch mode
./xsetup --agree 3rdPartyEULA,XilinxEULA --batch Install --product "Vivado" --edition "Vivado ML Enterprise" --location "/home/USER"
Once the installation has been successfully completed
Locate the settings64.sh file
./settings64.sh
Locate the cable drivers
cd Vivado/2021.2/data/xicom/cable_drivers/lin64/install_scripts/install_drivers
./install_drivers
Installing Vivado Board Files
Get the board package from the git https://github.com/Digilent/vivado-boards.git
From the vivado-board-master package copy the folder board_files undert /vivado-board-master/new/board_files
Paste the board files to Vivado/2021.2/data/boards
From the vivado-board-master package copy the file Vivado_init.tcl under /vivado-board-master/utility
Paste the file Vivado_init.tcl to the Vivado installation
That's it!! You might not need to do all these steps but that is what I ended up doing and it worked for the two machines where I installed Vivado. The installation took less than one hour.
This was originally edited into the question itself by the OP.

Install postgres on Ubuntu18 on AWS

I need to run a shell script on my new Ubuntu machine in AWS which has the following command:
sudo apt-get install postgresql postgresql-contrib
But, due to some restrictions, I don't want to go to internet to do that. So, I downloaded the below two .debs and scp them to the box.
postgresql_12+213.pgdg18.04+1_all.deb
postgresql-contrib_12+213.pgdg18.04+1_all.deb
And , in the shell script, I replaced the above command with the below:
sudo dpkg -i postgresql_12+213.pgdg18.04+1_all.deb
sudo dpkg -i postgresql-contrib_12+213.pgdg18.04+1_all.deb
Now, while executing the script, i got the below error:
(Reading database ... 56588 files and directories currently installed.)
Preparing to unpack postgresql_12+213.pgdg18.04+1_all.deb ...
Unpacking postgresql (12+213.pgdg18.04+1) ...
dpkg: dependency problems prevent configuration of postgresql:
postgresql depends on postgresql-12; however:
Package postgresql-12 is not installed.
dpkg: error processing package postgresql (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
postgresql
Selecting previously unselected package postgresql-contrib.
(Reading database ... 56591 files and directories currently installed.)
Preparing to unpack postgresql-contrib_12+213.pgdg18.04+1_all.deb ...
Unpacking postgresql-contrib (12+213.pgdg18.04+1) ...
dpkg: dependency problems prevent configuration of postgresql-contrib:
postgresql-contrib depends on postgresql-contrib-12; however:
Package postgresql-contrib-12 is not installed.
dpkg: error processing package postgresql-contrib (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
postgresql-contrib
So, I tried to individually run the below command (just to check, as they work perfectly fine on my local ubuntu machine) which I believe goes to the internet:
sudo apt-get install postgresql postgresql-contrib
I get the below error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
postgresql-contrib is already the newest version (12+213.pgdg18.04+1).
postgresql is already the newest version (12+213.pgdg18.04+1).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
postgresql : Depends: postgresql-12 but it is not installable
postgresql-contrib : Depends: postgresql-contrib-12 but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
I am not very good with linux, but in the error above, I see it says that postgresql is already on the newest version. But when I try to run the below commands, they dont work:
postgres --version
postgres -V
locate /bin/postgres
psql --version
It seems postgres is not pre-installed on the machine. So, my issue here is I need to run the below command without internet access ( for which I downloaded the deb and tried but didnt work)
sudo apt-get install postgresql postgresql-contrib
Try updating your ubuntu and then install the packages again -
sudo apt-get update -y && sudo apt-get upgrade -y
Then install postgresql -
sudo apt-get install postgresql postgresql-contrib -y
Hope it helps.

Problam with apt-get install

I'm using ubuntu 16.04 and last week I try to install some virtual machine on my computer but I failed to do it.
Now when I try to install any program from the apt-get install I got this text:
sudo apt-get install build-essential git libssl-dev
[sudo] password for eliya:
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.1ubuntu2).
git is already the newest version (1:2.7.4-0ubuntu1.5).
libssl-dev is already the newest version (1.0.2g-1ubuntu4.13).
The following packages were automatically installed and are no longer required:
libavdevice-ffmpeg56 linux-headers-4.4.0-134 linux-headers-4.4.0-134-generic
linux-image-4.4.0-134-generic linux-image-extra-4.4.0-134-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 103 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up virtualbox-ext-pack (5.1.38-0ubuntu1.16.04.1) ...
removing old virtualbox extension packs
virtualbox-ext-pack: downloading: http://download.virtualbox.org/virtualbox/5.1.38/Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack
The file will be downloaded into /usr/share/virtualbox-ext-pack
License accepted.
0%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to install "/usr/share/virtualbox-ext-pack/Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack"
VBoxManage: error: The installer failed with exit code 1: VBoxExtPackHelperApp: error: World writable: '/usr'
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ExtPackManagerWrap, interface IExtPackManager
VBoxManage: error: Context: "RTEXITCODE handleExtPack(HandlerArg*)" at line 1201 of file VBoxManageMisc.cpp
Hash mismatch Oracle_VM_VirtualBox_Extension_Pack-5.1.38.vbox-extpack: expected e93d87b0f5de50369baca0a48082236b947df5b922ffd0233c0fa92c1206defd, or wrong accept-license key, removing the file.
dpkg: error processing package virtualbox-ext-pack (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
virtualbox-ext-pack
E: Sub-process /usr/bin/dpkg returned an error code (1)
And now i can't install anything because this problam.
Thank you
1.Reconfigure Package Database
sudo dpkg --configure -a
2.force install
sudo apt-get install -f
Then try again installing virtualbox

How to Uninstall MongoDb-Server on CentOS

I have installed a mongodb instance once, but it stops running for a reason that I could not managed to solve. So I installed MongoDb 3.4 by using offical docs. There are 5 modules according to the installer. One of them is mongodb-org-server which install mongod (mongo daemonized). When I run the command:
sudo yum install -y mongodb-org
It installs all of modules except mongodb-org-server. It says it's installed. However, when I run mongod, I get there is no such a command. After that I tried to remove all of the modules:
sudo yum erase $(rpm -qa | grep mongodb-org)
It does not manage to remove mongodb-org-server and throws the error below:
Running Transaction
Erasing: mongodb-org-3.4.1-1.el6.x86_64 1/5
error reading information on service mongod: No such file or directory
error: %preun(mongodb-org-server-3.4.1-1.el6.x86_64) scriptlet failed, exit status 1
Error in PREUN scriptlet in rpm package mongodb-org-server
How I can fix this? I'll glad for your helps. Thanks.
I fixed the issue. Reinstalled the server package and deleted successfully.
sudo yum reinstall -y mongodb-org-server.x86_64

Gtk-Message: Failed to load module "canberra-gtk-module" Unable to connect to dbus - Sublime text

I'm working on a remote server (Ubuntu 14.04) through SSH -X. I have installed Sublime Text and when I try to open it I get
Gtk-Message: Failed to load module "canberra-gtk-module"
Unable to connect to dbus
How do I solve this?
sudo apt-get install libcanberra-gtk*
if you run that install it will get 120+ mb of libs, mostly. to get rid of that module error, you only need to install 70k. i fixed the same error with this single package:
sudo apt-get install libcanberra-gtk-module
that should do the trick. if that doesnt work try installing only the canberra libs, you don't need all those Xlibs, or you'd have them already ;)
here's just canberra packages apt listed:
libcanberra-gtk-common-dev libcanberra-gtk-dev libcanberra-gtk-module
libcanberra-gtk-module-dbg libcanberra-gtk0 libcanberra-gtk0-dbg
libcanberra-gtk3-0-dbg libcanberra-gtk3-dev libcanberra-gtk3-module-dbg
libcanberra-dev
10 total packages, instead of over 100 packages with that * wildcard. save space, boot time, sys speed etc, always, if you can :)
As I found at the end of this thread, it appears to be a problem with the libcanberra dependencies, I stumbled upon this and the solution worked for me on Sublime Text 2/Debian 8.
So try running this:
sudo apt-get install libcanberra-gtk*
This got rid of the GTK message, but the "Unable to connect to dbus..." stuff disappeared when I executed sublime as a non-root user.
On Debian Stretch:
sudo apt install libcanberra-gtk-module
This will install:
The following additional packages will be installed:
libcanberra-gtk0
The following NEW packages will be installed:
libcanberra-gtk-module libcanberra-gtk0