37

I get this error when I use apt-get upgrade & apt-get autoremove and on every apt-get [Something].. and when I try to install applications too:

Errors were encountered while processing:
man-db
E: Sub-process /usr/bin/dpkg returned an error code (1)
Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83
R9TySix
  • 555

6 Answers6

25

No solution mentioned in the answers worked for me and I tried a solution mentioned here on Ubuntu Forums, executing the command

sudo dpkg -i --force-all [deb file path]

and that worked.

Zanna
  • 70,465
  • What is [deb file path] ? – GreenAsJade Mar 27 '14 at 00:04
  • 1
    That is the path of .deb file – Ravindra Gullapalli Mar 27 '14 at 09:56
  • 1
    Thanks for replying, and sorry for my ignorance. I had this problem, and I don't know what .deb file you are referring to (I solved the problem using the "delete *.dat" file approach below, but I didn't like that much (like, whoa, this seems hacky) – GreenAsJade Mar 27 '14 at 10:13
  • 1
    I strongly will not recommend to use the --force key unless a user fully understands what he is doing. Such options exist only for situations where the user knows that the error will not lead to any serious problems, one must not use it carelessly – d.k Jan 08 '15 at 10:34
  • worked great for man-db issues. – scipper May 30 '18 at 19:08
  • This worked for libkf5kdegamesprivate1 and ksudoku. (For context: The problem happened after I added the neon ppa to kubuntu and dist-updated everything) – Galacticai Sep 18 '20 at 17:32
  • dpkg: error: cannot access archive '/tmp/apt-dpkg-install-ck5V9z/11-linux-tools-common_5.4.0-165.182_all.deb': No such file or directory – Cerin Oct 24 '23 at 21:18
16

Please read the comments below. This may be a dangerous command to run on your system and create an unrecoverable state. (the lines have been commented out to prevent copy-and-paste sysadmin'ing).


Simple and working i tried it !!

sudo -s
# cd /var/cache/debconf
# rm *.dat
apt-get update && apt-get upgrade

Enjoy ;)

ucefkh
  • 1,780
7

You may also want to know that you can use dpkg --audit to see what the actual problem is.

If the output is something like:

The following packages are in a mess due to serious problems during installation. 
They must be reinstalled for them (and any packages that depend on them) 
to function properly:
  gcdemu A GNOME panel applet to control CDEmu daemon

The following packages have been unpacked but not yet configured.
They must be configured using dpkg --configure or the configure
menu option in dselect for them to work:
 cdemu-daemon CDEmu daemon
 cdemu-client A simple command-line client to control CDEmu daemon

The following packages are only half configured, probably due to problems
configuring them the first time. The configuration should be retried using
dpkg --configure <package> or the configure menu option in dselect:
 transmission-daemon lightweight BitTorrent client (daemon)
 vhba-dkms VHBA virtual host bus adapter module

You could run the command: dpkg --configure <packagename>

 dpkg --configure cdemu-daemon

In order to

Reconfigure an unpacked package. 
If -a  or  --pending  is  given instead of package, all unpacked but unconfigured
packages are configured.

Furthermore you could use:

sudo apt-get -f install
sudo apt-get --reinstall install gcdemu

To fix the packages that are in a mess.

Examples from here: http://ubuntuforums.org/archive/index.php/t-1502826.html

Zanna
  • 70,465
First Name
  • 81
  • 1
  • 2
5

You have to run those commands with sudo preceding them so they can be executed with super user credentials Example:

sudo apt-get autoremove "NAME OF PACKAGE HERE"
Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83
5

community wiki answer - solved by OP

This problem was resolved by running the following terminal command:

sudo dpkg-reconfigure -phigh -a
fossfreedom
  • 172,746
1

If you have deleted /var/cache in a misguided attempt to clean up (like I did), this might fix the issue (it did for me):

sudo mkdir /var/cache/debconf