Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
apt apt-transport-https apt-utils dpkg libapt-inst2.0 libapt-pkg5.0 ntpdate
oracle-java8-installer oracle-java8-set-default thermald
10 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/4,389 kB of archives.
After this operation, 8,192 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Preconfiguring packages ...
dpkg: unrecoverable fatal error, aborting:
files list file for package 'linux-generic' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)
I already tried the usual stuff like:
sudo dpkg --configure -a
sudo apt-get -f install
sudo apt-get clean
sudo apt-get update && sudo apt-get upgrade
Any help, thanks!
cat -net /var/lib/dpkg/info/linux-generic.list
1 ^LbM-BM-^FRq^MU^Evalueq^NK^HubU^Mcertificationq^ONU^Hoverviewq^PNU$
2 updated_atq^QNU^Vavailable_translationsq^RNU^Dyearq^SMM-CM-^]^GU^Fimagesq^TNU^Bidq^UNU^Ipaused_atq^VNU^Eindex
![]()
pa4080
28.8k10 gold badges83 silver badges157 bronze badges
asked Apr 27, 2017 at 21:09
![]()
4
I had similar issues with the following error:
dpkg: unrecoverable fatal error, aborting:
files list file for package 'libboost-regex1.55.0:armhf' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)
However, the folder /var/lib/dpkg/info/linux didn’t exist on my system, as in previous post. (I was running Raspbian on a Raspberry pi 3)
I moved the following files:
/var/lib/dpkg/info/libboost-regex1.55.0:armhf.postrm
/var/lib/dpkg/info/libboost-regex1.55.0:armhf.list
Then ran:
sudo dpkg --configure -a
sudo apt update
sudo apt upgrade
It fixed the problem for me.
answered Aug 18, 2017 at 8:09
LeendertLeendert
3993 silver badges4 bronze badges
3
I finally had some time to fix this on my own. For future reference
I moved all the linux* files to somewhere else. ex: ~/ (home) sudo mv /var/lib/dpkg/info/linux* ./
sudo dpkg --configure -a
sudo apt update
sudo apt upgrade
That fixed it
answered May 13, 2017 at 5:43
![]()
Johnny WongJohnny Wong
3371 gold badge2 silver badges6 bronze badges
1
Firstly you have to remove that missing file
sudo rm /var/lib/dpkg/info/linux-generic.list
Now you can again reinstall it
sudo apt-get install linux-generic --reinstall
answered May 13, 2020 at 8:25
1
I had this issue:
dpkg: unrecoverable fatal error, aborting:
files list file for package 'rockchip-fstab' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)
sudo dpkg --configure -a also did not work for me.
So, I had to edit by vim /var/lib/dpkg/info/rockchip-fstab.list as:
/. from VH
Which fixed the issue.
answered Jul 6, 2020 at 12:15
Rakib FihaRakib Fiha
2561 silver badge11 bronze badges
I had a very similar issue and resolved it a different way, so I thought I’d share what I did. While attempting a sudo apt upgrade I received the following dpkg error:
dpkg: unrecoverable fatal error, aborting:
files list file for package 'python3-xdg' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)
I found python3-xdg.list in the /var/lib/dpkg/info/ directory and ran cat on the file. What printed out was something like this, with the command prompt immediately following the contents:
user@device:/var/lib/dpkg/info$ cat python3-xdg.list
sEDUsEDUsEDUuser@device:/var/lib/dpkg/info$
I thought I’d try editing the file, giving it the missing final newline, so printing the file would then display:
user@device:/var/lib/dpkg/info$ cat python3-xdg.list
sEDUsEDUsEDU
user@device:/var/lib/dpkg/info$
After this I had no more issues.
answered Jan 8, 2022 at 11:57
![]()
When i do a
apt-get upgrade
i get
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
linux-image-3.16.0-4-amd64 : Depends: initramfs-tools (>= 0.110~) but it is not installed or
linux-initramfs-tool
Recommends: firmware-linux-free (>= 3~) but it is not installed
Recommends: irqbalance but it is not installed
When i then try
apt-get -f install
It tells me
Selecting previously unselected package initramfs-tools.
dpkg: warning: files list file for package 'perl-base' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gcc-4.8-base:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'perl-modules' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'perl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'findutils' missing; assuming package has no files currently installed
dpkg: unrecoverable fatal error, aborting:
files list file for package `liberror-perl' contains empty filename
E: Sub-process /usr/bin/dpkg returned an error code (2)
How can i fix this?
I tried uninstalling those packages. Did not help because i cant.
asked Feb 28, 2017 at 11:16
5
Your package database seems to be badly messed up. You should re-install the affected packages:
apt-get --reinstall install perl-base gcc-4.8-base perl-modules perl findutils liberror-perl initramfs-tools
You can add any others which turn up in error messages.
If liberror-perl is too messed up for apt-get to work, try:
wget http://ftp.de.debian.org/debian/pool/main/libe/liberror-perl/liberror-perl_0.17-1.1_all.deb
dpkg -i liberror-perl_0.17-1.1_all.deb
although if the last «fatal error» in dpkg really is as bad as it sounds, you’ll need to do the above from a rescue system (mount your file systems under /mnt in the rescue system, then run dpkg --root=/mnt -i liberror-perl_0.17-1.1_all.deb).
answered Feb 28, 2017 at 15:13
Stephen KittStephen Kitt
387k50 gold badges995 silver badges1094 bronze badges
2
- Печать
Страницы: [1] Вниз
Тема: dpkg. unrecoverable fatal error, aborting (Прочитано 2287 раз)
0 Пользователей и 1 Гость просматривают эту тему.

perat
При попытке установки любого пакета, появляется ошибка:
(Reading database ... 75%dpkg: unrecoverable fatal error, aborting:
files list file for package `libgtk2.0-cil' contains empty filename
E: Sub-process /usr/bin/dpkg returned an error code (2)
Что делать? 

