Random Musings

Sporadic thoughts on tech, economics, business, finance and trading

Fedora / Manjaro – Change Hostname – Var 2

,

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 hostname file:
    sudo nano /etc/hostname
    
  • Replace the existing name with the new hostname you want.
  • Save and exit (in nano, press CTRL+O, Enter to save, and CTRL+X to exit).

2. Edit the /etc/hosts File

  • Edit the hosts file 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:
    127.0.0.1   localhost
    127.0.1.1   old-hostname
    
    Change old-hostname to 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.