Run the following command to change the hostnames in the files:
sudo vi /etc/hostname
sudo vi /etc/hosts
Then restart the computer. The hostname should be the new one.
If you didn’t change the hostname in the “/etc/hosts” files, you will get “unable to resolve host …” error when running the command:
sudo apt-get clean