"hostname" command not found

Ask questions about Arch Linux ARM. Please search before making a new topic.

"hostname" command not found

Postby langfingaz » Thu Apr 06, 2023 5:44 pm

Hey, I have an Odroid XU-4 runnig archlinux ARM.

When I run hostname, I get

$this->bbcode_second_pass_code('', '
$ hostname
-bash: hostname: command not found
')

pacman -F shows that hostname is e.g. provided by gettext, which I have installed. I did even reinstall it.

$this->bbcode_second_pass_code('', '
$ pacman -F hostname
core/gettext 0.21.1-2 (base-devel) [installed: 0.21.1-5]
usr/lib/gettext/hostname
')

When I execute hostname with the full path (/usr/lib/gettext/hostname), it works.

I didn't change much in my setup except the basics. So no path modifications. Here is my current path variable:

$this->bbcode_second_pass_code('', '
$ echo "$PATH"
/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
')

Do you have any ideas what might be wrong with my setup and how I could fix it? Thanks!
langfingaz
 
Posts: 2
Joined: Thu Apr 06, 2023 5:35 pm

Re: "hostname" command not found

Postby karog » Thu Apr 06, 2023 6:35 pm

I have an XU4 running mainline kernel. I have core/gettext installed but I also have core/inetutils installed which has hostname at /usr/bin/hostname which would be found in your default path. I expect inetutils comes in the initial install but I can't say for certain I never manually installed it. I have had the XU4 for several years. I have 4 other arch installs (N2+, pogoplug e02, 2 RPi zero w) and they all have inetutils.
karog
 
Posts: 305
Joined: Thu Jan 05, 2012 7:55 pm

Re: "hostname" command not found

Postby langfingaz » Thu Apr 06, 2023 9:24 pm

Thanks for the quick reply and the hint with inetutils.

On my other (older) Arch Linux machines, there is inetutils installed. So that's why I was used to having the "hostname" command available. But one fresh x86 Arch installation is also missing the hostname command (in its path) as it does also not have inetutils installed.

So I'll either just add inetutils to my "base" packages list for new installations or use something like "hostnamectl hostname" in bash scripts - the latter is part of systemd and therefore available.
langfingaz
 
Posts: 2
Joined: Thu Apr 06, 2023 5:35 pm


Return to User Questions

Who is online

Users browsing this forum: No registered users and 41 guests