How to fix 'sudo: no tty present and no askpass program specified' error?

前端 未结 26 1685
失恋的感觉
失恋的感觉 2020-11-22 03:36

I am trying to compile some sources using a makefile. In the makefile there is a bunch of commands that need to be ran as sudo.

When I compile the sour

26条回答
  •  难免孤独
    2020-11-22 04:05

    Using pipeline:

    echo your_pswd | sudo -S your_cmd
    

    Using here-document:

    sudo -S cmd <

    Open a terminal to ask password (whichever works):

    gnome-terminal -e "sudo cmd"
    
    xterm -e "sudo cmd"
    

提交回复
热议问题