Score:2

sudo command execution slown down on Ubuntu 22.04

jp flag

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

Farhad Kia avatar
cn flag
Shouldn't it be 127.0.0.1 instead of 127.0.1.1?
JAMSHAID avatar
jp flag
@FarhadKia Thanks. I just updated it. I don't know much about it why it was changed. I have changed it as you said
Score:2
cn flag

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

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.