「firefox-locale-en」というファイルに改行がないため、アップデートをダウンロードまたはインストールできません

「firefox-locale-en」というファイルに改行がないため、アップデートをダウンロードまたはインストールできません

更新プログラムをインストールしようとすると、次のようなエラー メッセージが表示されます。

ソフトウェア アップデーターのスクリーンショット

最後のメッセージは次のとおりです。

dpkg: unrecoverable fatal error: aborting:
 files list file for package 'firefox-locale-en' is missing final newline

ある日、PCを使っていたとき、Firefoxが突然消えてしまいました。探してみると、削除されていたことがわかりました。Ubuntuソフトウェアから再度ダウンロードして、元に戻しました。しかし、アプリケーションを表示firefox という名前のアプリケーションが 2 つあることに気付きました。1 つにはアイコンがあり、もう 1 つにはアイコンがありません。私はこれを無視しましたが、それ以来、ターミナル経由でソフトウェアをインストールしようとしたり、更新しようとしたりすると、メッセージが表示されますthe file for package firefox-locale-en is missing final new line

$ sudo apt-cache policy firefox-locale-en
[sudo] password for devananda: 
firefox-locale-en:
  Installed: 68.0+build3-0ubuntu0.18.04.1
  Candidate: 70.0.1+build1-0ubuntu0.18.04.1
  Version table:
     70.0.1+build1-0ubuntu0.18.04.1 500
        500 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
 *** 68.0+build3-0ubuntu0.18.04.1 100
        100 /var/lib/dpkg/status
     59.0.2+build1-0ubuntu1 500
        500 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
$ sudo apt-get update
Hit:1 http://in.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease             
Hit:3 http://in.archive.ubuntu.com/ubuntu bionic-backports InRelease           
Hit:4 http://in.archive.ubuntu.com/ubuntu bionic-proposed InRelease            
Hit:5 http://archive.canonical.com/ubuntu bionic InRelease                     
Get:6 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]    
Hit:7 http://archive.ubuntu.com/ubuntu bionic InRelease                        
Hit:8 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu bionic InRelease    
Hit:9 http://ppa.launchpad.net/libretro/stable/ubuntu bionic InRelease         
Hit:10 http://ppa.launchpad.net/ppsspp/stable/ubuntu bionic InRelease          
Fetched 88.7 kB in 13s (6,765 B/s)                                             
Reading package lists... Done
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  linux-generic-hwe-18.04 linux-headers-generic-hwe-18.04
  linux-image-generic-hwe-18.04
