3

My Ubuntu 22.04 LTS seems to have problems with dpkg and I can't find anyone online that has the same issue as me. It makes me not able to install packages and I just don't know how to fix this.

Setting up dpkg (1.21.1ubuntu2.1) ...
head: error reading 'info_silent': Is a directory
dpkg: error processing package dpkg (--configure):
 installed dpkg package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 dpkg
E: Sub-process /usr/bin/dpkg returned an error code (1)

My Ubuntu Server version:

Distributor ID: Ubuntu
Description:    Ubuntu 22.04 LTS
Release:        22.04
Codename:       jammy

I've read that a reinstall is an option, but I also can't find a good way to reinstall LTS without losing my data.

miitchel
  • 255
  • 1
  • 2
  • 10

1 Answers1

17

I finally got this fixed, I found a YouTube video that fixed my issue. These are the commands that fixed my problem:

sudo mv /var/lib/dpkg/info /var/lib/dpkg/info_silent
sudo mkdir /var/lib/dpkg/info
sudo apt-get update
sudo apt-get -f install
sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info_silent
sudo rm -rf /var/lib/dpkg/info
sudo mv /var/lib/dpkg/info_silent /var/lib/dpkg/info
miitchel
  • 255
  • 1
  • 2
  • 10
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 01 '22 at 07:39
  • 1
    My do-release-upgrade from Ubuntu 20.04LTS to 22.04LTS failed with this dpkg error. The fix from @miitchel worked for me. I copied and pasted those lines. – freeAR Oct 20 '22 at 17:52
  • Running this completely trashed my environment. Got some trouble with `apt-news.service` or something, and couldn't run any apt commands afterwards. Be cautious before copy pasting. – Sindre Bakke Øyen Apr 29 '23 at 16:56