dpkg: error: failed to open package info file `/var/lib/dpkg/available’ for reading : No such file or directory

I am very new in linux os NS get the following error message after installing snapd and libdvd-pkg-

sudo apt install snapd
get error message

dpkg: error: failed to open package info file `/var/lib/dpkg/available’ for reading: No such file or directory
libdvd-pkg: Package libdvdcss2-1.4.2-1 was removed, stop processing…
E: Sub-process /usr/bin/dpkg returned an error code (2)

When executing command
sudo apt-get install libdvd-pkg

get error message

dpkg: error: failed to open package info file `/var/lib/dpkg/available’ for reading: No such file or directory
libdvd-pkg: Package libdvdcss2-1.4.2-1 was removed, stop processing…
E: Sub-process /usr/bin/dpkg returned an error code (2)

lastly tried command

sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
get error
cp: cannot stat ‘/var/lib/dpkg/available-old’: No such file or directory

again used commands

sudo rm -rf /var/lib/dpkg/available
sudo touch /var/lib/dpkg/available

and proceed with package installation:

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

tried to install
sudo apt-get install libdvd-pkg

again get a lot of dpkg: warnings and message

dpkg: warning: files list file for package 'libapt-inst2.0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libtext-charwidth-perl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgcrypt20:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libnginx-mod-stream' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libwebp6:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'ca-certificates' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libstdc++6:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libsmartcols1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'fdisk' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'util-linux' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgmp10:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libmnl0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libidn2-0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'apt-utils' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libnginx-mod-http-xslt-filter' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libc6:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'nginx-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libaudit-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libselinux1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libx11-data' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libnettle6:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libp11-kit0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'fontconfig-config' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'multiarch-support' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libtinfo5:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libbz2-1.0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'update-motd' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libext2fs2:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libcap-ng0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'ubuntu-keyring' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'liblocale-gettext-perl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libncursesw5:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpcre3:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'dpkg' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libdb5.3:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libaudit1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'liblzma5:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'e2fsprogs' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libx11-6:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libnginx-mod-http-image-filter' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libseccomp2:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libbsd0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpam-modules-bin' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libsemanage-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libss2:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libblkid1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libjpeg8:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'geoip-database' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libacl1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'nginx' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgcc1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libxcb1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'adduser' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'zlib1g:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libmount1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'tar' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libxpm4:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libhogweed4:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libsemanage1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libfontconfig1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libudev1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpam-modules:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libsepol1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libnginx-mod-http-geoip' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'nginx-core' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libunistring2:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gcc-8-base:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libxslt1.1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'apt' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'perl-base' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'openssl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libnginx-mod-mail' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'sensible-utils' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libcom-err2:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'ucf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libapt-pkg5.0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgpg-error0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpam0g:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgeoip1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'lsb-base' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libtasn1-6:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libuuid1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libsystemd0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libffi6:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gpgv' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libxml2:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libfreetype6:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'coreutils' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libxdmcp6:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'iproute2' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libssl1.1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libelf1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'debconf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libtext-wrapi18n-perl' missing; assuming package has no files currently installed
(Reading database ... 0 files and directories currently installed.)
Preparing to unpack .../bsdutils_1%3a2.31.1-0.4ubuntu3.7_amd64.deb ...
Unpacking bsdutils (1:2.31.1-0.4ubuntu3.7) ...
Setting up bsdutils (1:2.31.1-0.4ubuntu3.7) ...
Selecting previously unselected package debianutils.
dpkg: warning: files list file for package 'libxau6:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libapt-inst2.0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libtext-charwidth-perl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgcrypt20:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libnginx-mod-stream' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libwebp6:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'ca-certificates' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libstdc++6:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libsmartcols1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'fdisk' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'util-linux' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgmp10:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libmnl0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libidn2-0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'apt-utils' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libnginx-mod-http-xslt-filter' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libc6:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'nginx-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libaudit-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libselinux1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libx11-data' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libnettle6:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libp11-kit0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'fontconfig-config' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'multiarch-support' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libtinfo5:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libbz2-1.0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'update-motd' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libext2fs2:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libcap-ng0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'ubuntu-keyring' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'liblocale-gettext-perl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libncursesw5:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpcre3:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'dpkg' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libdb5.3:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libaudit1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'liblzma5:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'e2fsprogs' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libx11-6:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libnginx-mod-http-image-filter' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libseccomp2:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'iproute2' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libssl1.1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libelf1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'debconf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libtext-wrapi18n-perl' missing; assuming package has no files currently installed
(Reading database ... 30 files and directories currently installed.)
Preparing to unpack .../debianutils_4.8.4_amd64.deb ...
Unpacking debianutils (4.8.4) ...
Setting up debianutils (4.8.4) ...
Selecting previously unselected package libcc1-0:amd64.
dpkg: warning: files list file for package 'libxau6:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libapt-inst2.0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libxml2:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libfreetype6:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'coreutils' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libxdmcp6:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'iproute2' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libssl1.1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libelf1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'debconf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libtext-wrapi18n-perl' missing; assuming package has no files currently installed
Errors were encountered while processing:
 /tmp/apt-dpkg-install-YsVxqO/016-libglib2.0-0_2.56.4-0ubuntu0.18.04.6_amd64.deb
 /tmp/apt-dpkg-install-YsVxqO/008-perl_5.26.1-6ubuntu0.5_amd64.deb
libdvd-pkg: Package libdvdcss2-1.4.2-1 was removed, stop processing...
E: Sub-process /usr/bin/dpkg returned an error code (1)```

