未满足的内核依赖关系或 dpkg-preconfigure 问题?

未满足的内核依赖关系或 dpkg-preconfigure 问题?

尝试删除旧内核以便为更新腾出空间(当前运行 16.04.03 服务器):

sudo apt autoremove

给出这个:

Reading package lists... Done                                                   
Building dependency tree                                                        
Reading state information... Done                                               
You might want to run â??apt-get -f installâ?? to correct these.                
The following packages have unmet dependencies.                                 
 linux-headers-generic : Depends: linux-headers-4.4.0-141-generic but it is not 
installed                                                                       
E: Unmet dependencies. Try using -f.

因此,我运行:

sudo apt -f autoremove

这样做会带来以下好处:

The following additional packages will be installed:
Reading package lists...
Building dependency tree...
Reading state information...
Correcting dependencies... Done
The following additional packages will be installed:
  linux-headers-4.4.0-141 linux-headers-4.4.0-141-generic
The following packages will be REMOVED
  linux-headers-4.4.0-109 linux-headers-4.4.0-112 linux-headers-4.4.0-116
  linux-headers-4.4.0-119 linux-headers-4.4.0-127 linux-headers-4.4.0-128
  linux-headers-4.4.0-130 linux-headers-4.4.0-130-generic
  linux-headers-4.4.0-131 linux-headers-4.4.0-131-generic
  linux-headers-4.4.0-133 linux-headers-4.4.0-133-generic
  linux-headers-4.4.0-134 linux-headers-4.4.0-134-generic
  linux-headers-4.4.0-87 linux-image-4.4.0-130-generic
  linux-image-4.4.0-131-generic linux-image-4.4.0-133-generic
  linux-image-4.4.0-134-generic linux-image-extra-4.4.0-130-generic
  linux-image-extra-4.4.0-131-generic linux-image-extra-4.4.0-133-generic
  linux-image-extra-4.4.0-134-generic
The following NEW packages will be installed
  linux-headers-4.4.0-141 linux-headers-4.4.0-141-generic
0 to upgrade, 2 to newly install, 23 to remove and 1 not to upgrade.
2 not fully installed or removed.
Need to get 0 B/10.8 MB of archives.
After this operation, 1,387 MB disk space will be freed.
Do you want to continue? [Y/n]                                                  
E: Waited for /usr/sbin/dpkg-preconfigure --apt || true but it wasn't there     
E: Failure running script /usr/sbin/dpkg-preconfigure --apt || true

/etc/apt/apt.conf.d/70debconf 看起来像这样:

// Pre-configure all packages with debconf before they are installed.
// If you don't like it, comment it out.
DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";};

我可以跑

/usr/sbin/dpkg-preconfigure --help

应该有足够的可用空间,还是不够?

df -h /boot                                              
Filesystem      Size  Used Avail Use% Mounted on                                
/dev/sda1       472M  106M  342M  24% /boot

我按照 George Udosen 的建议尝试过:

sudo dpkg --configure -a

但这带来了:

dpkg: dependency problems prevent configuration of linux-headers-generic:       
 linux-headers-generic depends on linux-headers-4.4.0-141-generic; however:     
  Package linux-headers-4.4.0-141-generic is not installed.                     

dpkg: error processing package linux-headers-generic (--configure):             
 dependency problems - leaving unconfigured                                     
dpkg: dependency problems prevent configuration of linux-generic:               
 linux-generic depends on linux-headers-generic (= 4.4.0.141.147); however:     
  Package linux-headers-generic is not configured yet.                          

dpkg: error processing package linux-generic (--configure):                     
 dependency problems - leaving unconfigured                                     
Errors were encountered while processing:                                       
 linux-headers-generic                                                          
 linux-generic

只是为了好玩,我尝试了下一个建议的命令:

sudo apt update

这带来了 - 在点击之后:

Reading package lists... Done                                                   
E: Couldn't wait for subprocess - waitpid (10: No child processes) 

实际上,当尝试从其他线程解决时,我多次看到“没有子进程”。

更新:问题解决了。实际上,可能还有几个问题。注意:我通过 Webmin 运行服务器。一些帖子暗示这是 Webmin 的问题,所以在我在这里发帖之前,我尝试直接在服务器上修复该问题,但没能成功。但现在……

我在另一个线程中找到了如何删除产生问题的 Linux 软件包:

sudo dpkg -P linux-generic
sudo dpkg -P linux-image-generic
sudo dpkg -P linux-headers-generic

这可能与 George Udosen(非常感谢!)的建议相结合,消除了依赖性错误,并使得安装最新版本的 Webmin 成为可能。

E: Waited for /usr/sbin/dpkg-preconfigure --apt || true but it wasn't there     
E: Failure running script /usr/sbin/dpkg-preconfigure --apt || true

结果是 Webmin 问题,当直接从服务器运行自动删除时,问题就消失了。

非常感谢您的帮助!服务器将再次在我空置的公寓里无人看管一段时间,因此解决这个问题很重要。我今晚又可以睡个好觉了。

相关内容