Terminal command with sudo takes a long timeHow to disable systemd-resolved and resolve DNS with dnsmasq?No password prompt at sudo commandKeyboard freezes in terminal after sudosudo -s takes a long time to execute and prompts sudo: was not possible to resolve machine XXXMy terminal takes a long time to respond to a command?How to automatically show sudo prompt when command doesn't have enough permissionsLock copy-paste input to terminal while sudo prompts for passwordPassword checking takes long even though it's not wrongUbuntu Terminal takes a while when performing commands using sudo

Avoiding dust scattering when you drill

Airport Security - advanced check, 4th amendment breach

Is there anything on the ISS that would be destroyed if that object were returned to Earth?

What action is recommended if your accommodation refuses to let you leave without paying additional fees?

Job interview by video at home and privacy concerns

GPLv3 forces us to make code available, but to who?

Does the 'java' command compile Java programs?

Everyone Gets a Window Seat

How is this situation not a checkmate?

How closely correlated is culture to geography?

How to "Start as close to the end as possible", and why to do so?

Disable all sound permanently

Manager told a colleague of mine I was getting fired soon

Would an object shot from earth fall into the sun?

Looking for circuit board material that can be dissolved

Decision Variable Value from a Set (Gurobi)

Does the US Armed Forces refuse to recruit anyone with an IQ less than 83?

Re-entering the UK after overstaying in 2008

Can anyone give me the reason why music is taught this way?

Caro-Kann c4-c5 push

Why do Russians sometimes spell "жирный" (fatty) as "жырный"?

Lighthouse Alternatives

What is the idiomatic solution in SQL Server for reserving a block of ids for use in a bulk insert?

Duck, duck, gone!



Terminal command with sudo takes a long time


How to disable systemd-resolved and resolve DNS with dnsmasq?No password prompt at sudo commandKeyboard freezes in terminal after sudosudo -s takes a long time to execute and prompts sudo: was not possible to resolve machine XXXMy terminal takes a long time to respond to a command?How to automatically show sudo prompt when command doesn't have enough permissionsLock copy-paste input to terminal while sudo prompts for passwordPassword checking takes long even though it's not wrongUbuntu Terminal takes a while when performing commands using sudo






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









22















I noticed that the terminal recently becomes too slow when I execute a command that needs my password. It takes some seconds to display [sudo] password for ...










share|improve this question


























  • Hi, could you add a bit more information to your question please. What OS are you using and is it 32 or 64-bit?

    – SimplySimon
    Jul 21 '13 at 10:04











  • What hardware do you have

    – Alvar
    Jul 21 '13 at 10:11












  • I'm using Dell XPS developer edition (i7,8g ram) with ubuntu 13.04 64bit.

    – Nasreddine
    Jul 21 '13 at 10:26






  • 1





    It's very strange, but, I receive "Ubuntu could not resolve the host" when connection isn't available. I execute this command "echo 0 | sudo tee /sys/class/backlight/intel_backlight/brightness "

    – Nasreddine
    Jul 25 '13 at 4:30






  • 2





    serverfault: Why does sudo command take long to execute?

    – Steven K
    Sep 20 '13 at 5:53

















22















I noticed that the terminal recently becomes too slow when I execute a command that needs my password. It takes some seconds to display [sudo] password for ...










share|improve this question


























  • Hi, could you add a bit more information to your question please. What OS are you using and is it 32 or 64-bit?

    – SimplySimon
    Jul 21 '13 at 10:04











  • What hardware do you have

    – Alvar
    Jul 21 '13 at 10:11












  • I'm using Dell XPS developer edition (i7,8g ram) with ubuntu 13.04 64bit.

    – Nasreddine
    Jul 21 '13 at 10:26






  • 1





    It's very strange, but, I receive "Ubuntu could not resolve the host" when connection isn't available. I execute this command "echo 0 | sudo tee /sys/class/backlight/intel_backlight/brightness "

    – Nasreddine
    Jul 25 '13 at 4:30






  • 2





    serverfault: Why does sudo command take long to execute?

    – Steven K
    Sep 20 '13 at 5:53













