77

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.

Anwar
  • 77,855
David
  • 791

8 Answers8

130

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
    
David Foerster
  • 36,890
  • 56
  • 97
  • 151
Panther
  • 104,528
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.

Anwar
  • 77,855
EmileBeaulieu
  • 101
  • 1
  • 3
5

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

4
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.

BuZZ-dEE
  • 14,533
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
mchid
  • 44,904
  • 8
  • 102
  • 162
1

I 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

Run the following commands 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.

Finally try to install the package you want to install and now there should be no error :)

zx485
  • 2,865
0

Execute

sudo dpkg --remove --force-all <insert package name here> 

followed by

sudo apt --fix-broken install

worked for me.

zx485
  • 2,865
Vee
  • 11