I want to change the hostname of a Ubuntu 18.04 server.
hostnamectl --set-hostname newname --static changed /etc/hostname file to newname changed /etc/hosts file to newname rm -f /etc/machine-id dbus-uuidgen --ensure=/etc/machine-id dbus-uuidgen --ensure dpkg-reconfigure openssh-server
Finally I did a reboot. But after reboot there is still the old hostname. The file /etc/hostname has been changed to the old hostname.
How to permanently change the hostname?