Ubuntu: Difference between revisions
use template for lasted tested on |
No edit summary |
||
Line 9: | Line 9: | ||
# Use ''hostnamectl'' with ''set-hostname'' flag. <source lang="bash"> | # Use ''hostnamectl'' with ''set-hostname'' flag. <source lang="bash"> | ||
$ hostnamectl set-hostname NEW_NAME_HERE | $ hostnamectl set-hostname NEW_NAME_HERE | ||
</source> | |||
= Snap (package manager) = | |||
{{testedon|2022-02-06|Ubuntu 20.04}} | |||
<source lang=""> | |||
</source> | </source> |
Revision as of 18:58, 6 February 2022
Change hostname without a restart
- Last tested on Ubuntu 16.04 (2018-04-23)
- To permanently change the computer name
Edit/etc/hostname
and/etc/hosts
- Restart hostname service
$ systemctl restart systemd-logind.service
- Use hostnamectl with set-hostname flag.
$ hostnamectl set-hostname NEW_NAME_HERE
Snap (package manager)
- Last tested on Ubuntu 20.04 (2022-02-06)