package base-files 12ubuntu4.2 failed to install/upgrade: subprocess new pre-removal script returned error exit status 1
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
base-files (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
my dpkg dir is delete how to recover
ProblemType: Package
DistroRelease: Ubuntu 22.04
Package: base-files 12ubuntu4.2
ProcVersionSign
Uname: Linux 5.19.0-32-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.3
Architecture: amd64
CasperMD5CheckR
Date: Thu Feb 23 07:24:22 2023
ErrorMessage: subprocess new pre-removal script returned error exit status 1
InstallationDate: Installed on 2022-10-18 (127 days ago)
InstallationMedia: Ubuntu 20.04.2.0 LTS "Focal Fossa" - Release amd64 (20210209.1)
Python3Details: /usr/bin/
PythonDetails: N/A
RelatedPackageV
dpkg 1.21.1ubuntu2.1
apt 2.4.8
SourcePackage: base-files
Title: package base-files 12ubuntu4.2 failed to install/upgrade: subprocess new pre-removal script returned error exit status 1
UpgradeStatus: Upgraded to jammy on 2022-10-26 (119 days ago)
information type: | Private Security → Public |
affects: | ubuntu → base-files (Ubuntu) |
tags: | removed: need-duplicate-check |
Your logs suggest that your /usr/bin/dpkg has been corrupted. There is no easy way to recover from this situation.
If you have another computer of the same architecture and running the same release, you can copy the /usr/bin/dpkg file from one computer to the other. If you don't have this, you can use apt download dpkg to download the dpkg package, use ar x to unpack the dpkg package, and then tar xf the data.tar.* file that was created. Then you can copy the usr/bin/dpkg from that over your /usr/bin/dpkg.
Good luck.