The following packages will be upgraded:
  amd64-microcode apport apport-gtk apt apt-utils aspell base-files bind9-host
  bluez bluez-cups bluez-obexd bsdutils cpio cups cups-bsd cups-client
  cups-common cups-core-drivers cups-daemon cups-ipp-utils cups-ppdc
  cups-server-common distro-info-data dkms dnsutils dpkg dpkg-dev e2fsprogs
  fdisk file file-roller firefox firefox-locale-en flatpak fonts-opensymbol
  gdb gdbserver ghostscript ghostscript-x gir1.2-gst-plugins-base-1.0
  gir1.2-gstreamer-1.0 gir1.2-gtk-3.0 gir1.2-ibus-1.0
  gir1.2-javascriptcoregtk-4.0 gir1.2-mutter-2 gir1.2-nma-1.0 gir1.2-snapd-1
  gir1.2-soup-2.4 gir1.2-webkit2-4.0 gnome-control-center
  gnome-control-center-data gnome-control-center-faces gnome-initial-setup
  gnome-shell gnome-shell-common gnome-software gnome-software-common
  gnome-software-plugin-snap grep gstreamer1.0-alsa gstreamer1.0-gl
  gstreamer1.0-gtk3 gstreamer1.0-plugins-base gstreamer1.0-plugins-base:i386
  gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-good
  gstreamer1.0-pulseaudio gstreamer1.0-tools gstreamer1.0-x
  gtk-update-icon-cache ibus ibus-gtk ibus-gtk3 initramfs-tools
  initramfs-tools-bin initramfs-tools-core iputils-arping libapt-inst2.0
  libapt-pkg5.0 libarchive13 libaspell15 libbind9-160 libblkid1 libblkid1:i386
  libbluetooth3 libcom-err2 libcom-err2:i386 libcups2 libcups2:i386
  libcupscgi1 libcupsimage2 libcupsmime1 libcupsppdc1 libcurl3-gnutls
  libdns-export1100 libdns1100 libdpkg-perl libegl-mesa0 libegl1-mesa
  libexiv2-14 libexpat1 libexpat1:i386 libexpat1-dev libext2fs2 libfdisk1
  libgbm1 libgif7 libgl1-mesa-dri libgl1-mesa-dri:i386 libgl1-mesa-glx
  libgl1-mesa-glx:i386 libglapi-mesa libglapi-mesa:i386 libglx-mesa0
  libglx-mesa0:i386 libgpgme11 libgpgmepp6 libgs9 libgs9-common
  libgstreamer-gl1.0-0 libgstreamer-plugins-base1.0-0
  libgstreamer-plugins-base1.0-0:i386 libgstreamer-plugins-good1.0-0
  libgstreamer1.0-0 libgstreamer1.0-0:i386 libgtk-3-bin libibus-1.0-5
  libidn2-0 libidn2-0:i386 libinput-bin libinput10 libirs160 libisc-export169
  libisc169 libisccc160 libisccfg160 libjavascriptcoregtk-4.0-18 libldap-2.4-2
  libldap-2.4-2:i386 libldap-common liblwres160 libmagic-mgc libmagic1
  libmount1 libmount1:i386 libmutter-2-0 libnet-ssleay-perl libnm-glib4
  libnm-gtk0 libnm-util2 libnma0 libnss-myhostname libnss-systemd libnss3
  libopenexr22 libopenjp2-7 libosmesa6 libosmesa6:i386 libpam-systemd
  libpoppler-glib8 libpoppler73 libprocps6 libpulse-mainloop-glib0 libpulse0
  libpulse0:i386 libpulsedsp libpython2.7 libpython2.7-dev
  libpython2.7-minimal libpython2.7-stdlib libpython3.6 libpython3.6-minimal
  libpython3.6-stdlib libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5
  libqt5opengl5 libqt5printsupport5 libqt5sql5 libqt5sql5-sqlite libqt5test5
  libqt5widgets5 libqt5xml5 libreoffice-avmedia-backend-gstreamer
  libreoffice-base-core libreoffice-calc libreoffice-common libreoffice-core
  libreoffice-draw libreoffice-gnome libreoffice-gtk3 libreoffice-help-en-us
  libreoffice-impress libreoffice-math libreoffice-ogltrans
  libreoffice-pdfimport libreoffice-style-breeze libreoffice-style-galaxy
  libreoffice-style-tango libreoffice-writer libsane-common libsane1
  libsane1:i386 libsdl1.2debian libsdl2-2.0-0 libsdl2-2.0-0:i386 libsgutils2-2
  libsmartcols1 libsmbclient libsnapd-glib1 libsnmp-base libsnmp30
  libsoup-gnome2.4-1 libsoup-gnome2.4-1:i386 libsoup2.4-1 libsoup2.4-1:i386
  libss2 libsystemd0 libsystemd0:i386 libtiff5 libtiff5:i386 libudev1
  libudev1:i386 libuuid1 libuuid1:i386 libwavpack1 libwayland-egl1-mesa
  libwbclient0 libwebkit2gtk-4.0-37 libwhoopsie0 libxatracker2
  libxkbcommon-x11-0 libxkbcommon0 libxkbcommon0:i386 libxslt1.1
  libxslt1.1:i386 libzstd1 linux-firmware linux-libc-dev login mesa-va-drivers
  mesa-vdpau-drivers mount mutter mutter-common netplan.io
  network-manager-gnome nplan openjdk-11-jre openjdk-11-jre-headless passwd
  poppler-utils procps pulseaudio pulseaudio-module-bluetooth pulseaudio-utils
  python2.7 python2.7-dev python2.7-minimal python3-apport python3-distupgrade
  python3-gdbm python3-problem-report python3-software-properties python3-uno
  python3.6 python3.6-minimal qt5-gtk-platformtheme rfkill rsyslog samba-libs
  sane-utils snapd software-properties-common software-properties-gtk sudo
  syslinux syslinux-common systemd systemd-sysv thermald thunderbird
  thunderbird-gnome-support thunderbird-locale-en thunderbird-locale-en-us
  tzdata ubuntu-desktop ubuntu-drivers-common ubuntu-minimal
  ubuntu-release-upgrader-core ubuntu-release-upgrader-gtk ubuntu-software
  ubuntu-standard udev unattended-upgrades uno-libs3 ure usb-creator-common
  usb-creator-gtk util-linux uuid-runtime whoopsie wpasupplicant xkb-data
305 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
2 not fully installed or removed.
Need to get 0 B/472 MB of archives.
After this operation, 2,194 kB disk space will be freed.
Do you want to continue? [Y/n] Y
Extracting templates from packages: 100%
Preconfiguring packages ...
dpkg: unrecoverable fatal error, aborting:
 files list file for package 'firefox-locale-en' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)
$ sudo dpkg --audit
The following packages are in a mess due to serious problems during
installation.  They must be reinstalled for them (and any packages
that depend on them) to function properly:
 firefox              Safe and easy web browser from Mozilla
 firefox-locale-en    English language pack for Firefox
$ sudo apt-get install --reinstall firefox firefox-locale-en
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  fonts-lyx
The following packages will be upgraded:
  firefox firefox-locale-en
2 upgraded, 0 newly installed, 0 to remove and 306 not upgraded.
2 not fully installed or removed.
Need to get 0 B/50.5 MB of archives.
After this operation, 6,429 kB of additional disk space will be used.
dpkg: unrecoverable fatal error, aborting:
 files list file for package 'firefox-locale-en' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)
pkexec gedit /var/lib/dpkg/status
Unable to init server: Could not connect: Connection refused