apt – dpkg: error: you must specify packages by their own names, not by quoting the names of the files they come in

I’m in need of some help again :-]

I wanted to get my fingerprint sensor working on my HP 470 ProBook. Went through part of the tutorial here: https://balintbanyasz.wordpress.com/2015/03/27/get-validity-vfs-495-fingerprint-reader-working-in-ubuntu-14-04/

I bailed out after converting the RPM to DEB and trying to install it but getting a bunch of warnings. It’s not worth the hassle to get my system mangled. It’s working fine. Apart from that sensor. Well…. was working fine 😀

Running apt remove doesn’t uninstall the package.

sudo dpkg –remove –force-all validity-sensor-setup_4.5-119_amd64.deb

Gives me the error below:

dpkg: error: you must specify packages by their own names, not by quoting the names of the files they come in

What do I do now?

Thanks for you advice!

dpkg – Unable to reinstall ubuntu-advantage-tools

hiren@my-dell:~$ sudo apt-get install –reinstall ubuntu-advantage-tools
Reading package lists… Done
Building dependency tree
Reading state information… Done
0 to upgrade, 0 to newly install, 1 reinstalled, 0 to remove and 1 not to upgrade.
Need to get 47.3 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://mirror.fsf.org/trisquel belenos-updates/main amd64 ubuntu-advantage-tools amd64 19.6~ubuntu14.04.4 (47.3 kB)
Fetched 47.3 kB in 7s (6,293 B/s)
dpkg: warning: files list file for package ‘ubuntu-advantage-tools’ missing; assuming package has no files currently installed
(Reading database … 238711 files and directories currently installed.)
Preparing to unpack …/ubuntu-advantage-tools_19.6~ubuntu14.04.4_amd64.deb …
Unpacking ubuntu-advantage-tools (19.6~ubuntu14.04.4) over (19.6~ubuntu14.04.4) …
Processing triggers for man-db (2.7.5-1) …
Setting up ubuntu-advantage-tools (19.6~ubuntu14.04.4) …
/var/lib/dpkg/info/ubuntu-advantage-tools.postinst: 5: .: Can’t open /etc/os-release
dpkg: error processing package ubuntu-advantage-tools (–configure):
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
ubuntu-advantage-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

apt – dpkg -i error: unable to open … no such file or directory

I try to install libssl 0.9.8 on lubuntu 20.04.1.

I have found no way to install it using apt, so that I downloaded a .deb package from the ubuntu Trusty (14.04) launchpad archive.

I try to install it this way:

kids@Dani:~/Downloads$ sudo dpkg -i libssl0.9.8_0.9.8o-7ubuntu3.2.14.04.1_amd64.deb

It gives me the following error:

