39

Hi I am going through some tutorials. When I try to execute systemd-resolve --status in Ubuntu 22.04 desktop, system reports command not found. What am I doing wrong here?

I tried running sudo apt-get install -y systemd but it seems like systemd-resolve is not installed. Please help.

4
  • 1
    Please try: sudo service systemd-resolved status Welcome to Ask Ubuntu.
    – chili555
    May 20, 2022 at 22:58
  • 2
    @chili555 The systemd-resolve used to be a command in former Ubuntu versions. It's not the deamon systemd-resolved. Apparently it got removed, or left out.
    – ubfan1
    May 21, 2022 at 1:24
  • @ubfan1 It works perfectly well on my fully updated 22.04 system.
    – chili555
    May 25, 2022 at 13:25
  • 1
    @chili555 your command only shows the status of the currently running systemd-resolved service - which shows process info and recent log output. This is not the same thing as the output from resolvectl status (or systemd-resolved --status in prior ubuntu version). "resolvectl status" outputs nameserver information and other configuration information that isn't available in the service output. Aug 2, 2022 at 21:56

2 Answers 2

60

Use resolvectl status instead.

In systemd 239 systemd-resolve has been renamed to resolvectl (see here).

For the most part resolvectl offers the same options as systemd-resolve, though they may be named slightly differently. Run resolvectl --help to find what you are looking for.

1
  • 1
    It's not a 1:1 replacement though. There's no --set-dns option that was available on systemd-resolve.
    – Tony Maro
    Aug 16, 2022 at 20:12
9

Here I updated ubuntu to 22.04 and my VPN stopped working. I fixed it with: sudo ln /usr/bin/resolvectl /usr/bin/systemd-resolve

3
  • Thank you so much! This solved my problem (Ubuntu server 22.04 )!
    – Issam2204
    Nov 8, 2022 at 16:01
  • this works thanks! Nov 12, 2022 at 14:56
  • +1 I would suggest to do a symbolic link instead with sudo ln -s /usr/bin/resolvectl /usr/bin/systemd-resolve. This is more transparant as ls -l /usr/bin/systemd-resolve will show that is is only a link to /usr/bin/resolvectl
    – zs11
    Feb 28 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.