1

Whenever I try to install any package I receive this error

0 upgraded, 1 newly installed, 0 to remove and 124 not upgraded.
Need to get 19.6 kB of archives.
After this operation, 81.9 kB of additional disk space will be used.
Get:1 http://sa.archive.ubuntu.com/ubuntu/ precise/main finger amd64 0.17-14 [19.6 kB]
Fetched 19.6 kB in 0s (36.6 kB/s) 
Selecting previously unselected package finger.
(Reading database ... 75%dpkg: unrecoverable fatal error, aborting:
 files list file for package 'libatk-adaptor' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)
bain
  • 11,260
OmiPenguin
  • 2,322

2 Answers2

0

Have you tried

sudo dpkg --configure -a

It can sometimes repair a broken database. Source How to repair apt-get command?

0

The problem is that the list of files in package libatk-adaptor has become corrupt. You can fix it for this package by doing:

wget http://za.archive.ubuntu.com/ubuntu/pool/main/a/at-spi2-atk/libatk-adaptor_2.4.0-1ubuntu2_amd64.deb

dpkg -c libatk-adaptor_2.4.0-1ubuntu2_amd64.deb | awk '{if ($6 == "./"){ print "/."; } \
else if (substr($6, length($6), 1) == "/")\
{print substr($6, 2, length($6) - 2); } \
else { print substr($6, 2, length($6) - 1);}}'\
> /var/lib/dpkg/info/libatk-adaptor.list

This will fix the immediate issue, but there might be a larger problem if other files on your hard disk are also corrupted. You will have to fix each of these files individually, and in the end it might be quicker, easier and more reliable to just do a fresh install.

bain
  • 11,260
  • I used above statement and it throw permission error bash: /var/lib/dpkg/info/libatk-adaptor.list: Permission denied dpkg-deb: error: subprocess tar was killed by signal (Broken pipe) – OmiPenguin Jun 17 '14 at 11:51
  • Do sudo -s to become root before executing the above – bain Jun 17 '14 at 12:08