22












22








22


3






I noticed that the terminal recently becomes too slow when I execute a command that needs my password. It takes some seconds to display [sudo] password for ...










share|improve this question
















I noticed that the terminal recently becomes too slow when I execute a command that needs my password. It takes some seconds to display [sudo] password for ...







command-line sudo






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 26 '18 at 21:45









muru

1




1










asked Jul 21 '13 at 9:47









NasreddineNasreddine

3973 gold badges6 silver badges20 bronze badges




3973 gold badges6 silver badges20 bronze badges















  • Hi, could you add a bit more information to your question please. What OS are you using and is it 32 or 64-bit?

    – SimplySimon
    Jul 21 '13 at 10:04











  • What hardware do you have

    – Alvar
    Jul 21 '13 at 10:11












  • I'm using Dell XPS developer edition (i7,8g ram) with ubuntu 13.04 64bit.

    – Nasreddine
    Jul 21 '13 at 10:26






  • 1





    It's very strange, but, I receive "Ubuntu could not resolve the host" when connection isn't available. I execute this command "echo 0 | sudo tee /sys/class/backlight/intel_backlight/brightness "

    – Nasreddine
    Jul 25 '13 at 4:30






  • 2





    serverfault: Why does sudo command take long to execute?

    – Steven K
    Sep 20 '13 at 5:53

















  • Hi, could you add a bit more information to your question please. What OS are you using and is it 32 or 64-bit?

    – SimplySimon
    Jul 21 '13 at 10:04











  • What hardware do you have

    – Alvar
    Jul 21 '13 at 10:11












  • I'm using Dell XPS developer edition (i7,8g ram) with ubuntu 13.04 64bit.

    – Nasreddine
    Jul 21 '13 at 10:26






  • 1





    It's very strange, but, I receive "Ubuntu could not resolve the host" when connection isn't available. I execute this command "echo 0 | sudo tee /sys/class/backlight/intel_backlight/brightness "

    – Nasreddine
    Jul 25 '13 at 4:30






  • 2





    serverfault: Why does sudo command take long to execute?

    – Steven K
    Sep 20 '13 at 5:53
















Hi, could you add a bit more information to your question please. What OS are you using and is it 32 or 64-bit?

– SimplySimon
Jul 21 '13 at 10:04





Hi, could you add a bit more information to your question please. What OS are you using and is it 32 or 64-bit?

– SimplySimon
Jul 21 '13 at 10:04













What hardware do you have

– Alvar
Jul 21 '13 at 10:11






What hardware do you have

– Alvar
Jul 21 '13 at 10:11














I'm using Dell XPS developer edition (i7,8g ram) with ubuntu 13.04 64bit.

– Nasreddine
Jul 21 '13 at 10:26





I'm using Dell XPS developer edition (i7,8g ram) with ubuntu 13.04 64bit.

– Nasreddine
Jul 21 '13 at 10:26




1




1





It's very strange, but, I receive "Ubuntu could not resolve the host" when connection isn't available. I execute this command "echo 0 | sudo tee /sys/class/backlight/intel_backlight/brightness "

– Nasreddine
Jul 25 '13 at 4:30





It's very strange, but, I receive "Ubuntu could not resolve the host" when connection isn't available. I execute this command "echo 0 | sudo tee /sys/class/backlight/intel_backlight/brightness "

– Nasreddine
Jul 25 '13 at 4:30




2




2





serverfault: Why does sudo command take long to execute?

– Steven K
Sep 20 '13 at 5:53





serverfault: Why does sudo command take long to execute?

– Steven K
Sep 20 '13 at 5:53










2 Answers
2






active

oldest

votes


















39
















