Chris Rogers Chris Rogers - 1 year ago 467
Linux Question

Windows Bash (WSL) - sudo: no tty present and no askpass program specified

After following this tutroial I get the following error when trying to run the commands as user or even sudo:

sudo: no tty present and no askpass program specified

The comments from Lurdan in this article state that you need to run

chmod 0666 /dev/tty

doesn't work but
sudo -S
does, but surely there's another fix?

Answer Source

So silly, after looking further down I see a solution from Beorat:

To avoid the sudo tty issue and others, run these commands just before running do-release-upgrade:

sudo -S apt-mark hold sudo
sudo -S apt-mark hold procps
sudo -S apt-mark hold strace

If you've already upgraded, run the above commands, then manually downgrade to the Trusty packages:

sudo -S wget
sudo -S wget
sudo -S wget
sudo -S dpkg -i sudo_1.8.9p5-1ubuntu1.2_amd64.deb
sudo -S dpkg -i procps_3.3.9-1ubuntu2.2_amd64.deb
sudo -S dpkg -i strace_4.8-1ubuntu5_amd64.deb

More info here:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download