每次安装或删除软件包时,都会出现LVM2错误

我需要帮助来处理这个错误。 我运行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:~$ 

以上是我在安装/删除软件包时看到的内容。 我对linux很新。 我无法弄清楚如何解决这个问题。 重新安装LVM2软件包没有帮助,也没有dpkg --configure -adpkg --configure lvm2 。 但是,我可以很好地安装和删除软件包,似乎包括lvm2本身。

我也尝试过:

 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. 

然后我尝试了这里链接的修复,但也没有用。 在检查了lvmetad联机帮助页后,我做了:

 anon@computer:~$ sudo pvscan --cache [sudo] password for anon: WARNING: Failed to connect to lvmetad. Falling back to device scanning. anon@computer:~$ 

最后我也试过骑自行车的动力,更新和升级一切等等。请不要提出想法。

更新:我尝试直接取消屏蔽套接字。 起初它似乎工作,因为当我启用然后启动lvm2-lvmetad服务它没有说失败。 我尝试升级包,同样的错误仍然存​​在。

 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:~$ 

在程序包管理期间仍然出现错误。

编辑:修复。 请参阅我的评论以获取详细信息这是一个损坏的lvm2依赖项。

升级到18.10测试版后我遇到了完全相同的问题。

什么对我有用:

rm -rf / etc / lvm apt purge lvm2 apt install lvm2