bin/sh^M: bad interpreter: No such file or directory

Tried to install DirectAdmin on Ubuntu just now but encounter the following error.
./ /bin/sh^M: bad interpreter: No such file or directory

A quick Google search revealed that dos2unix can fix the problem.
sudo apt-get install dos2unix

Then fix the problem by. This will convert the file to unix format.

Then just execute the file as per normal.


  1. I know this post is late, but i wanted to add for Debian, which is family of ubuntu, works with:
    apt-get install tofrodos
    THEN use [example] dos2unix setup.shthen use whatever-command ./ ( ./ )Thanks for reading.

  2. Bing Han Goh, You're missing "install" option in "apt-get" command :)

  3. Thanks for pointing out! Updated the post :D


Post a Comment

Popular posts from this blog

Generate GoDaddy SSL Certificate (.crt) for Azure Websites (.pfx)

Backup MySQL to Azure Storage in 30 Seconds