59

I am going through some tutorials. When I try to execute systemd-resolve --status in Ubuntu 22.04 desktop, the system reports command is 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
  • 3
    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

3 Answers 3

86

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
  • 2
    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
15

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
  • 4
    +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, 2023 at 15:16
-2

First try these commands:

systemctl status 

or

sudo service --status-all 
1
  • 1
    This answer doesn't solve or address anything because it has no relevance to the fact that systemd-resolve was renamed, as pointed out in this answer: askubuntu.com/a/1410472/587804
    – miversen33
    Jan 13 at 17:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .