5

The sudo command execution was working fine until a few days ago, and it started working slow. When I run a sudo command in the terminal, it does not work faster. It takes a break of a few seconds to ask for the password.

If the password is already entered in the terminal, executing the command will take a bit of a delay. How do I make it faster? I am not getting a reason why it slows down. My disk space where ubuntu is installed is 45GB free.

enter image description here

Update

My hostname is already there in the said file terminal image

JAMSHAID
  • 281

1 Answers1

5

The problem is occurring because your hostname is not in your /etc/hosts file.

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!

thanks to this answer

Zanna
  • 70,465
m3asmi
  • 336
  • 3
  • 7