mssql server set up fail with errror on debian linux
I was istalling it on a docker container based on the debian:buster image,and i had the following error:
root@25d7455d0dfc:/# /opt/mssql/bin/mssql-conf setup
Traceback (most recent call last):
  File &quot;/opt/mssql/bin/../lib/mssql-conf/mssql-conf.py&quot;, line 361, in &lt;module&gt;
    main()
  File &quot;/opt/mssql/bin/../lib/mssql-conf/mssql-conf.py&quot;, line 357, in main
    processCommands()
  File &quot;/opt/mssql/bin/../lib/mssql-conf/mssql-conf.py&quot;, line 262, in processCommands
    COMMAND_TABLE[args.which]()
  File &quot;/opt/mssql/bin/../lib/mssql-conf/mssql-conf.py&quot;, line 75, in handleSetup
    mssqlconfhelper.setupSqlServer(eulaAccepted, noprompt=args.noprompt)
  File &quot;/opt/mssql/lib/mssql-conf/mssqlconfhelper.py&quot;, line 971, in setupSqlServer
    if not checkInstall():
  File &quot;/opt/mssql/lib/mssql-conf/mssqlconfhelper.py&quot;, line 941, in checkInstall
    return runScript(checkInstallScript, True) == 0
  File &quot;/opt/mssql/lib/mssql-conf/mssqlconfhelper.py&quot;, line 930, in runScript
    return subprocess.call([sudo, &quot;-EH&quot;, pathToScript])
  File &quot;/usr/lib/python2.7/subprocess.py&quot;, line 172, in call
    return Popen(*popenargs, **kwargs).wait()
  File &quot;/usr/lib/python2.7/subprocess.py&quot;, line 394, in __init__
    errread, errwrite)
  File &quot;/usr/lib/python2.7/subprocess.py&quot;, line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

So visited the python script at line 930:
vim +930 /opt/mssql/lib/mssql-conf/mssqlconfhelper.py
And I saw this if condition:
if (runAsRoot):
    if(checkSudo() == False):
        printError(_(&quot;Elevated privileges required for this action. Please run in 'sudo' mode.&quot;))
        return (errorExitCode)
    return subprocess.call([sudo, &quot;-EH&quot;, pathToScript])
else:
    return subprocess.call([pathToScript])

Since I'm running as root and it enters the first condition 'runAsRoot' the script run the following return subprocess.call([sudo, &quot;-EH&quot;, pathToScript])
I changed that line to:
return subprocess.call([pathToScript])
After that, the setup command worked for me.
/opt/mssql/bin/mssql-conf setup