(Reading database ... 268220 files and directories currently installed.)
Preparing to unpack libssl0.9.8_0.9.8o-7ubuntu3.2.14.04.1_amd64.deb ...
Unpacking libssl0.9.8:amd64 (0.9.8o-7ubuntu3.2.14.04.1) ...
dpkg: error processing archive libssl0.9.8_0.9.8o-7ubuntu3.2.14.04.1_amd64.deb (--install):
 unable to open '/lib/x86_64-linux-gnu/libcrypto.so.0.9.8.dpkg-new': No such file or directory
Errors were encountered while processing:
 libssl0.9.8_0.9.8o-7ubuntu3.2.14.04.1_amd64.deb

I’ve tried to make such file make such directory and remove it, but nothing changed.
Do you know a way to install it using apt?
Any other way to fix it?

I am using the correct architecture (64-bit on 64-bit VM, using VMware workstation player on 64-bit windows 10).

upgrade – Sub-process dpkg –set-selections returned an error code (100) when upgrading from Ubuntu 18.04 to 20.04

as stated in the title, I’m having problems upgrading from 18.04 to 20.04.

After performing sudo do-release-upgrade I get

Fetching Fetched 0 B in 0s (0 B/s)                                    


Upgrading Fetched 0 B in 0s (0 B/s)                                    Exception during pm.DoInstall():  E:Sub-process dpkg --set-selections returned an error code (100), E:Couldn't record the approved state changes as dpkg selection states

Could not install the upgrades 

The upgrade has aborted. Your system could be in an unusable state. A  recovery will run now (dpkg --configure -a). 


Upgrade infeasible 

The upgrade could not be completed, there were errors during the  upgrade process. 


Restoring original system state

Aborting Reading package lists... Done     Building dependency tree    Reading state information... Done

I have tried a number of solutions I found on the internet such as reinstalling different versions of dpkg, but most of the solutions seem to pertain to error code 1, not 100.

Any help would be greatly appreciated.
Tom

apt – E: Sub-process /usr/bin/dpkg returned an error code (1) DPKG ERROR

I’m having this error when doing $ sudo apt upgrade :

Error 24 : Write error : cannot write compressed block

E: mkinitramfs failure cpio 141 lz4 -9 -l 24

update-initramfs: failed for /boot/initrd.img-5.4.0-7634-generic with 1.

dpkg: error processing package linux-firmware (–configure):

installed linux-firmware package post-installation script subprocess returned error exit status 1

Errors were encountered while processing:

linux-firmware

E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried the following:

$ sudo apt-get clean

$ sudo apt-get upgrade

$ sudo apt-get install -f

$ sudo apt-get dist-upgrade

I also tried $ flatpak update

What could be the solution?

apt – dpkg error processing linux-image after upgrade from 16.04 to 18.04

I just upgraded to Ubuntu MATE 18.04 from 16.04. There were some hurdles that I would later describe below, but right now, the upgrade is “complete” except for the following set of errors while dpkg is setting up packages, resulting in failure when trying to update anything.

Bus error (core dumped)
dpkg: error processing package linux-image-4.15.0-112-generic (--configure):
 installed linux-image-4.15.0-112-generic package post-installation script subprocess returned error exit status 135
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-4.15.0-112-generic; however:
  Package linux-image-4.15.0-112-generic is not configured yet.

dpkg: error processing package linux-image-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-modules-extra-4.15.0-112-generic:
 linux-modules-extra-4.15.0-112-generic depends on linux-image-4.15.0-112-generic | linux-image-unsigned-4.15.0-112-generic; however:
  Package linux-image-4.15.0-112-generic is not configured yet.
  Package linux-image-unsigned-4.15.0-112-generic is not installed.

dpkg: error processing package linux-modules-extra-4.15.0-112-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 4.15.0.112.100); however:
  Package linux-image-generic is not configured yet.

dpkg: error processing package linux-generic (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-4.15.0-112-generic
 linux-image-generic
 linux-modules-extra-4.15.0-112-generic
 linux-generic

I have tried apt-get install -f, apt-get clean, apt-get autoremove, and dpkg –configure -a but it’s still broken. I haven’t tried purging and reinstalling those packages manually in case of a broken download, because these packages look very important.

As for the chronology:

  1. I first ran do-release-upgrade at work, but I stopped the download quite early on because the Internet wasn’t stable.
  2. I noticed my Apache is not working properly, so I tried do-release-upgrade again. I got a warning saying I should upgrade to the latest patch, and I found that it’s “up to date” with around 1500 packages “kept back”
  3. After a bit of browsing, I ran apt-get install -f. It downloaded around 650mb of packages, and after I restarted, the OS ran but with a broken GUI that looks like Windows 98.
  4. I ran apt-get dist-upgrade and it downloaded around 1.5gb of packages. After it finished, I rebooted and the OS is working “fine” except the errors above. Though Apache is still not working properly.

I’m sorry if I broke any rule. This is my first post. I’d be really grateful for any help from this community. Right now I’m making a backup of important files in case I end up having to reinstall my Linux, but I really hope I can keep going with this one. Thank you for reading.

dpkg – unable to unistall macfanctld

macfanctld is causing trouble with over installations, i don’t really use it so i tried to purge it.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  macfanctld*
0 to upgrade, 0 to newly install, 1 to remove and 0 not to upgrade.
1 not fully installed or removed.
After this operation, 49.2 kB disk space will be freed.
Do you want to continue? (Y/n) y
(Reading database ... 220296 files and directories currently installed.)
Removing macfanctld (0.6+repack1-2) ...
Failed to stop macfanctld.service: Unit macfanctld.service not loaded.
invoke-rc.d: initscript macfanctld, action "stop" failed.
dpkg: error processing package macfanctld (--remove):
 installed macfanctld package pre-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Failed to start macfanctld.service: Unit macfanctld.service not found.
invoke-rc.d: initscript macfanctld, action "start" failed.
Unit macfanctld.service could not be found.
dpkg: error while cleaning up:
 installed macfanctld package post-installation script subprocess returned error
 exit status 1
Errors were encountered while processing:
 macfanctld
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

apt – How to resolve dpkg error in 20.04?

running apt-get update + apt-get upgrade on a 20.04 system

getting this output:
Removing linux-image-5.4.0-39-generic (5.4.0-39.43) …
Failed to create symlink to vmlinuz-5.4.0-40-generic: Operation not permitted at /usr/bin/linux-update-symlinks line 64.
dpkg: error processing package linux-image-5.4.0-39-generic (–remove):
installed linux-image-5.4.0-39-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
linux-image-5.4.0-39-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

dpkg --list | grep -v ii
rH linux-image-5.4.0-39-generic 5.4.0-39.43
iF linux-image-5.4.0-40-generic 5.4.0-40.44
iF linux-image-5.4.0-42-generic 5.4.0-42.46
iU linux-image-generic 5.4.0.42.46
rc linux-modules-extra-5.4.0-37-generic 5.4.0-37.41
rc linux-modules-extra-5.4.0-39-generic 5.4.0-39.43
iU linux-modules-extra-5.4.0-40-generic 5.4.0-40.44
iU linux-modules-extra-5.4.0-42-generic 5.4.0-42.46

uname -r
5.4.0-37-generic

so we try to remove a more recent version than the one that is loaded on the system when the error occurs

I have tried to apply several solutions including “The following packages have been kept back:” Why and how do I solve it? (applying both cautious and aggressive solutions )

Unfortunately, I end up with the error report above, no matter what I try (including aggessive/dist-upgrade variation), so I am becoming rather deserate for a solution or perhaps just a hint as to next step to apply. Any suggestions, please?

dpkg – Error During Upgrading (libpam-systemd:amd64)

I was upgrading my system through terminal using the usual sudo apt update and sudo apt upgrade commands. After downloading all the update files and processing, a single error comes (it has been same since last 2 updates)

debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package libpam-systemd:amd64 (--configure):
 installed libpam-systemd:amd64 package post-installation script subprocess returned error exit status 1
Setting up ubuntu-drivers-common (1:0.8.4~0.20.04.2) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Errors were encountered while processing:
 libpam-systemd:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

Please tell me what should I do?