Thursday, 8 November 2018

Ubuntu 18.04 - Changing the hostname

So I did not realise that it's now so hard to change a hostname in Ubuntu, I've obviously been spoilt in the past.

I assumed that it was a case of: -

sudo hostname
sudo vi /etc/hostname
sudo vi /etc/hosts
sudo reboot

but, alas, no longer - it's now more like: -

sudo hostnamectl set-hostname
sudo vi /etc/cloud/cloud.cfg
sudo vi /etc/hosts
sudo reboot

Whilst I'm on a rant n' roll, the mechanism for changing an IP address has also changed ….

Now it's more like this: -

sudo vi /etc/netplan/50-cloud-init.yaml 

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}

                search: []
            optional: true
    version: 2

which is nice.

No comments:

Jenkins and the Case of the Missing Body

I was repeatedly seeing this: - java.lang.IllegalStateException: There is no body to invoke with a Jenkins Pipeline that I was executing...