To change the hostname (computer name) on Arch Linux, you can use the hostnamectl
command or edit the /etc/hostname
file directly.
- Using the
hostnamectl
command:
sudo hostnamectl set-hostname new_hostname
- Editing the
/etc/hostname
file:
sudo nano /etc/hostname
change the hostname to your desired hostname
- save the file and exit
- update the hostname in /etc/hosts file
sudo nano /etc/hosts
Change the hostname on the line that starts with 127.0.0.1
or ::1
to your desired hostname
- save the file and exit
- Finally, reboot your system for the changes to take effect.
It’s important to note that changing the hostname will only change the name of your computer, it will not affect the username or home directory. It’s also important to note that the above steps are just a general guide and you may need to adjust them to suit your specific requirements.