Remedy this by opening the /etc/hosts file in your editor, and changing the hostname for second entry/line 127.0.0.1 to the same name that is in the /etc/hostname file. The problem is caused when one of the loopback addresses does not have the proper hostname assigned, or has no name assigned, or there is only one line for this address. There should be two entries for the loopback address (127.0.0.1).check your /etc/hosts file you may see something like this:.get your hostname from /etc/hostname, or:.I don't know what causes this issue, but here's something that may fix it: Sudo: unable to resolve host : Name or service not known please help me.host name change but not work properly,write host name unknown, sudo: unable to resolve host Hrimon: Name. This is the result of using sudo fresh out of the box. In other words, the command executes as it should, but the annoying error message appears after each use of sudo: The install is aware of the hostname, but in my case didnt get set in /etc/hosts for localhost, sudo calls made on the system result in hostname resolution errors. Sudo: unable to resolve host the_name: Name or service not knownĠ upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Moderator, I could not put the pictures in the post, nor with "witchcraft".The problem manifests itself when a command is issued under sudo. General -> machine name = Machine -> ip address / Nickname In the picture below, two instances of the program were opened simultaneously for better clarity. Share Improve this answer Follow answered at 9:38 Sami Kuhmonen 2,113 1 20 28 Yup, that worked for me. In the picture, the correct program is the one on the left. 2 Answers Sorted by: 42 You have to edit /etc/hosts while superuser and add your machine name after the first line with localhost 127.0.0.1 localhost MYMACHINE This will make the system not try to resolve the hostname from DNS. I would prefer to edit the settings by the "network" program (Configure network devices and connections).ĭo not confuse with "Network Connections" (Manage and change your network connection settings). If these applications can be released, you can edit the referenced files by opening the "/ etc" folder as root in the File Manager and opening the files with the text editor. Try launching applications that require password. I am unable to enter my password in the terminal window. Try a harmless sudo command in order to check whether the problem has been resolved. Once you have logged in to the graphical desktop, open a terminal window.Reboot the machine by typing reboot and pressing enter.Command: nano /etc/hostsĬhange the line 127.0.1.1 to read 127.0.1.1 charlie-ThinkPad. Invoke the editor nano and load the file /etc/hosts.Command: nano /etc/hostnameĬhange the word charlie-ThinkPa to read charlie-ThinkPad.Ĭonfirm to save the changed file by pressing y. Invoke the editor nano and load the file /etc/hostname.You will have to press enter one more time to confirm you want the root-shell.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |