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


9

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

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)

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


现在我尝试了:apt-get -f install dpkg --configure -a apt-get update apt-get clean apt-get autoclean apt-get autoremove apt-get check apt-get -m update apt-get dist-upgrade
赫尔德2015年

Answers:


12

我已经解决了以下问题:

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

重新引导系统,并应安装新内核。此外,这种讨论对我有所帮助。


4

如果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


@HelderJúnior我很高兴这个解决方案为您工作。我们在这里说谢谢的方式是接受/支持对我们最有帮助的答案。我记得在巡回演唱中提到过这一点!
年长者极客

感谢您提供此答案,这是比清除并重新安装lvm2更好的解决方案!unmask在我的特殊情况下,我还必须做其他一些事情,但是一旦我有了主意,那只是迭代。
Doktor J

0

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

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
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.