During an upgrade to 12.04 today I've got an error when running post-install hook for resolvconf
package:
Setting up resolvconf (1.63ubuntu11) ...
resolvconf.postinst: Error: Cannot replace the current /etc/resolv.conf with a symbolic link because it is immutable. To correct this problem, gain root privileges in a terminal and run 'chattr -i /etc/resolv.conf' and then 'dpkg --configure resolvconf'. Aborting.
Well, surely I tried running chattr -i /etc/resolv.conf
, but dpkg --configure resolvconf
produced the same error.
I tried to move or delete the file manually, but I can't do this even as root:
sudo mv /etc/resolv.conf /etc/resolv.conf.old
mv: cannot move `/etc/resolv.conf' to `/etc/resolv.conf.old': Operation not permitted
sudo rm /etc/resolv.conf
rm: cannot remove `/etc/resolv.conf': Operation not permitted
I am able to create and then delete a file in /etc (as root), so the root partition is not mounted read-only or anything. Also:
lsattr /etc/resolv.conf
-----a--------- /etc/resolv.conf
For my case, is the immutable attribute of the file causing it. So do
sudo chattr -a -i /etc/resolv.conf
as per the help files (
man chattr
),In your case the file has this attribute
So the command to try would be
and try listing the attributes once again using
Then try deleting the file