apt upgrade error

14 Antworten [Letzter Beitrag]
fizz
Offline
Beigetreten: 01/11/2020

Hello,

Running Trisquel 8 and When I sudo apt-get upgrade I get the following error:

dpkg: unrecoverable fatal error, aborting:
files list file for package 'libalkimia4' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)

Also, am not able to install or uninstall apps.

Can this error be fixed?

Thank you

chaosmonk

I am a member!

I am a translator!

Offline
Beigetreten: 07/07/2017

> Running Trisquel 8 and When I sudo apt-get upgrade I get the following error:
>
> dpkg: unrecoverable fatal error, aborting:
> files list file for package 'libalkimia4' is missing final newline
> E: Sub-process /usr/bin/dpkg returned an error code (2)
>
> Also, am not able to install or uninstall apps.

Try running

$ sudo apt install -f

fizz
Offline
Beigetreten: 01/11/2020

sudo apt install -f gets me the same error

chaosmonk

I am a member!

I am a translator!

Offline
Beigetreten: 07/07/2017

> sudo apt install -f gets me the same error

Try this:

$ sudo apt install --reinstall libalkimia4

and if that doesn't work try this:

$ apt download libalkimia4 && sudo dpkg -i libalkimia4*.deb

and if that doesn't work try this:

$ sudo apt purge libalkimia4 && sudo apt install libalkimia4

paying close attention to what gets removed by the apt purge command so
that if something important gets removed you can reinstall it once your
system works.

If any of those lines works successfully, run

$ sudo apt install -f

again after.

fizz
Offline
Beigetreten: 01/11/2020

Thanks for these, I appreciate it.

The results of each command were the following:

$ sudo apt install --reinstall libalkimia4

dpkg: unrecoverable fatal error, aborting:
files list file for package 'libalkimia4' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)

$ apt download libalkimia4 && sudo dpkg -i libalkimia4*.deb

dpkg: unrecoverable fatal error, aborting:
files list file for package 'libalkimia4' is missing final newline

$ sudo apt purge libalkimia4 && sudo apt install libalkimia4

dpkg: unrecoverable fatal error, aborting:
files list file for package 'libalkimia4' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)

chaosmonk

I am a member!

I am a translator!

Offline
Beigetreten: 07/07/2017

> dpkg: unrecoverable fatal error, aborting:
> files list file for package 'libalkimia4' is missing final newline
> E: Sub-process /usr/bin/dpkg returned an error code (2)

Okay, it seems like apt isn't going to let us do anything while that
corrupted file is in there. Do

$ sudo rm /var/lib/dpkg/info/libalkimia4.list

and then try those commands again and see if one works.

fizz
Offline
Beigetreten: 01/11/2020

Removed libalkimia4

Ran commands, now says the following:

dpkg: warning: files list file for package 'libalkimia4' missing; assuming package has no files currently installed
dpkg: unrecoverable fatal error, aborting:
files list file for package 'libgwenhywfar60' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)

chaosmonk

I am a member!

I am a translator!

Offline
Beigetreten: 07/07/2017

> dpkg: warning: files list file for package 'libalkimia4' missing;
> assuming package has no files currently installed

This is okay. We'll just reinstall the package once apt is working
again.

> dpkg: unrecoverable fatal error, aborting:
> files list file for package 'libgwenhywfar60' is missing final newline
> E: Sub-process /usr/bin/dpkg returned an error code (2)

Hm. I was hoping that only libalkimia4.list was corrupted. I hope that
many packages aren't corrupted, as that could mean there is a larger
issue.

$ sudo rm /var/lib/dpkg/info/libgwenhywfar60.list

Hopefully it will work after that. If it starts complaining about a
third package then we'll take it from there.

Do you recall doing anything package-management-related before this
issue emerged?

fizz
Offline
Beigetreten: 01/11/2020

It's complainging about a third package

dpkg: unrecoverable fatal error, aborting:
files list file for package 'libkabc4' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)

Removed libkabc4 ran commands which now says libofx6:amd64 is missing final newline

System was fine until a few days ago when the error showed up. Simply tried to upgrade the system. then noticed I could not install or remove anything.

I may just need to reinstall Trisquel, fortunately I have backups.

Thank you for your help!

chaosmonk

I am a member!

I am a translator!

Offline
Beigetreten: 07/07/2017

> Removed libkabc4 ran commands which now says libofx6:amd64 is missing final newline

I have found some threads online where people experienced this issue. In some cases there was only one corrupted package and removing [thepackage].list was enough. In other cases many packages were corrupted, like your situation, and the issue was fixed by fixing or removing all of them, often by automating with a script. Here[1] is such a case. Unfortunately, I have not found any cases where it was discovered why/how this happened.

In [1], the files were otherwise valid, and just for some reason missing a final newline character. In at least one other case I found, the file(s) were binary garbage. Try opening `/var/lib/dpkg/info/libofx6` and see what it looks like. If it is a list of filepaths then it is possible that the script in [1] and reinstalling the packages whose *list files you've already removed will fix the issue.

> I may just need to reinstall Trisquel, fortunately I have backups.

It is good that to know that this is at least an option. I don't really understand what the problem is or how these files have become invalid, so I wouldn't be comfortable recommending the script if reinstalling weren't an option as a backup plan. See what `/var/lib/dpkg/info/libofx6` looks like before deciding what to do.

