Reference: linuxize

Ubuntu has changed the way you modify your hostname in 19.04

Modify the Cloud.cfg file

Modify the preserve hostname parameter in the cloud.cfg file at /etc/cloud/cloud.cfg

# This will cause the set+update hostname module to not operate (if true)
preserve_hostname: true

Modify the hostname

sudo hostnamectl set-hostname linuxize