
Durante uma atualização para 12.04 hoje, recebi um erro ao executar o gancho pós-instalação do resolvconf
pacote:
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.
Bem, certamente tentei executar chattr -i /etc/resolv.conf
, mas dpkg --configure resolvconf
produzi o mesmo erro.
Tentei mover ou excluir o arquivo manualmente, mas não consigo fazer isso nem como 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
Sou capaz de criar e excluir um arquivo em/etc (como root), para que a partição raiz não seja montada como somente leitura ou algo assim. Também:
lsattr /etc/resolv.conf
-----a--------- /etc/resolv.conf
Responder1
No meu caso, é o atributo imutável do arquivo que está causando isso. Então fazsudo chattr -a -i /etc/resolv.conf
Responder2
conforme os arquivos de ajuda ( man chattr
),
A file with the `a' attribute set can only be open in append mode for writing.
No seu caso o arquivo tem esse atributo
The operator `+' causes the selected attributes to be added to the
existing attributes of the files; `-' causes them to be removed;
Então o comando para tentar seria
sudo chattr -a /etc/resolv.conf
e tente listar os atributos mais uma vez usando
lsattr /etc/resolv.conf
Então tente excluir o arquivo