To change the computer name in Manjaro Linux, follow these steps:
1. Edit the /etc/hostname File
- Open a terminal and run the following command to edit the
hostnamefile:sudo nano /etc/hostname - Replace the existing name with the new hostname you want.
- Save and exit (in nano, press
CTRL+O,Enterto save, andCTRL+Xto exit).
2. Edit the /etc/hosts File
- Edit the
hostsfile to reflect the new hostname:sudo nano /etc/hosts - Update the line that contains your old hostname to the new one. It typically looks something like this:
Change127.0.0.1 localhost 127.0.1.1 old-hostnameold-hostnameto your new hostname:127.0.1.1 new-hostname - Save and exit.
3. Apply the Changes
- To apply the changes, you can either reboot your system:
sudo reboot - Or, you can run the following command to apply the hostname change without rebooting:
sudo hostnamectl set-hostname new-hostname
4. Verify the Change
- After rebooting or applying the changes, verify the hostname by running:
hostname
This should change the computer name in your Manjaro Linux system.