1

I came up with this issue since yesterday

I already checked some existing posts from where I did the following:

sudo mv /var/lib/dpkg/info/linux* /tmp/mcrose/
sudo dpkg --configure -a
sudo apt-get update
sudo apt-get upgrade

I got some issues again so I runned

sudo apt-get clean
dpkg --configure -a
sudo apt-get update
sudo apt-get upgrade

and then I got these errors:

mcrose@home:~$ sudo apt upgrade -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  adobe-flash-properties-gtk adobe-flashplugin budgie-welcome chromium-browser chromium-browser-l10n chromium-codecs-ffmpeg-extra
  gnome-software gnome-software-common gnome-software-plugin-snap libssl1.0.0 libxml2 openssl python-libxml2 ubuntu-fan vivaldi-stable
15 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 147 MB of archives.
After this operation, 47,7 MB of additional disk space will be used.
Get:1 http://py.archive.ubuntu.com/ubuntu zesty-updates/universe amd64 chromium-browser-l10n all 63.0.3239.84-0ubuntu0.17.04.1 [2.640 kB]
Get:2 http://repo.vivaldi.com/stable/deb stable/main amd64 vivaldi-stable amd64 1.13.1008.36-1 [49,3 MB]                                
Get:3 http://archive.canonical.com/ubuntu zesty/partner amd64 adobe-flash-properties-gtk amd64 1:20171212.1-0ubuntu0.17.04.1 [143 kB]
Get:4 http://ppa.launchpad.net/ubuntubudgie/backports/ubuntu zesty/main amd64 budgie-welcome all 0.5.8 [5.084 kB]                       
Get:5 http://archive.canonical.com/ubuntu zesty/partner amd64 adobe-flashplugin amd64 1:20171212.1-0ubuntu0.17.04.1 [9.781 kB]          
Get:6 http://py.archive.ubuntu.com/ubuntu zesty-updates/universe amd64 chromium-browser amd64 63.0.3239.84-0ubuntu0.17.04.1 [73,7 MB]   
Get:2 http://repo.vivaldi.com/stable/deb stable/main amd64 vivaldi-stable amd64 1.13.1008.36-1 [49,3 MB]                                
Get:7 http://py.archive.ubuntu.com/ubuntu zesty-updates/universe amd64 chromium-codecs-ffmpeg-extra amd64 63.0.3239.84-0ubuntu0.17.04.1 [1.010 kB]
Get:8 http://py.archive.ubuntu.com/ubuntu zesty-updates/main amd64 libssl1.0.0 amd64 1.0.2g-1ubuntu11.4 [1.080 kB]                      
Get:9 http://py.archive.ubuntu.com/ubuntu zesty-updates/main amd64 libxml2 amd64 2.9.4+dfsg1-2.2ubuntu0.3 [698 kB]                      
Get:10 http://py.archive.ubuntu.com/ubuntu zesty-updates/main amd64 openssl amd64 1.0.2g-1ubuntu11.4 [491 kB]                           
Get:11 http://py.archive.ubuntu.com/ubuntu zesty-updates/main amd64 gnome-software-plugin-snap amd64 3.22.7-0ubuntu3.17.04.8 [27,5 kB]  
Get:12 http://py.archive.ubuntu.com/ubuntu zesty-updates/main amd64 gnome-software amd64 3.22.7-0ubuntu3.17.04.8 [305 kB]               
Get:13 http://py.archive.ubuntu.com/ubuntu zesty-updates/main amd64 gnome-software-common all 3.22.7-0ubuntu3.17.04.8 [2.481 kB]        
Get:14 http://py.archive.ubuntu.com/ubuntu zesty-updates/main amd64 python-libxml2 amd64 2.9.4+dfsg1-2.2ubuntu0.3 [140 kB]              
Get:15 http://py.archive.ubuntu.com/ubuntu zesty-updates/main amd64 ubuntu-fan all 0.12.8~17.04.1 [34,7 kB]                             
Fetched 134 MB in 18min 22s (121 kB/s)                                                                                                  
Preconfiguring packages ...
dpkg: warning: files list file for package 'linux-sound-base' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-image-extra-4.10.0-42-generic' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-tools-4.10.0-40' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-headers-4.10.0-40' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-base' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-libc-dev:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-tools-4.10.0-19' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-tools-4.10.0-19-generic' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-headers-4.10.0-42-generic' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-tools-4.10.0-42' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-image-extra-4.10.0-40-generic' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-image-4.10.0-42-generic' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-tools-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-tools-4.10.0-42-generic' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-generic' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-tools-4.10.0-40-generic' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-image-4.10.0-40-generic' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-headers-4.10.0-42' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-headers-4.10.0-40-generic' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-tools-generic' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-image-generic' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-firmware' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-headers-generic' missing; assuming package has no files currently installed
dpkg: unrecoverable fatal error, aborting:
 files list file for package 'tzdata' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)

