I got my first ever Raspberry Pi in the mail yesterday and today I thought it might need some updates as it's brand new. I used:

sudo apt-get update && sudo apt-get dist-upgrade

And all was fine, until the terminal showed a prompt asking what should be done with a preferences or config file. I don't know what it was, but the desktop background and system font were stored in the file. I opted to check out the differences between the current and the replacement file, but I couldn't find my way back in the terminal.

That terminal is now closed but I'm not sure if the upgrade process is finished. I've tried running the upgrade process again, plus just about everything I could find on google. Does anyone have some experience with this?

PS - It says:

Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)'

Edit: So I decided to reboot it. Everything seems to be fine, the login screen is there. The problem is now that my keyboard, mouse, and touch screen don't work anymore. Shutting down and starting up again didn't help either.

Is there anything I can do other than downloading NOOBS again?

  • download NOOBS again, If it comes to the same point asking what to do as before then ask for help in the Raspberry Pi forums. Be specific when asking for help - i.e. don't paraphrase messages or be vague (e.g. 'a preferences or config file' which one?). It's part of the learning process to make mistakes, and researching the issues and solving the problems is part of the process. – Charemer Sep 27 '17 at 12:28
  • dist-upgrade = update to latest OS Release (full system upgrade). upgrade = update all packages to the newest version for the currently installed release (package update). – crasic Sep 28 '17 at 0:28

Your current system is broken. As it is a new image, it is not worth trying to recover.

Install a new image.

I strongly recommend you download a new up-to-date image - what you have been supplied with is probably old, requiring extensive updates.

If you do upgrade DO NOT use dist-upgrade just use upgrade, at least initially.

If you are prompted to overwrite files just answer Yes. There will be nothing in there because you have not customised it.


Could not get lock /var/lib/dpkg/lock ..... is an indication that apt is running already and you can't start it twice.

And before a 'sudo apt-get dist-upgradeit is recommended to do a backup.

If you can edit the SD card in another computer and edit /boot/config.txt to startx=0.

Ref.: https://www.raspberrypi.org/documentation/configuration/config-txt/boot.md

and thereafter run apt update and follow the instructions.


When you use the apt/ directory at multiple places, this error occurs.

Watch where you use apt-get multiple times.

If problem exists still, try running

dpkg configure -a
  • 1
    What error, the keyboard not responding? – RalfFriedl Jun 16 '19 at 8:21

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.