Using a Pi 3

If I run sudo apt-get upgrade, I get this result:

W: Unable to read /etc/apt/apt.conf.d/ - DirectoryExists (2: No such file or directory)
E: Could not open lock file /var/lib/dpkg/lock - open (2: No such file or directory)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
pi@raspberrypi:~ $ 

Here is the output of uname -a:

Linux raspberrypi 4.4.26-v7+ #915 SMP Thu Oct 20 17:08:44 BST 2016 armv7l GNU/Linux

And here is the output of cat /etc/os-release:

PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION="8 (jessie)"

What is causing the error?

  • 1
    Could you edit your question and add the output of uname -a and cat /etc/os-release? – joan Feb 23 '17 at 9:01
  • 1
    What ist the output of ls /; ls /etc; ls /etc/apt; ls /etc/apt/apt.conf.d; ls /var; ls /var/lib; ls /var/lib/dpkg ? – MadMike Feb 23 '17 at 16:31
  • ls: cannot access /var/lib/dpkg: No such file or directory ls: cannot access /etc/apt: No such file or directory ls: cannot access /etc/apt/apt.conf.d: No such file or directory – Ralfe Feb 23 '17 at 19:31
  • Sorry, but you have a bad disk. This is basically data corruption and there is little you can do to fix it. Also, before doing apt-get upgrade you must first execute apt-get update – fcm Feb 24 '17 at 5:10
  • I think that the problem is with odoo image. using odoo image, i think that it's not possible to use sudo command – Ralfe Feb 28 '17 at 19:29

Your Answer

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

Browse other questions tagged or ask your own question.