1

On my Ubuntu, when I write some script (or using for example Composer) it returns me this error:

-bash: /usr/local/bin/composer: /usr/bin/env: bad interpreter: No such file or directory

This is an error with env php, but it's the same for env ruby or others.

I saw with ll that the symlink of /usr/bin/env, pointing to /bin/env is broken (red text with black background), in fact /bin/env doesn't exist.

I remember that I used composer many times (is a web server based on Ubuntu 16.04) and I didn't touch the server, weird.

If I run "env php" it tells me that env is not installed (?) and I can install it with apt install coreutils, but obviously coreutils is installed.

Do you think I can solve this with reinstalling coreutils?

sudo apt-get install --reinstall coreutils

Is it dangerous? As I said, is a web server, I don't want to lose something or to have website offline.

1

No, in theory, reinstalling coreutils shouldn't be dangerous and yes, it should bring back env.

However, I would be more worried about why it's missing in the first place. If you are sure you haven't changed anything and this is a webserver so, presumably, open to the internet, you want to check whether your system could have been compromised.

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.