The error “resolvconf: Error: /etc/resolv.conf must be a symlink” occurs when the /etc/resolv.conf
file on a Linux system is not a symbolic link, which is the expected configuration for systems using the resolvconf package.
The solution to this error is to create a symbolic link for /etc/resolv.conf
pointing to /run/resolvconf/resolv.conf
. This can be done using the following steps:
- Back up the current
/etc/resolv.conf
file:
sudo cp /etc/resolv.conf /etc/resolv.conf.bak
- Remove the current
/etc/resolv.conf
file:
sudo rm /etc/resolv.conf
- Create a symbolic link for
/etc/resolv.conf
pointing to/run/resolvconf/resolv.conf
:
sudo ln -s /run/resolvconf/resolv.conf /etc/resolv.conf
- Verify that the symbolic link has been created correctly:
ls -l /etc/resolv.conf
This should return output similar to the following, indicating that /etc/resolv.conf
is a symbolic link:
lrwxrwxrwx 1 root root 32 Jan 1 12:00 /etc/resolv.conf -> /run/resolvconf/resolv.conf
After creating the symbolic link, the resolvconf error should no longer occur. If necessary, you can restore the original /etc/resolv.conf
file from the backup created in step 1.