Во время обновления до 12.04 сегодня у меня возникла ошибка при запуске ловушки после установки для пакета resolvconf
:
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.
Ну, конечно, я пробовал запустить chattr -i /etc/resolv.conf
, но dpkg --configure resolvconf
выдает ту же ошибку.
Я пытался переместить или удалить файл вручную, но я не могу сделать это даже с правами 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
Я могу создать, а затем удалить файл в / etc ( как root), поэтому корневой раздел не монтируется только для чтения или чего-либо еще. Также:
lsattr /etc/resolv.conf
-----a--------- /etc/resolv.conf
согласно файлам справки (man chattr
),
A file with the `a' attribute set can only be open in append mode for writing.
В вашем случае файл имеет этот атрибут
The operator `+' causes the selected attributes to be added to the
existing attributes of the files; `-' causes them to be removed;
, поэтому команда для попытки будет
sudo chattr -a /etc/resolv.conf
и попробуйте перечислить атрибуты еще раз, используя
lsattr /etc/resolv.conf
Затем попробуйте удалить файл
В моем случае это неизменяемый атрибут вызывающего его файла. Так что sudo chattr -a -i /etc/resolv.conf