Having “mail: command not found” error on Centos? If you performed minimal install; or your hosting provider did minimal installation on CentOS, by default “mail” command cannot be run on CentOS.
Don’t worry is your system break or something, the mail command can be install via yum. Follow the step below to solve “mail: command not found” error.
1. Search for mailx from Yum repo
# yum search mailx
You will see packages listed as below;
libreport-plugin-mailx.x86_64 : libreport's mailx reporter plugin mailx.x86_64 : Enhanced implementation of the mailx command nail.x86_64 : Enhanced implementation of the mailx command
mailx is the package we need to install, continue installation with mail package
# yum install mailx
After installation, run the mail command again
# mail No mail for root
Yep, no new mail for root user for now. That’s the quick and easy way to resolve “mail: command not found” problem.