Skip to content

Instantly share code, notes, and snippets.

@pfrandsen
Last active December 26, 2015 12:40
Show Gist options
  • Select an option

  • Save pfrandsen/39879d11582f8f18f1ff to your computer and use it in GitHub Desktop.

Select an option

Save pfrandsen/39879d11582f8f18f1ff to your computer and use it in GitHub Desktop.
Change hostname in Ubuntu snappy core

Change hostname in Ubuntu snappy core

Edit hostname and hosts files, then reboot device

edit hostname file

sudo vi /etc/hostname

  1. Press D to delete the current name (D = delete line)
  2. Press i to enter insert mode
  3. Write the new host name
  4. Press <esc>:wq<enter> to save file and exit vi

edit hosts file

sudo vi /etc/hosts

  1. Press D to delete the first line in the file
  2. Press i to enter insert mode
  3. Type: 127.0.0.1<tab>localhost
  4. Press <esc> and use arrow keys to move to start of next line
  5. Press D
  6. Press i
  7. Type: 127.0.0.1<tab>name (same name as entered for hostname above)
  8. Press <esc>:wq<enter>

reboot

sudo shutdown -r now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment