I have installed p4 command line client on the server, and something strange is happening. It exists, has executable rights, but I cannot execute it because I received an error message that it does not exists.

I tried looking around, and everyone else who had this problem realized they picked the wrong binary for their box, but I made 100% sure I didn't.

the /usr/local/bin/p4 file is:

  • 0x0755
  • in my $PATH directory (/usr/local/bin)
  • exists in the correct place
  • execution attempted as root & as ubuntu users

here is my terminal output:

ubuntu@ubuntu:~$ sudo su
+ sudo su

root@ubuntu:/home/ubuntu# wget http://cdist2.perforce.com/perforce/r16.1/bin.freebsd100x86_64/p4
--2017-09-25 22:21:45--  http://cdist2.perforce.com/perforce/r16.1/bin.freebsd100x86_64/p4
Resolving cdist2.perforce.com (cdist2.perforce.com)...,,, ...
Connecting to cdist2.perforce.com (cdist2.perforce.com)||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3683848 (3.5M) [application/x-executable]
Saving to: ‘p4’

100%[===================================================================================================================>] 3,683,848   5.06MB/s   in 0.7s

2017-09-25 22:21:46 (5.06 MB/s) - ‘p4’ saved [3683848/3683848]

root@ubuntu:/home/ubuntu# chmod +x p4

root@ubuntu:/home/ubuntu# mv p4 /usr/local/bin/

root@ubuntu:/home/ubuntu# p4
bash: /usr/local/bin/p4: No such file or directory

root@ubuntu:/home/ubuntu# ls -lah /usr/local/bin/p4
-rwxr-xr-x 1 root root 3.6M Mar  2  2017 /usr/local/bin/p4

root@ubuntu:/home/ubuntu# file /usr/local/bin/p4
/usr/local/bin/p4: ELF 64-bit LSB  executable, x86-64, version 1 (FreeBSD), dynamically linked (uses shared libs), for FreeBSD 10.0 (1000510), stripped

root@ubuntu:/home/ubuntu# uname -m

any help is greatly appreciated!

  • 1
    FreeBSD binaries won't run on a Linux machine (but Linux binaries can run on a FreeBSD machine). – Mark Wagner Sep 25 '17 at 23:19
  • ah thank you i actually thought freebsd would work on both. – iam-decoder Sep 25 '17 at 23:27

ok I found a solution, I changed my provision script to this and it works fine. I have no idea why this fixed my problem...


# bash strict and verbose mode
set -o pipefail -e -u -x

if [ ! -z `which p4` ]; then
  exit 0

# Installs Perforce

echo "deb http://package.perforce.com/apt/ubuntu/ trusty release" > /etc/apt/sources.list.d/perforce.list
wget -qO - https://package.perforce.com/perforce.pubkey | apt-key add -
apt-get update
apt-get install -y helix-cli

The confusing "no such file or directory" is likely actually referring to whatever dynamic linker this (misfit!) binary is attempting to have called.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.