GNU/Linux >> Linux Esercitazione >  >> Ubuntu

Come risolvere:Sudo non è in grado di risolvere l'host in Ubuntu?

Se ricevi un messaggio di errore "Sudo non è in grado di risolvere l'host ” durante l'esecuzione di sudo comando in Ubuntu, ecco come puoi risolvere il problema.

Di seguito è riportato l'istantanea dell'errore:

ubuntu@test$ sudo su -
sudo: unable to resolve host (test)

Soluzione:

Controlla se /etc/hostname contiene il nome host corretto della tua macchina.

$ vi /etc/hostname

Controlla se /etc/hosts contiene la riga sottostante con nome host aggiunto alla fine.

$ vim /etc/hosts
127.0.0.0                localhost.localdomain                localhost             hostname_of_machine

Se i due file precedenti contengono il nome host corretto della macchina, quindi sudo si risolverà correttamente.


Ubuntu
  1. Come installare Docker su Ubuntu 18.04

  2. Come installare Apache su Ubuntu 18.04

  3. Come installare MariaDB 10.4 su Ubuntu 18.04

  4. Come riparare i pacchetti rotti in Ubuntu 20.04

  5. Come risolvere i problemi di dipendenza in Ubuntu 16.04?

Come installare Asterisk su Ubuntu 20.04

Come installare Nginx su Ubuntu 16.04

Come creare un utente Sudo su Ubuntu

Come installare Tomcat 8.5 su Ubuntu 18.04

Come installare Asterisk su Ubuntu 18.04

Come configurare l'host virtuale Apache su Ubuntu 20.04 LTS