58

Running Synaptic I get the following error message:

E: The package hl1440lpr needs to be reinstalled, but I can't find an archive for it.
E: Internal error opening cache (1). Please report.

Upon accepting the message, Synaptic quits.

2

7 Answers 7

94

Well we may need a few steps to fix this.

  1. Start with:

    sudo dpkg --remove --force-all hl1440lpr
    
  2. If that fails:

    sudo rm -i /var/lib/dpkg/info/hl1440lpr.*
    sudo dpkg --remove --force-remove-reinstreq hl1440lpr
    
  3. Confirm Apt is fixed. The following command should return no errors:

    sudo apt-get update
    
4
  • I ran into this situation when I was upgrading to Ubuntu 12.10 but accidently suspended the computer midway. Upon waking the computer, the upgrade had (obviously) failed and a red icon appeared next to the battery meter which said that E:The package xterm needs to be reinstalled, but I can't find an archive for it. Once I applied the suggestion here, sudo dpkg --remove --force-all xterm everything was fixed. Thanks! ps, it would be nice if you could edit sodo to say sudo, I wouldn't nitpick but that would derail someone who didn't know anything about linux. Oct 23, 2012 at 21:55
  • 1
    Thank you bodhi.zazen. Your solution worked for my faulty brother-driver; dcpj4110dwlpr.
    – v2r
    Dec 27, 2014 at 20:01
  • 1
    Perfect! First solution failed and hanged the process, but second one worked. Thanks! (tried on debian server)
    – Shautieh
    Jul 31, 2015 at 18:00
  • Just an addon to @panther The sudo dpkg --remove --force-all hl1440lpr did work for other packages, mine was a libperl5.22 that seems to have crash during an update. The only issue was that it required me to be in root permission. As I was in google cloud, su did not work until I made a password.
    – JustAGrump
    Feb 2, 2019 at 22:26
7

It turns out, this wouldn't repair using the regular commands because I had disabled the multiverse repository in the software and updates window, after installing the package.

I read to do this in a post somewhere else, and it wasn't until another post I read that had me double check to make sure it was ENABLED, then I realized I never should have disabled that in the first place.

Enabling the multiverse repository again enabled me to reinstall the package.


So, generally if this sorts of errors happen, make sure you haven't disabled the software source from which this package comes.

3
dpkg --remove --force-remove-reinstreq   broken---stuff

(plus file erasing)

works like a charm. synaptic should offer this function instead of dying and leaving people with a huge mess. synaptic is not user friendly.

1
  • 3
    you have to be careful with this command, depending on what you are removing, it could cascade into removing your entire desktop.
    – ravery
    Jul 5, 2017 at 16:44
1

Used this step sudo rm -i /var/lib/dpkg/info/package.*

sudo dpkg --remove --force-remove-reinstreq package

and after that residual config was reamining after using

sudo dpkg --purge package_name

everything got fixed.

1
  • This should be the accepted answer !
    – realtebo
    Aug 17, 2021 at 7:21
1

Just open /var/lib/dpkg/status file as root and remove the corresponding entry from it.

1
  • Extremely important. This resolved my problem. Oct 16, 2021 at 18:21
1

The package error can be because of abruptly closing the ongoing upgrade of packages. For this , you can use this linux command.

sudo apt-get --fix-broken install
0

run the following commond on the terminal

1)sudo cp /var/lib/dpkg/status status.bkp

2)sudo gedit /var/lib/dpkg/status

3)then Search for the package name that appears in the error. Note that, in our case the culprit package was ‘flectra’ which was in ‘purge reinstreq half-installed’ state. After you have located the culprit package, delete the section of information related to that package and save the file. In our case, we deleted the section related to ‘flectra’ inside the rectangle and saved the file. Close ‘gedit’ when done.

then try to install the pakage you want to install and you fill find no error now :)

New contributor
Ali Akbar is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

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.