I am using Ubuntu 14.04.3 LTS, when I try to run command hostnamectl
I get error:
bash: hostnamectl: command not found
Which library shall I install to use hostnamectl
?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityhostnamectl
is provided by systemd-services
package in Ubuntu 14.04. You need to install that package to get the command line utility
sudo apt-get install systemd-services
# sudo hostnamectl set-hostname new_host_name Failed to get D-Bus connection: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
Sep 21, 2016 at 6:46
To find out which package a file is you can use apt- file:
sudo apt-get install apt-file
apt-file update
After using it it is as simple as :
ricardo@zeus:~$ apt-file search hostnamectl
cdist: /usr/lib/python3/dist-packages/cdist/conf/type/__hostname/explorer/has_hostnamectl
systemd: /usr/bin/hostnamectl
systemd: /usr/share/bash-completion/completions/hostnamectl
systemd: /usr/share/man/man1/hostnamectl.1.gz
systemd: /usr/share/zsh/vendor-completions/_hostnamectl
Once apt -file package tells you that the file is found , you just have to install it:
sudo apt-get install systemd
/usr/bin/hostnamectl
I get: bash: /usr/bin/hostnamectl: No such file or directory
Sep 18, 2016 at 10:21
ls /usr/bin
I can't see hostnamectl
, however, apt-file search hostnamectl
will show systemd: /usr/bin/hostnamectl
can you please exaplain?
Sep 18, 2016 at 10:24
systemd
. I'm not sure whether it's available to you without that (in 14.04 which doesn't usesystemd
)hostnamectl
in 14.04 by installingsystemd
?sudo apt-get install systemd-services
installed it successfullysystemd
but you installedsystemd-services
!!