To solve the hostname error, open the "/etc/hosts" file in any editor and check our that the hostname is written correctly or not.