1

I am using Ubuntu Server 16.04 and am getting the following error while updating the system (sudo apt update && sudo apt upgrade -y):

You might want to run 'apt-get -f install' to correct these.  
The following packages have unmet dependencies: 
klibc-utils : Depends:
              libklibc (= 2.0.4-8ubuntu1.16.04.4) but 2.0.4-8ubuntu1.16.04.3 is installed  
E: Unmet dependencies. Try using -f.

After running sudo apt -f install I got the following error:

pkg: error processing archive /var/cache/apt/archives/libklibc_2.0.4-8ubuntu1.16.04.4_amd64.deb (--unpack): unable to create '/lib/klibc-k3La8MUnuzHQ0_kG8hokcGAC0PA.so.dpkg-new' (while processing './lib/klibc-k3La8MUnuzHQ0_kG8hokcGAC0PA.so'): Permission denied Errors were encountered while processing: /var/cache/apt/archives/libklibc_2.0.4-8ubuntu1.16.04.4_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)

I cannot manually rename/move file "klibc-k3La8MUnuzHQ0_kG8hokcGAC0PA.so" present in /lib directory

root@xxxxx:/lib# mv klibc-k3La8MUnuzHQ0_kG8hokcGAC0PA.so klibc-k3La8MUnuzHQ0_kG8hokcGAC0PA.so_bak   
mv: cannot move 'klibc-k3La8MUnuzHQ0_kG8hokcGAC0PA.so'  
  to 'klibc-k3La8MUnuzHQ0_kG8hokcGAC0PA.so_bak': Permission denied
1

I fixed this by removing the immutable flag on /lib

chattr -i /lib
rm /lib/klibc-xyzfile
apt-get -f install

then it all worked fine.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.