[Solved] How do you change computer's name?
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
[Solved] How do you change computer's name?
I neglected to change the computer's name during install, how do I change it? I'm not seeing where to do that.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: How do you change computer's name?
To find out your computer name, in a terminal either
To change your hostname in a terminal
It helps to keep hostnames short.
hostname
or hostnamectl
which gives you a bit more info.To change your hostname in a terminal
hostnamectl set-hostname 'newname'
. Then verify it has changed by using one of the first commands again.It helps to keep hostnames short.
Code: Select all
andy@T432 ~ $ hostnamectl
Static hostname: T432
Icon name: computer-laptop
Chassis: laptop
Machine ID: 4095cb9d62054733b651d895c996ea84
Boot ID: 954a8515183842cbafb05c3209afc068
Operating System: Linux Mint 19
Kernel: Linux 4.15.0-99-generic
Architecture: x86-64
andy@T432 ~ $ hostname
T432
andy@T432 ~ $ hostnamectl set-hostname 'T433'
andy@T432 ~ $ hostname
T433
andy@T432 ~ $ hostnamectl set-hostname 'T432'
andy@T432 ~ $ hostname
T432
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: How do you change computer's name?
Thank you very much. This is the first time in about 500 installs I didn't change it, oops.
- AZgl1800
- Level 20
- Posts: 11175
- Joined: Thu Dec 31, 2015 3:20 am
- Location: Oklahoma where the wind comes Sweeping down the Plains
- Contact:
Re: How do you change computer's name?
double thanks.....
my laptop's name was about 25 characters.... hated it.
my laptop's name was about 25 characters.... hated it.
Re: How do you change computer's name?
Made that mistake when I first started and then tried to network to another PC, hostname > 15 chars which was a netbios limitation. Don't know if that is still a problem today, anyway, altair4 helped me out.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
-
- Level 16
- Posts: 6054
- Joined: Mon Aug 27, 2012 10:17 pm
Re: How do you change computer's name?
I take no credit, found it on the web
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
- ricardogroetaers
- Level 6
- Posts: 1374
- Joined: Sat Oct 27, 2018 3:06 am
- Location: Rio de Janeiro, Brasil
Re: How do you change computer's name?
Through the Xfce graphical interface:
Whisker menu -> System -> network.
In Mate and Cinnamon environments there must be something similar.
Click on the "Unlock" button and change the "machine name".
Go to the "machines" tab and see if the machine's "nickname" has also changed.
If necessary, change. Click on the "properties" button for that.
Note:
-The graphics features of Linux Mint are to be used and not confined in the "closet".
-the "network" program can be invoked by the Xfce terminal by typing the command:
network-admin
Re: How do you change computer's name?
Not in cinnamon, or I can't find it.In Mate and Cinnamon environments there must be something similar.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
- ricardogroetaers
- Level 6
- Posts: 1374
- Joined: Sat Oct 27, 2018 3:06 am
- Location: Rio de Janeiro, Brasil
Re: How do you change computer's name?
Worked, but not installed by default, at least in LM19.0, so had to install it first.ricardogroetaers wrote: ⤴Wed May 06, 2020 6:12 am Try typing the command in a terminal window:
network-admin
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: How do you change computer's name?
i did that and the name changed , but now i have this bash line on top every time i open terminal.AndyMH wrote: ⤴Tue May 05, 2020 6:09 pm To find out your computer name, in a terminal eitherhostname
orhostnamectl
which gives you a bit more info.
To change your hostname in a terminalhostnamectl set-hostname 'newname'
. Then verify it has changed by using one of the first commands again.
It helps to keep hostnames short.Code: Select all
andy@T432 ~ $ hostnamectl Static hostname: T432 Icon name: computer-laptop Chassis: laptop Machine ID: 4095cb9d62054733b651d895c996ea84 Boot ID: 954a8515183842cbafb05c3209afc068 Operating System: Linux Mint 19 Kernel: Linux 4.15.0-99-generic Architecture: x86-64 andy@T432 ~ $ hostname T432 andy@T432 ~ $ hostnamectl set-hostname 'T433' andy@T432 ~ $ hostname T433 andy@T432 ~ $ hostnamectl set-hostname 'T432' andy@T432 ~ $ hostname T432
how to get rid of that?
LM 19.3 Xfce
Cause I like things neat and simple
Cause I like things neat and simple
Re: How do you change computer's name?
Reboot? Didn't have that problem because in my example, having changed the hostname I changed it back to what it was originally.but now i have this bash line on top every time i open terminal
Edit - just checked, don't have that script, but do have a
vte-2.91.sh
in /etc/profile.d
. It seems to manipulate the PS1 environment variable:https://www.tecmint.com/customize-bash- ... mpt-linux/
Beyond that, have no idea what its purpose is.
Last edited by AndyMH on Wed May 06, 2020 10:26 am, edited 1 time in total.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: How do you change computer's name?
Yes I did try reboot, still the same.
LM 19.3 Xfce
Cause I like things neat and simple
Cause I like things neat and simple
Re: How do you change computer's name?
This is the content of vte-2.91.sh:
you might try creating it as the missing script vte.sh and see what happens.
EDIT - owner is root and it is executable, so you will need to change properties.
Code: Select all
# Copyright © 2006 Shaun McCance <shaunm@gnome.org>
# Copyright © 2013 Peter De Wachter <pdewacht@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Not bash or zsh?
[ -n "$BASH_VERSION" -o -n "$ZSH_VERSION" ] || return 0
# Not an interactive shell?
[[ $- == *i* ]] || return 0
# Not running under vte?
[ "${VTE_VERSION:-0}" -ge 3405 ] || return 0
__vte_urlencode() (
# This is important to make sure string manipulation is handled
# byte-by-byte.
LC_ALL=C
str="$1"
while [ -n "$str" ]; do
safe="${str%%[!a-zA-Z0-9/:_\.\-\!\'\(\)~]*}"
printf "%s" "$safe"
str="${str#"$safe"}"
if [ -n "$str" ]; then
printf "%%%02X" "'$str"
str="${str#?}"
fi
done
)
# Print a warning so that anyone who's added this manually to his PS1 can adapt.
# The function will be removed in a later version.
__vte_ps1() {
echo -n "(__vte_ps1 is obsolete)"
}
__vte_osc7 () {
printf "\033]7;file://%s%s\007" "${HOSTNAME:-}" "$(__vte_urlencode "${PWD}")"
}
__vte_prompt_command() {
local pwd='~'
[ "$PWD" != "$HOME" ] && pwd=${PWD/#$HOME\//\~\/}
printf "\033]0;%s@%s:%s\007%s" "${USER}" "${HOSTNAME%%.*}" "${pwd}" "$(__vte_osc7)"
}
case "$TERM" in
xterm*|vte*)
[ -n "$BASH_VERSION" ] && PROMPT_COMMAND="__vte_prompt_command"
[ -n "$ZSH_VERSION" ] && precmd_functions+=(__vte_osc7)
;;
esac
true
EDIT - owner is root and it is executable, so you will need to change properties.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: How do you change computer's name?
ok thanks , but found this solution that fixed it .
earlier i installed the budgie DE ,didn't like it so uninstalled again.
seems that created that problem
earlier i installed the budgie DE ,didn't like it so uninstalled again.
seems that created that problem
LM 19.3 Xfce
Cause I like things neat and simple
Cause I like things neat and simple
- paddys-hill
- Level 1
- Posts: 33
- Joined: Mon Jun 14, 2021 5:07 pm
- Location: All over the Adelaide Hills and Fleurio region of South Australia
Re: [Solved] How do you change computer's name?
(Knock, knock Sorry to disturb you folks but it looks like a knowledgable enough group for this)
Where can I set up the domainname for a server and how do I make it persist?
tia
Where can I set up the domainname for a server and how do I make it persist?
tia
Paddys-Hill Co-op co-ordinator & sysadmin
Acer Aspire A315-21G (AMD A9-9420 RADEON R5) running 5.11.0-22-generic
Distro: Linux Mint 20.1 Ulyssa DE:Cinnamon 4.8.6 WM: muffin 4.8.1 DM: LightDM 1.30.0
Acer Aspire A315-21G (AMD A9-9420 RADEON R5) running 5.11.0-22-generic
Distro: Linux Mint 20.1 Ulyssa DE:Cinnamon 4.8.6 WM: muffin 4.8.1 DM: LightDM 1.30.0
Re: How do you change computer's name?
Thank you!!! worked perfectly!AndyMH wrote: ⤴Tue May 05, 2020 6:09 pm To find out your computer name, in a terminal eitherhostname
orhostnamectl
which gives you a bit more info.
To change your hostname in a terminalhostnamectl set-hostname 'newname'
. Then verify it has changed by using one of the first commands again.
It helps to keep hostnames short.Code: Select all
andy@T432 ~ $ hostnamectl Static hostname: T432 Icon name: computer-laptop Chassis: laptop Machine ID: 4095cb9d62054733b651d895c996ea84 Boot ID: 954a8515183842cbafb05c3209afc068 Operating System: Linux Mint 19 Kernel: Linux 4.15.0-99-generic Architecture: x86-64 andy@T432 ~ $ hostname T432 andy@T432 ~ $ hostnamectl set-hostname 'T433' andy@T432 ~ $ hostname T433 andy@T432 ~ $ hostnamectl set-hostname 'T432' andy@T432 ~ $ hostname T432
I'm here to learn!
Re: [Solved] How do you change computer's name?
This is a temporary fix. Type this in the terminal:i did that and the name changed , but now i have this bash line on top every time i open terminal.
how to get rid of that?
Code: Select all
PS1=$
PROMPT_COMMAND=
echo -en "\033]0;my_new_name\a"