安装或删除任何软件“lvm2-lvmetad.service”时出现问题

安装或删除任何软件“lvm2-lvmetad.service”时出现问题

我正在尝试安装或删除任何软件,但遇到以下错误:

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: active (exited) since Wed 2018-05-16 06:40:37 WAT; 1h 54min ago
     Docs: man:lvmetad(8)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/lvm2-lvmetad.service

May 16 06:40:37 raikone-X555UB systemd[1]: Starting LSB: LVM2 metadata daemon...
May 16 06:40:37 raikone-X555UB systemd[1]: Started LSB: LVM2 metadata daemon.
dpkg: error processing package lvm2 (--configure):
 installed lvm2 package post-installation script subprocess returned error exit status 1
Processing triggers for shared-mime-info (1.9-2) ...
Processing triggers for gnome-menus (3.13.3-11ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for initramfs-tools (0.130ubuntu3) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-20-generic
Errors were encountered while processing:
 lvm2
E: Sub-process /usr/bin/dpkg returned an error code (1)

我尝试按照这里的一些教程进行操作,但对我没有用。

答案1

我已经解决了这个问题:

sudo apt-get purge lvm2
sudo apt autoremove
sudo apt install lvm2

重新启动系统,新的内核应该安装。此外,讨论帮助过我。

答案2

如果systemctl status lvm2-lvmetad返回,Loaded: masked (/dev/null)您应该取消屏蔽并启用它

sudo systemctl unmask  lvm2-lvmetad && sudo systemctl enable lvm2-lvmetad

该命令systemctl status lvm2-lvmetad.socket应返回确认成功的状态。

如果此方法不适合您,您可能更适合使用所述清除/重新安装方法这里我建议你良好的备份尽管。

来源:

https://unix.stackexchange.com/a/307058/67643

答案3

我刚刚遇到了同样的问题。就我而言,我运行了以下命令来解决问题:

sudo /bin/rm -rf /etc/lvm/  
sudo rm -rf /etc/lvm/backup/
sudo apt purge lvm2
sudo updatdb
sudo locate lvm2
sudo rm /var/crash/lvm2.0.crash
sudo rm /etc/systemd/system/lvm2-*
sudo rm /etc/systemd/system/sysinit.target.wants/lvm2-*
sudo apt install lvm2
sudo apt update
sudo apt upgrade

相关内容