[1] https://stackoverflow.com/questions/39664885/dpkgunrecoverable-fatal-error-files-list-file-for-package-java-common-is-mis

fizz
Offline
Beigetreten: 01/11/2020

Thank you for the link.

Contents of libofx6.amd64.list file shows this:

^@^@^@^@^@^WL|ٴ���*~^�*~^�*~^^@^@^@^@

@^@^@^@^@^@^@^@^@^@^@^@^@^@^@]��

looks corrupt.

Ran the script in the link...

Next,

$ sudo apt update: successful

$ sudo apt upgrade: error

dpkg: warning: files list file for package 'libalkimia4' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgwenhywfar60' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libkabc4' missing; assuming package has no files currently installed
dpkg: unrecoverable fatal error, aborting:
files list file for package 'libofx6:amd64' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)

chaosmonk

I am a member!

I am a translator!

Offline
Beigetreten: 07/07/2017

> Contents of libofx6.amd64.list file shows this:
> ^@^@^@^@^@^WL|ٴ���*~^�*~^�*~^^@^@^@^@
> @^@^@^@^@^@^@^@^@^@^@^@^@^@^@]��

I see. The script I linked to is intended for otherwise valid files which are just missing a newline character. All it does is check for files missing a newline and adding one if it's not there, so it won't help in your situation.

I wonder if *any* or your *.list files are valid. Take a look at `python3.list` and see whether it looks okay. Also run

$ cat /var/lib/dpkg/info/*.list

Is it all junk, or do you see some actual file paths in there? If most files are valid and it's just some that are corrupted, you might be able to keep removing .list files until they are all gone, and then reinstall all of those packages after. If all or most of the .list files are corrupted, and you already have your data backed up, then reinstalling might be easier.

fizz
Offline
Beigetreten: 01/11/2020

Got it.

Contents of python3.list:

/.
/usr
/usr/share
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/python3
/usr/share/doc
/usr/share/doc/python3
/usr/share/doc/python3/copyright
/usr/share/man
/usr/share/man/man1
/usr/share/pixmaps
/usr/share/python3
/usr/share/python3/python.mk
/usr/share/python3/runtime.d
/usr/share/python3/runtime.d/public_modules.rtremove
/usr/share/python3/runtime.d/public_modules.rtinstall
/usr/lib
/usr/lib/valgrind
/usr/lib/valgrind/python3.supp
/usr/bin
/usr/share/doc/python3/README.Debian
/usr/share/doc/python3/changelog.Debian.gz
/usr/share/man/man1/pygettext3.1.gz
/usr/share/man/man1/pdb3.1.gz
/usr/share/man/man1/pydoc3.1.gz
/usr/share/pixmaps/python3.xpm
/usr/bin/pygettext3
/usr/bin/pydoc3
/usr/bin/pdb3

$ cat /var/lib/dpkg/info/*.list returned a huge amount of text too large to paste here.

At this point I'm better off starting from scratch.

I do appreciate your time in helping me through my issue.

chaosmonk

I am a member!

I am a translator!

Offline
Beigetreten: 07/07/2017

> Contents of python3.list:
>
> /.
> /usr
> /usr/share
> /usr/share/lintian
> /usr/share/lintian/overrides
> /usr/share/lintian/overrides/python3
> /usr/share/doc
> /usr/share/doc/python3
> /usr/share/doc/python3/copyright
> /usr/share/man
> /usr/share/man/man1
> /usr/share/pixmaps
> /usr/share/python3
> /usr/share/python3/python.mk
> /usr/share/python3/runtime.d
> /usr/share/python3/runtime.d/public_modules.rtremove
> /usr/share/python3/runtime.d/public_modules.rtinstall
> /usr/lib
> /usr/lib/valgrind
> /usr/lib/valgrind/python3.supp
> /usr/bin
> /usr/share/doc/python3/README.Debian
> /usr/share/doc/python3/changelog.Debian.gz
> /usr/share/man/man1/pygettext3.1.gz
> /usr/share/man/man1/pdb3.1.gz
> /usr/share/man/man1/pydoc3.1.gz
> /usr/share/pixmaps/python3.xpm
> /usr/bin/pygettext3
> /usr/bin/pydoc3
> /usr/bin/pdb3

Okay, that looks normal at least.

> $ cat /var/lib/dpkg/info/*.list returned a huge amount
> of text too large to paste here.

That command prints all of your *.list files. I wasn't expecting you to
paste them all here, just to see at first glance whether it was mostly
filepaths like the output of python3.list, or mostly gibberish like the
files that apt has been complaining about.

> At this point I'm better off starting from scratch.

If you're planning to reinstall Trisquel next anyway, then you don't
have anything to lose. If the output of the "cat" command was mostly
gibberish then just reinstall now, but if it was mostly intelligible
filepaths, then maybe not that many files are corrupted, in which case
you could try to keep deleting the bad .list files until apt doesn't
have any more of them to complain about. At that point, apt will just
complain about missing the .list files you removed, but should be
functional again, at which point you can reinstall the packages whose
.list files you deleted. Or just reinstall Trisquel. Whichever is
less of an inconvenience to you. Sorry we couldn't come up with a
cleaner solution.

fizz
Offline
Beigetreten: 01/11/2020

All good... Trisquel 8 running as it should

Should I ever have this issue again (hopefully not), I have your info to refer to and I'm sure this thread will help someone else with the same issue.