Well, this day is been like any other, why? because I was facing an issue a little bit similar but this time related to just some packages with the following message :
Log started: 2019-09-22 16:12:10
dpkg: unrecoverable fatal error, aborting:
reading files list for package 'apt': Bad address
Log ended: 2019-09-22 16:12:10
The way how I resolved it, was a little bit similar but with some differences such as:
Instead to rename the whole directory "/var/lib/dpkg/info/", I just moved the files (package names) that were causing me troubles, which in this case were the "apt" package(s).
- so I first filtered the packages related to the pattern '^apt' :
mlazo@mlazo-pc:~$ dpkg -l|awk '/^ii apt/ {print $2}'
apt
apt-config-icons
apt-config-icons-hidpi
apt-config-icons-large
apt-config-icons-large-hidpi
apt-transport-https
apt-utils
apt-xapian-index
aptdaemon
aptdaemon-data
- Being in the directory "/var/lib/dpkg/info", I created a directory and moved the files that matched with the previous list :
cd /var/lib/dpkg/info
mdkir ../info_back
mv -v $(ls |grep -i "^apt") ../info_back/
- Once the files were moved, I proceed to execute the reinstall process :
for x in $(dpkg -l| awk '/^ii apt/ {print $2}'); do apt-get install --reinstall ${x} -y ; done
- While it was processing, I was checking the "/var/log/apt/term.log", getting the following confirmations :
mlazo@mlazo-pc:~$ tail -n 20000 /var/log/apt/term.log |grep -i "preparing to unpack .../apt"
Preparing to unpack .../apt-config-icons_0.12.0-3ubuntu1_all.deb ...
Preparing to unpack .../apt-config-icons-hidpi_0.12.0-3ubuntu1_all.deb ...
Preparing to unpack .../apt-config-icons-large_0.12.0-3ubuntu1_all.deb ...
Preparing to unpack .../apt-config-icons-large-hidpi_0.12.0-3ubuntu1_all.deb ...
Preparing to unpack .../apt-transport-https_1.6.12_all.deb ...
Preparing to unpack .../apt-utils_1.6.12_amd64.deb ...
Preparing to unpack .../apt-xapian-index_0.47ubuntu13_all.deb ...
Preparing to unpack .../aptdaemon_1.1.1+bzr982-0ubuntu19.1_all.deb ...
Preparing to unpack .../aptdaemon-data_1.1.1+bzr982-0ubuntu19.1_all.deb ...
- Once the reinstall process finished, I proceed to execute the upgrade process, getting the successful outcome :
root@mlazo-pc:/var/lib/dpkg/info# apt-get upgrade
..
..
..
Processing triggers for initramfs-tools (0.130ubuntu3.8) ...
update-initramfs: Generating /boot/initrd.img-5.0.0-25-generic
Processing triggers for libvlc-bin:amd64 (3.0.8-0ubuntu18.04.1) ...
With the steps I previously executed it was completed in an interval of 30 minutes maybe than 4 hours.
Hope the previous steps could be helpful for someone.
Best regards,
Manuel Lazo