I need help dealing with this error. I run Ubuntu Budgie 18.04LTS.
anon@computer:~$ sudo dpkg --configure -a
Setting up lvm2 (2.02.176-4.1ubuntu3) ...
update-initramfs: deferring update (trigger activated)
Failed to restart lvm2-lvmetad.service: Unit lvm2-lvmetad.socket is masked.
invoke-rc.d: initscript lvm2-lvmetad, action "restart" failed.
● lvm2-lvmetad.service - LVM2 metadata daemon
Loaded: loaded (/lib/systemd/system/lvm2-lvmetad.service; static; vendor preset: enabled)
Active: inactive (dead)
Docs: man:lvmetad(8)
dpkg: error processing package lvm2 (--configure):
installed lvm2 package post-installation script subprocess returned error exit status 1
Processing triggers for initramfs-tools (0.130ubuntu3.1) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-23-generic
Errors were encountered while processing:
lvm2
anon@computer:~$
The above is pretty much what I see while installing/removing packages as well.
I'm fairly new to linux. I can't figure out how to fix this. Reinstalling LVM2 package doesn't help, nor dpkg --configure -a
or dpkg --configure lvm2
.
However, I can install and remove packages just fine, seemingly including lvm2 itself.
I also tried:
anon@computer:~$ sudo service lvm2-lvmetad start
Failed to start lvm2-lvmetad.service: Unit lvm2-lvmetad.socket is masked.
anon@computer:~$ sudo systemctl enable lvm2-lvmetad.socket
Failed to enable unit: Unit file /etc/systemd/system/lvm2-lvmetad.socket is masked.
Then I tried the fix linked here and that didn't work either. After checking the lvmetad manpage I did:
anon@computer:~$ sudo pvscan --cache
[sudo] password for anon:
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
anon@computer:~$
And lastly I've also tried cycling power, updating and upgrading everything etc. I'm out of ideas, please.
Update: I tried the suggested unmasking the socket directly. At first it seemed to work as when I enabled then started the lvm2-lvmetad service it didn't say failed. The I tried upgrading packages and the same error persists.
anon@computer:~$ sudo systemctl unmask lvm2-lvmetad.socket
Removed /etc/systemd/system/lvm2-lvmetad.socket.
anon@computer:~$ sudo systemctl enable lvm2-lvmetad.socket
anon@computer:~$ sudo service lvm2-lvmetad start
anon@computer:~$ sudo pvscan --cache
anon@computer:~$ sudo apt update && sudo apt upgrade
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:4 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:5 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic InRelease
Hit:6 http://ppa.launchpad.net/otto-kesselgulasch/gimp/ubuntu bionic InRelease
Hit:7 http://ppa.launchpad.net/tista/adapta/ubuntu bionic InRelease
Hit:8 http://ppa.launchpad.net/ubuntubudgie/backports/ubuntu bionic InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up lvm2 (2.02.176-4.1ubuntu3) ...
update-initramfs: deferring update (trigger activated)
Failed to restart lvm2-lvmpolld.service: Unit lvm2-lvmpolld.socket is masked.
invoke-rc.d: initscript lvm2-lvmpolld, action "restart" failed.
● lvm2-lvmpolld.service - LVM2 poll daemon
Loaded: loaded (/lib/systemd/system/lvm2-lvmpolld.service; static; vendor preset: enabled)
Active: inactive (dead)
Docs: man:lvmpolld(8)
dpkg: error processing package lvm2 (--configure):
installed lvm2 package post-installation script subprocess returned error exit status 1
Processing triggers for initramfs-tools (0.130ubuntu3.1) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-23-generic
Errors were encountered while processing:
lvm2
E: Sub-process /usr/bin/dpkg returned an error code (1)
anon@computer:~$
Still getting the error during package management.
Edit: fixed. See my comment for details It was a broken lvm2 dependency.
sudo systemctl unmask lvm2-lvmetad.socket
apt autoremove
to get rid of leftover files. Then I reinstalled it with its dependencies. It seems like the issue wasn't in lvm2 but in one or more of the dependencies. Reinstalling all of that fixed it.sudo apt-get purge lvm2
(since using aptitude wanted to uninstall loads of other packages when I told it to purge lvm2, and using "L" to re-install just wasn't working) followed by re-installing lvm2 (I did that part withsudo aptitude
like normal) then rebooting and the new kernel now has lvm support as well as my virtualbox guest daemon running.sudo apt -y purge lvm2 && sudo apt -y autoremove && sudo apt -y install lvm2
did the trick for me. Probably, there was some errors in lvm2/deps packages chains (clean 18.04 install, LVM installed as dependency). Would you possibly post your solution as an answer?