Hi I found this answer on another question -
The problem is if your hostname is not in your hosts file.



basically, type "hostname" in your terminal. That will tell you what your hostname is.



Next, type:



sudo nano /etc/hosts


and add:



127.0.0.1 yourhostname


then save - and you are done!
Sudo should be fast now!






share|improve this answer

























  • This post I guess ? : serverfault.com/questions/38114/…

    – monojohnny
    Mar 24 '16 at 0:19












  • I have the feeling that it can also be caused by DNS setting in NetworkManager: askubuntu.com/questions/898605/…

    – tobias47n9e
    Aug 8 '18 at 8:16






  • 2





    This is still valid in ubuntu 18.04. Thanks

    – Alexandre Neto
    Aug 17 '18 at 10:25


















5
















When you change your systems name in Gnome (The part that is displayed in the terminal after the @; e.g. tobias@laptop to tobias@newlaptop you might need to update your /etc/hosts:



127.0.1.1 laptop


needs to be changed to



127.0.1.1 newlaptop


If you get it right sudo should work without delay immediately after saving this setting.






share|improve this answer


























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );














    draft saved

    draft discarded
















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f322514%2fterminal-command-with-sudo-takes-a-long-time%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    39
















    Hi I found this answer on another question -
    The problem is if your hostname is not in your hosts file.



    basically, type "hostname" in your terminal. That will tell you what your hostname is.



    Next, type:



    sudo nano /etc/hosts


    and add:



    127.0.0.1 yourhostname


    then save - and you are done!
    Sudo should be fast now!






    share|improve this answer

























    • This post I guess ? : serverfault.com/questions/38114/…

      – monojohnny
      Mar 24 '16 at 0:19












    • I have the feeling that it can also be caused by DNS setting in NetworkManager: askubuntu.com/questions/898605/…

      – tobias47n9e
      Aug 8 '18 at 8:16






    • 2





      This is still valid in ubuntu 18.04. Thanks

      – Alexandre Neto
      Aug 17 '18 at 10:25















    39
















    Hi I found this answer on another question -
    The problem is if your hostname is not in your hosts file.



    basically, type "hostname" in your terminal. That will tell you what your hostname is.



    Next, type:



    sudo nano /etc/hosts


    and add:



    127.0.0.1 yourhostname


    then save - and you are done!
    Sudo should be fast now!






    share|improve this answer

























    • This post I guess ? : serverfault.com/questions/38114/…

      – monojohnny
      Mar 24 '16 at 0:19












    • I have the feeling that it can also be caused by DNS setting in NetworkManager: askubuntu.com/questions/898605/…

      – tobias47n9e
      Aug 8 '18 at 8:16






    • 2





      This is still valid in ubuntu 18.04. Thanks

      – Alexandre Neto
      Aug 17 '18 at 10:25













    39














    39










    39









    Hi I found this answer on another question -
    The problem is if your hostname is not in your hosts file.



    basically, type "hostname" in your terminal. That will tell you what your hostname is.



    Next, type:



    sudo nano /etc/hosts


    and add:



    127.0.0.1 yourhostname


    then save - and you are done!
    Sudo should be fast now!






    share|improve this answer













    Hi I found this answer on another question -
    The problem is if your hostname is not in your hosts file.



    basically, type "hostname" in your terminal. That will tell you what your hostname is.



    Next, type:



    sudo nano /etc/hosts


    and add:



    127.0.0.1 yourhostname


    then save - and you are done!
    Sudo should be fast now!







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Apr 30 '14 at 3:32









    Paul PreibischPaul Preibisch

    5205 silver badges9 bronze badges




    5205 silver badges9 bronze badges















    • This post I guess ? : serverfault.com/questions/38114/…

      – monojohnny
      Mar 24 '16 at 0:19












    • I have the feeling that it can also be caused by DNS setting in NetworkManager: askubuntu.com/questions/898605/…

      – tobias47n9e
      Aug 8 '18 at 8:16






    • 2





      This is still valid in ubuntu 18.04. Thanks

      – Alexandre Neto
      Aug 17 '18 at 10:25

















    • This post I guess ? : serverfault.com/questions/38114/…

      – monojohnny
      Mar 24 '16 at 0:19












    • I have the feeling that it can also be caused by DNS setting in NetworkManager: askubuntu.com/questions/898605/…

      – tobias47n9e
      Aug 8 '18 at 8:16






    • 2





      This is still valid in ubuntu 18.04. Thanks

      – Alexandre Neto
      Aug 17 '18 at 10:25
















    This post I guess ? : serverfault.com/questions/38114/…

    – monojohnny
    Mar 24 '16 at 0:19






    This post I guess ? : serverfault.com/questions/38114/…

    – monojohnny
    Mar 24 '16 at 0:19














    I have the feeling that it can also be caused by DNS setting in NetworkManager: askubuntu.com/questions/898605/…

    – tobias47n9e
    Aug 8 '18 at 8:16





    I have the feeling that it can also be caused by DNS setting in NetworkManager: askubuntu.com/questions/898605/…

    – tobias47n9e
    Aug 8 '18 at 8:16




    2




    2





    This is still valid in ubuntu 18.04. Thanks

    – Alexandre Neto
    Aug 17 '18 at 10:25





    This is still valid in ubuntu 18.04. Thanks

    – Alexandre Neto
    Aug 17 '18 at 10:25













    5
















    When you change your systems name in Gnome (The part that is displayed in the terminal after the @; e.g. tobias@laptop to tobias@newlaptop you might need to update your /etc/hosts:



    127.0.1.1 laptop


    needs to be changed to



    127.0.1.1 newlaptop


    If you get it right sudo should work without delay immediately after saving this setting.






    share|improve this answer





























      5
















      When you change your systems name in Gnome (The part that is displayed in the terminal after the @; e.g. tobias@laptop to tobias@newlaptop you might need to update your /etc/hosts:



      127.0.1.1 laptop


      needs to be changed to



      127.0.1.1 newlaptop


      If you get it right sudo should work without delay immediately after saving this setting.






      share|improve this answer



























        5














        5










        5









        When you change your systems name in Gnome (The part that is displayed in the terminal after the @; e.g. tobias@laptop to tobias@newlaptop you might need to update your /etc/hosts:



        127.0.1.1 laptop


        needs to be changed to



        127.0.1.1 newlaptop


        If you get it right sudo should work without delay immediately after saving this setting.






        share|improve this answer













        When you change your systems name in Gnome (The part that is displayed in the terminal after the @; e.g. tobias@laptop to tobias@newlaptop you might need to update your /etc/hosts:



        127.0.1.1 laptop


        needs to be changed to



        127.0.1.1 newlaptop


        If you get it right sudo should work without delay immediately after saving this setting.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Sep 28 '18 at 6:08









        tobias47n9etobias47n9e

        2012 gold badges5 silver badges15 bronze badges




        2012 gold badges5 silver badges15 bronze badges































            draft saved

            draft discarded















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f322514%2fterminal-command-with-sudo-takes-a-long-time%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Tamil (spriik) Luke uk diar | Nawigatjuun

            Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

            Training a classifier when some of the features are unknownWhy does Gradient Boosting regression predict negative values when there are no negative y-values in my training set?How to improve an existing (trained) classifier?What is effect when I set up some self defined predisctor variables?Why Matlab neural network classification returns decimal values on prediction dataset?Fitting and transforming text data in training, testing, and validation setsHow to quantify the performance of the classifier (multi-class SVM) using the test data?How do I control for some patients providing multiple samples in my training data?Training and Test setTraining a convolutional neural network for image denoising in MatlabShouldn't an autoencoder with #(neurons in hidden layer) = #(neurons in input layer) be “perfect”?