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

問題:

I am trying to compile some sources using a makefile.我正在嘗試使用 makefile 編譯一些源代碼。 In the makefile there is a bunch of commands that need to be ran as sudo .在 makefile 中有一堆命令需要作爲sudo運行。

When I compile the sources from a terminal all goes fine and the make is paused the first time a sudo command is ran waiting for password.當我從終端編譯源代碼時一切正常,並且在第一次運行sudo命令等待密碼時 make 暫停。 Once I type in the password, make resumes and completes.輸入密碼後,製作簡歷並完成。

But I would like to be able to compile the sources in NetBeans.但我希望能夠在 NetBeans 中編譯源代碼。 So, I started a project and showed netbeans where to find the sources, but when I compile the project it gives the error:所以,我啓動了一個項目並向 netbeans 展示了在哪裏可以找到源代碼,但是當我編譯該項目時,它給出了錯誤:

sudo: no tty present and no askpass program specified

The first time it hits a sudo command.它第一次遇到sudo命令。

I have looked up the issue on the internet and all the solutions I found point to one thing: disabling the password for this user.我在互聯網上查過這個問題,我找到的所有解決方案都指向一件事:禁用該用戶的密碼。 Since the user in question here is root.因爲這裏有問題的用戶是 root。 I do not want to do that.我不想那樣做。

Is there any other solution?還有其他解決方案嗎?


解決方案:

參考一: https://en.stackoom.com/question/1Ssez
參考二: https://stackoom.com/question/1Ssez
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章