$ sudo hostnamectl set-hostname your-hostname
$ sudo vim /etc/hosts
Open the hosts file and add the following line:
127.0.1.1 your-hostname
$ sudo hostnamectl set-hostname your-hostname
$ sudo vim /etc/hosts
Open the hosts file and add the following line:
127.0.1.1 your-hostname