Edit sudoers file (eg: sudo nano /etc/sudoers) and uncomment the line below: Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" Reference to this solution