ubuntu-serverubuntu-22.04lts

dpkg fails on Ubuntu Server 22.04 LTS


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.


Solution

  • 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