I'm using Ubuntu Budgie

mcrose@home:~$ cat /etc/issue
Ubuntu 17.04 \n \l
mcrose@home:~$ uname -a
Linux home 4.10.0-42-generic #46-Ubuntu SMP Mon Dec 4 14:38:01 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
mcrose@home:~$ 
icarus
  • 123
  • 1
  • 4
  • Have you messed up /var/lib/apt/lists/ with /var/lib/dpkg/info/linux? I suggest to bring /var/lib/dpkg/info/linux** back. From your message it is not clear what problem you are solving. Why you move /var/lib/dpkg/info/linux* instead of /var/lib/dpkg/info/tzdata*? Please update your post with the output of tail -n 10 /var/lib/dpkg/info/tzdata.list. – N0rbert Dec 18 '17 at 21:25
  • @N0rbert I saw that moving in a link, may be I just misunderstood what to move, and, since I restarted the system, that folder has gone – icarus Dec 18 '17 at 22:55

1 Answers1

2

This command (re-)moves the package meta-data and is a bad idea:

mv /var/lib/dpkg/info/linux* /tmp/mcrose/

The files in /var/lib/dpkg are part of the internal state of the Debian package manager and supposed to be manipulated exclusively with the dpkg application or library. It generally is a bad idea to touch anything in /var/lib/dpkg directly unless you know really, really well what you're doing.


Since the package meta-data was removed or corrupted you should reinstall these packages:

dpkg-query -Wf '${Status;1} ${Package}:${Architecture}\n' 'linux*' tzdata |
sed -ne 's/^i //p' |
xargs -rd '\n' -- sudo apt-get install -f --reinstall

It's possible that dpkg still complains about a malformed file list of tzdata in which case your can remove it entirely and retry its reinstallation:

sudo rm /var/lib/dpkg/info/tzdata.*list

I suspect that more packages may have been corrupted. You can verify their integrity as described in Is there a Ubuntu sanity check? with the following commands:

sudo apt-get install debsums
sudo debsums_init
sudo debsums --changed --silent

then reinstall mentioned packages manually with

sudo apt-get -f install
David Foerster
  • 36,264
  • 56
  • 94
  • 147
  • He moved these list-files. They are not corrupted. His system is broken and we do not know how. debsums of course may help. With unrecoverable fatal error he may not be able to install debsums I think. – N0rbert Dec 18 '17 at 21:40
  • @N0rbert: The package meta-data is certainly corrupted/removed and a reinstallation of the packages in question will recreate the meta-data and thus fix the issue. – David Foerster Dec 18 '17 at 21:43
  • Did you see sudo mv /var/lib/dpkg/info/linux* /tmp/mcrose/ in OP question? It is self-destruction. But your solution seems to be useful, of course. Let's wait reaction from OP. – N0rbert Dec 18 '17 at 21:44
  • 1
    @N0rbert: Yes, I saw that. That doesn't change anything about my suggested fix. I could clarify that the aforementioned command is a bad idea. – David Foerster Dec 18 '17 at 21:48
  • 1
    hi guys, both answers and comment did clarified what I did wrong I just first remove the tzdata list, then I run dpkg-query -Wf...

    after reinstalling everthing, I run apt-get upgrade and... everything works fine now

    thanks you both

    – icarus Dec 18 '17 at 23:40