Reputation: 4006
I've a device, which is running with linux kernel version 2.6. I've copied Linux 32 bit binaries of mongodb into /usr/local/bin. When I run mongod I get following output
./mongod: line 1: syntax error: unexpected "("
The output for mongo is
/usr/local/bin # ./mongo
./mongo: line 1:ELFPª: not found
./mongo: line 2: syntax error: unexpected ")"
Can anyone tell me What could be the problem?
Upvotes: 1
Views: 2082
Reputation: 109
I encountered the same error when I was installing a 64 bit mongodb on a 32 bit ubuntu linux box. It went away when I installed the 32 bit package.
Upvotes: 2
Reputation: 6922
It appears the binary is corrupted or it is being interpreted by your shell rather than executing. I can achieve similar output if I force shell interpretation:
$ sh /usr/bin/mongod
/usr/bin/mongod: 2: /usr/bin/mongod: E: not found
/usr/bin/mongod: 3: /usr/bin/mongod: �BA��RƄ,@�@@: not found
/usr/bin/mongod: 4: /usr/bin/mongod: Syntax error: ")" unexpected
/usr/bin/mongod: 1: /usr/bin/mongod: �P�x@�4�: not found
/usr/bin/mongod: 2: /usr/bin/mongod: E�@E��: not found
/usr/bin/mongod: 2: /usr/bin/mongod: cq�1A�A�: not found
/usr/bin/mongod: 1: /usr/bin/mongod: cannot create ��Q@�/�@8: Directory nonexistent
/usr/bin/mongod: 1: /usr/bin/mongod: ELF: not found
If you're concerned that it may be a corrupted download, you could consult this list, which contain md5 hashes for each MongoDB binary release (for the 32bit i686 platform). Alternatively, you could attempt installing MongoDB via a package manager if possible.
Upvotes: 3