This question already has an answer here:

first of all, I'm a real beginner in linux, and I just currently installed ubuntu 16.4 on my 64bit ideaPad 110, and here is the problem.

I was trying to install php using this command,

sudo apt-get install php7.0-cli

It finished the download, but at the end it didn't install because of

Unable to lock the administration directory (/var/lib/dpkg/)

Then I try to install the downloaded packages on /cache/ directory using sudo dpkg -i [packagename.deb], it failed.

Now, anything I do, just gives me this

dpkg: error processing package php (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

I searched the keyword E: Sub-process /usr/bin/dpkg returned an error code (1) but nothing helps.

marked as duplicate by waltinator, Fabby, user68186, David Foerster, Eric Carvalho Apr 20 '18 at 19:26

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    That error is completely generic - it occurs for almost any package management problem. Searching for it will not yield anything. Please edit your question and add the full output of sudo apt install -f. Did you add some repositories before this happened? – Zanna Apr 18 '18 at 17:33
  • Thanks @Zanna, but it doesn't help I have tried that many times, – khaisar muksid Apr 19 '18 at 17:11
  • I have tried every single suggestion here askubuntu.com/questions/688338/…, many times, including restarting my machine, too. It's still the same,, – khaisar muksid Apr 19 '18 at 17:15
  • It wasn't me who suggested the duplicate (I don't agree with that suggestion), and I asked you to show us the output, to see more about your problem. – Zanna Apr 19 '18 at 18:41
  • Oh Zana, of course, I didn't mean you, I just forgot to mention @waltinator.. and well, it's still the same, I have no idea what to do, dropbox.com/s/2hx4j8pl4cli0au/file.txt?dl=0 – khaisar muksid Apr 20 '18 at 10:30