6

I'm using Ubuntu 18.04, and recently I keep getting this error when running bash scripts: tr: command not found. The tr does not exists in /usr/bin and /usr/sbin. Also installed coreutils but still no luck. How can I add this command to my shell?

which tr returns nothing. This is what apt says about coreutils:

coreutils is already the newest version (8.28-1ubuntu1).

I get Command 'tr' not found so nothing is overriding it. /usr/bin is in my PATH variable.

9

tr is contained in the coreutils package, but if this package was installed before a simple apt install will not restore it. To reinstall the package use apt-get’s --reinstall option:

sudo apt install --reinstall coreutils

If you didn’t (re)move the missing binary /usr/bin/tr there might be something wrong with your system, run fsck on the partition for a filesystem check and (if necessary) repair.

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.