ArcFi
sudo mv /var/lib/dpkg/status{,.bak} ; sudo cp /var/lib/dpkg/status{-old,}

perat
sudo mv /var/lib/dpkg/status{,.bak} ; sudo cp /var/lib/dpkg/status{-old,}
Не помогло:
taras@taras-desktop:~$ sudo mv /var/lib/dpkg/status{,.bak} ; sudo cp /var/lib/dpkg/status{-old,}
taras@taras-desktop:~$ sudo apt-get upgrade
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
taras@taras-desktop:~$ sudo dpkg --configure -a
Processing triggers for python-central ...
taras@taras-desktop:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
opera
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/15.8MB of archives.
After this operation, 4,155kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Preconfiguring packages ...
(Reading database ... 75%dpkg: unrecoverable fatal error, aborting:
files list file for package `libgtk2.0-cil' contains empty filename
E: Sub-process /usr/bin/dpkg returned an error code (2)

ArcFi

perat
- Печать
Страницы: [1] Вверх
Re: dpkg: unrecoverable fatal error, aborting:
Hi guys,
I know it is a pretty old post, but I get the solution, so if anybody also runs into that problem, he will get the solution too.
When the error appears, it is related with a certain package which info is corrupted in the dpkg database. In my situation, I get the following :
(Reading database … 55%dpkg: unrecoverable fatal error, aborting:
failed in buffer_read(fd): files list for package `kde-icons-oxygen’: Input/output error
E: Sub-process /usr/bin/dpkg returned an error code (2)So the solution is the following :
1. Go into the /var/lib/dpkg directory
2. Make a backup of the «status» file
3. Edit the «status» file
4. Search the package that gave the error
5. Just delete the lines from this package (but let all other lines that concern other packages even if they contains the broken package in their «Replaces» or «Depends» fields)Personally, here are the lines that I deleted :
Package: kde-icons-oxygen
Status: purge ok installed
Priority: optional
Section: kde
Installed-Size: 42952
Maintainer: Kubuntu Developers <kubuntu-devel@lists.ubuntu.com>
Architecture: all
Source: oxygen-icons
Version: 4:4.3.5-0ubuntu1~karmic1
Replaces: dolphin (<< 4:4.1.86+svn902162), kdebase-data (<= 4:4.0.0-1), kmail (<< 4:4.3.2), libkdepim4 (<< 4:4.2.85), step (<< 4:4.3.0)
Suggests: kdebase (>= 4:4.1.0-1)
Description: Oxygen icon theme for KDE 4
Oxygen is the standard icon theme for KDE 4.
Homepage: http://www.kde.org/
Original-Maintainer: Jonathan Riddell <jriddell@ubuntu.com>6. Save changes in the «status» file
7. Run: sudo dpkg dpkg —configure -a
8. Force the reinstallation of missing dependencies (because now, there are some) : sudo apt-get -f install
I think that if the broken package does not depend on any other package (could be rare), just reinstall it : sudo apt-get install the_package
9. Everything is fine nowcan update, upgrade, or install new packages !
Hope this will help someone !
Cheers,
Gartss
I am trying to install packages on my linux OS using the command apt-get install ....
The problem is that I get this error:
Selecting previously unselected package liberror-perl.
dpkg: unrecoverable fatal error, aborting:
files list file for package 'java-common' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)
Googling the error (even line by line), the solution SEEMS to be «to download and install missing packages to resolve dependencies» as it was point out here. The problem is that when I try to execute sudo apt-get -f install I continue to have the same error again and again. Any suggestion? How can I change the packages if I cannot use apt-get?
asked Sep 23, 2016 at 15:51
![]()
Leos313Leos313
4,8526 gold badges38 silver badges66 bronze badges
I have solved the problem using the python script:
#!/usr/bin/python
# 8th November, 2009
# update manager failed, giving me the error:
# 'files list file for package 'xxx' is missing final newline' for every package.
# some Googling revealed that this problem was due to corrupt files(s) in /var/lib/dpkg/info/
# looping though those files revealed that some did not have a final new line
# this script will resolve that problem by appending a newline to all files that are missing it
# NOTE: you will need to run this script as root, e.g. sudo python newline_fixer.py
import os
dpkg_path = '/var/lib/dpkg/info/'
paths = os.listdir(dpkg_path)
for path in paths:
path = dpkg_path + path
f = open(path, 'a+')
data = f.read()
if len(data) > 1 and data[-1:] != 'n':
f.write('n')
print 'added newline character to:', path
f.close()
After running the script with the command sudo python name_script.py, the problem was solved: it seems that some files were corrupted. The solution was proposed here
![]()
answered Sep 23, 2016 at 16:00
![]()
Leos313Leos313
4,8526 gold badges38 silver badges66 bronze badges
2
You have to remove that missing file
sudo rm /var/lib/dpkg/info/java-common.list
Now you can reinstall this
sudo apt-get install java-common --reinstall
answered May 13, 2020 at 8:37
4
If you get the below error
dpkg: unrecoverable fatal error, aborting:
files list file for package ‘java-common’ is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)
Note : java-common is the list name
Solve this using below commands(Modify java-common with your list name)
sudo rm /var/lib/dpkg/info/java-common.list
sudo apt-get install java-common —reinstall
sudo dpkg —configure -a
sudo apt update
sudo apt upgrade
answered Apr 27, 2021 at 6:24
1
- sudo dpkg —configure -a
- sudo apt-get -f install sudo apt-get clean
- sudo apt-get update && sudo apt-get upgrade
It fixed the problem for me.
answered Oct 14, 2021 at 14:07
![]()
2
I tried the below command and it worked for me
$ sudo apt-get update
$ sudo apt update && sudo apt upgrade
![]()
Suraj Rao
29.3k11 gold badges96 silver badges103 bronze badges
answered Jul 16, 2022 at 6:24
dpkg, the nasty error
Scenario, you run apt-get update and it all goes pear shaped!
There will probably be a series of errors like «dpkg: warning: files list file for package `xxxxxxxxxxx’ missing, assuming package has no files currently installed.», culminating in this;
(Reading database ... 55%dpkg: unrecoverable fatal error, aborting: files list file for package `linux-headers-3.2.0-31-generic' contains empty filename E: Sub-process /usr/bin/dpkg returned an error code (2)
See what the package erroring above is, in this case `linux-headers-3.2.0-31-generic’.
Fix /var/lib/dpkg/status
- Remove the entire section given in error above, in this case `linux-headers-3.2.0-31-generic’ from the ‘status’ file (cntrl-K to delete the lines in nano).
i.e. the line starting Package: to the line above the next Package: line. e.g. All the below.
$ sudo nano -w /var/lib/dpkg/status #Remove this Package: linux-headers-3.2.0-31-generic Status: install ok installed Priority: optional Section: devel Installed-Size: 10968 Maintainer: Ubuntu Kernel Team <kernel-team@lists.ubuntu.com> Architecture: amd64 Source: linux Version: 3.2.0-31.50 Provides: linux-headers, linux-headers-3.0 Depends: linux-headers-3.2.0-31, libc6 (>= 2.14) Description: Linux kernel headers for version 3.2.0 on 64 bit x86 SMP This package provides kernel header files for version 3.2.0 on 64 bit x86 SMP. . This is for sites that want the latest kernel headers. Please read /usr/share/doc/linux-headers-3.2.0-31/debian.README.gz for details.
Fix apt-get
$ sudo apt-get -f install Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following extra packages will be installed: linux-headers-3.2.0-31-generic The following NEW packages will be installed linux-headers-3.2.0-31-generic 0 upgraded, 1 newly installed, 0 to remove and 9 not upgraded. Need to get 983 kB of archives. After this operation, 11.2 MB of additional disk space will be used. Do you want to continue [Y/n]?
You should then get still the initial errors «dpkg: warning: files list file for package `xxxxxxxxxxx’ missing, assuming package has no files currently installed.», but it should install the problem package ok, viz `linux-headers-3.2.0-31-generic’.
Now run
$ sudo apt-get dist-upgrade
Yet again you should see «dpkg: warning: files list file for package `xxxxxxxxxxx’ missing, assuming package has no files currently installed.».
Now do this replacing xxxxxxx with all the package names above that appear.
sudo apt-get install --reinstall xxxxxxxxxx
They should all now reinstall without a problem and you are good to go, problem now fixed! (at least mine was)