(gedit:5380): Gtk-WARNING **: 16:45:14.162: cannot open display: 
$ sudo dpkg --configure -a
dpkg: error processing package firefox-locale-en (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
dpkg: error processing package firefox (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
Errors were encountered while processing:
 firefox-locale-en
 firefox
$ sudo apt-get purge firefox
[sudo] password for devananda: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  firefox-locale-en
The following packages will be REMOVED:
  firefox*
The following packages will be upgraded:
  firefox-locale-en
1 upgraded, 0 newly installed, 1 to remove and 306 not upgraded.
2 not fully installed or removed.
Need to get 0 B/701 kB of archives.
After this operation, 189 MB disk space will be freed.
Do you want to continue? [Y/n] Y
dpkg: error processing package firefox (--remove):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
Errors were encountered while processing:
 firefox
E: Sub-process /usr/bin/dpkg returned an error code (1)
$ sudo apt update
Hit:1 http://archive.canonical.com/ubuntu bionic InRelease
Hit:2 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu bionic InRelease
Hit:3 http://ppa.launchpad.net/libretro/stable/ubuntu bionic InRelease         
Get:4 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]    
Hit:5 http://in.archive.ubuntu.com/ubuntu bionic InRelease                     
Hit:6 http://ppa.launchpad.net/ppsspp/stable/ubuntu bionic InRelease           
Get:7 http://in.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]   
Get:8 http://in.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] 
Hit:9 http://archive.ubuntu.com/ubuntu bionic InRelease                        
Get:10 http://security.ubuntu.com/ubuntu bionic-security/main amd64 DEP-11 Metadata [38.6 kB]
Get:11 http://in.archive.ubuntu.com/ubuntu bionic-proposed InRelease [242 kB]  
Get:12 http://in.archive.ubuntu.com/ubuntu bionic-updates/main Sources [296 kB]
Get:13 http://security.ubuntu.com/ubuntu bionic-security/main DEP-11 48x48 Icons [17.6 kB]
Get:14 http://in.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages [601 kB]
Get:15 http://security.ubuntu.com/ubuntu bionic-security/main DEP-11 64x64 Icons [41.5 kB]
Get:16 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [769 kB]
Get:17 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2,464 B]
Get:18 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 DEP-11 Metadata [42.1 kB]
Get:19 http://security.ubuntu.com/ubuntu bionic-security/universe DEP-11 48x48 Icons [16.4 kB]
Get:20 http://security.ubuntu.com/ubuntu bionic-security/universe DEP-11 64x64 Icons [116 kB]
Get:21 http://in.archive.ubuntu.com/ubuntu bionic-updates/main Translation-en [276 kB]
Get:22 http://in.archive.ubuntu.com/ubuntu bionic-updates/main amd64 DEP-11 Metadata [295 kB]
Get:23 http://in.archive.ubuntu.com/ubuntu bionic-updates/main DEP-11 48x48 Icons [73.8 kB]
Get:24 http://in.archive.ubuntu.com/ubuntu bionic-updates/main DEP-11 64x64 Icons [143 kB]
Get:25 http://in.archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2,464 B]
Get:26 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [264 kB]
Get:27 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 48x48 Icons [197 kB]
Get:28 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 64x64 Icons [450 kB]
Get:29 http://in.archive.ubuntu.com/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [7,972 B]
Get:30 http://in.archive.ubuntu.com/ubuntu bionic-proposed/universe amd64 Packages [25.5 kB]
Get:31 http://in.archive.ubuntu.com/ubuntu bionic-proposed/universe i386 Packages [21.8 kB]
Get:32 http://in.archive.ubuntu.com/ubuntu bionic-proposed/universe Translation-en [14.6 kB]
Get:33 http://in.archive.ubuntu.com/ubuntu bionic-proposed/universe amd64 DEP-11 Metadata [212 B]
Get:34 http://in.archive.ubuntu.com/ubuntu bionic-proposed/main amd64 DEP-11 Metadata [4,612 B]
Get:35 http://in.archive.ubuntu.com/ubuntu bionic-proposed/multiverse amd64 Packages [4,012 B]
Get:36 http://in.archive.ubuntu.com/ubuntu bionic-proposed/multiverse i386 Packages [3,304 B]
Get:37 http://in.archive.ubuntu.com/ubuntu bionic-proposed/multiverse Translation-en [1,776 B]
Get:38 http://in.archive.ubuntu.com/ubuntu bionic-proposed/multiverse amd64 DEP-11 Metadata [2,468 B]
Fetched 4,221 kB in 14s (295 kB/s)                                             
Reading package lists... Done
Building dependency tree       
Reading state information... Done
308 packages can be upgraded. Run 'apt list --upgradable' to see them.

答え1

問題を解決するには、次のコマンドを実行します。

sudo rm /var/lib/dpkg/info/firefox-locale-en.list
sudo apt install --reinstall firefox-locale-en

警告が表示されます:

dpkg: 警告: パッケージ 'firefox-locale-en' のファイルリストファイルがありません。パッケージに現在ファイルがインストールされていないものと想定します

警告を無視して、次のコマンドを実行して更新します。

sudo apt update
sudo apt upgrade

追加のエラーがあれば投稿してください。ありがとうございます。

関連情報