1

Since I upgraded to Ubuntu 15.04, I have noticed that whenever I change my hostname by changing it in and with:

  • /etc/hostname

  • /etc/hosts

  • sudo hostname <new-hostname>

Immediately after this, I can't open anything. Well, I can, but if I launch anything, the process launches, but just goes straight into a Sleeping state:

enter image description here

Although a restart will fix this, how come this is happening anyway?

The last command in the list should make it so that it changes without need for a restart, so why does my whole machine then mess up after running it, and then only allow a restart to resolve it?

Information Update:

Although it seems that I am able to switch to a TTY. But unable to actually create a new process without it going to sleep immediately and not launching.


OS Information:

Description:    Ubuntu 15.04
Release:    15.04
1

1 Answer 1

1

In Ubuntu 15.04, in order to change hostname permanently you have to run this command:

sudo hostnamectl set-hostname new-name

You can check directly your new configuration:

hostnamectl 

   Static hostname: new-name
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 458ad80036fa4cd4a3063116670ce33d
           Boot ID: 95a2349fc93f4d498bf189f0fc6fb858
    Virtualization: oracle
  Operating System: Ubuntu 15.04
            Kernel: Linux 3.19.0-21-generic
      Architecture: x86
1
  • This does not answer the question why launching applications does not work after changing hostname.
    – Ashark
    Oct 15, 2020 at 19:19

You must log in to answer this question.