设置 git 服务器时发生致命错误

设置 git 服务器时发生致命错误

我想用 apt-get 设置一个 git 服务器。操作如下:

# apt-get install git-core
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  linux-image-4.4.0-53-generic
Use 'apt autoremove' to remove it.
The following packages will be REMOVED:
  linux-image-extra-4.4.0-53-generic linux-image-extra-4.4.0-57-generic
The following NEW packages will be installed:
  git-core
0 upgraded, 1 newly installed, 2 to remove and 37 not upgraded.
8 not fully installed or removed.
Need to get 0 B/1,464 B of archives.
After this operation, 315 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 294882 files and directories currently installed.)
Removing linux-image-extra-4.4.0-53-generic (4.4.0-53.74) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-53-generic /boot/vmlinuz-4.4.0-53-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-53-generic /boot/vmlinuz-4.4.0-53-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-53-generic
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.4.0-53-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-53-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-4.4.0-57-generic (4.4.0-57.78) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-57-generic /boot/vmlinuz-4.4.0-57-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-57-generic /boot/vmlinuz-4.4.0-57-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-57-generic
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.4.0-57-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-57-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-4.4.0-53-generic
 linux-image-extra-4.4.0-57-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

当我手动清除时# apt-get remove linux-image-extra-4.4.0-53-generic linux-image-extra-4.4.0-57-generic -y,结果如下:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  linux-image-extra-4.4.0-53-generic linux-image-extra-4.4.0-57-generic
0 upgraded, 0 newly installed, 2 to remove and 37 not upgraded.
7 not fully installed or removed.
After this operation, 315 MB disk space will be freed.
(Reading database ... 293795 files and directories currently installed.)
Removing linux-image-extra-4.4.0-53-generic (4.4.0-53.74) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-53-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-53-generic /boot/vmlinuz-4.4.0-53-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-53-generic /boot/vmlinuz-4.4.0-53-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-53-generic
WARNING: missing /lib/modules/4.4.0-53-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.4.0-53-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.4.0-53-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-53-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-4.4.0-57-generic (4.4.0-57.78) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-57-generic /boot/vmlinuz-4.4.0-57-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-57-generic /boot/vmlinuz-4.4.0-57-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-57-generic
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.4.0-57-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-57-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-4.4.0-53-generic
 linux-image-extra-4.4.0-57-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

这个问题困扰了我很久了。我该怎么办?非常感谢!

2017 年 2 月 14 日 02:26UTC 更新:我已尝试# apt-get install --reinstall按建议进行选择,但它返回如下错误:

# apt-get install --reinstall linux-image-extra-4.4.0-53-generic linux-image-extra-4.4.0-57-generic && sudo apt-get purge linux-image-extra-4.4.0-53-generic linux-image-extra-4.4.0-57-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  linux-image-4.4.0-53-generic
Suggested packages:
  fdutils linux-doc-4.4.0 | linux-source-4.4.0 linux-tools
  linux-headers-4.4.0-53-generic
The following NEW packages will be installed:
  linux-image-4.4.0-53-generic
0 upgraded, 1 newly installed, 2 reinstalled, 0 to remove and 37 not upgraded.
7 not fully installed or removed.
Need to get 0 B/94.3 MB of archives.
After this operation, 57.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Selecting previously unselected package linux-image-4.4.0-53-generic.
(Reading database ... 293804 files and directories currently installed.)
Preparing to unpack .../linux-image-4.4.0-53-generic_4.4.0-53.74_amd64.deb ...
Done.
Unpacking linux-image-4.4.0-53-generic (4.4.0-53.74) ...
Selecting previously unselected package linux-image-extra-4.4.0-53-generic.
Preparing to unpack .../linux-image-extra-4.4.0-53-generic_4.4.0-53.74_amd64.deb ...
Unpacking linux-image-extra-4.4.0-53-generic (4.4.0-53.74) over (4.4.0-53.74) ...
Selecting previously unselected package linux-image-extra-4.4.0-57-generic.
Preparing to unpack .../linux-image-extra-4.4.0-57-generic_4.4.0-57.78_amd64.deb ...
Unpacking linux-image-extra-4.4.0-57-generic (4.4.0-57.78) over (4.4.0-57.78) ...
Setting up linux-image-extra-4.4.0-62-generic (4.4.0-62.83) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-62-generic /boot/vmlinuz-4.4.0-62-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-62-generic /boot/vmlinuz-4.4.0-62-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-62-generic
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.4.0-62-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-62-generic (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-extra-4.4.0-62-generic; however:
  Package linux-image-extra-4.4.0-62-generic is not configured yet.

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

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

dpkg: error processing package linux-generic-lts-vivid (--configure):
 dependency problems - leaving unconfigured
Setting up linux-image-4.4.0-57-generic (4.4.0-57.78) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                          No apport report written because the error message indicates its a followup error from a previous failure.
                                                    No apport report written because MaxReports is reached already
                                  Running depmod.
update-initramfs: deferring update (hook will be called later)
Not updating initrd symbolic links since we are being updated/reinstalled 
(4.4.0-57.78 was configured last, according to dpkg)
Not updating image symbolic links since we are being updated/reinstalled 
(4.4.0-57.78 was configured last, according to dpkg)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-57-generic /boot/vmlinuz-4.4.0-57-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-57-generic /boot/vmlinuz-4.4.0-57-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-57-generic
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.4.0-57-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.4.0-57-generic.postinst line 1052.
dpkg: error processing package linux-image-4.4.0-57-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
No apport report written because MaxReports is reached already
                                                              Setting up linux-image-4.4.0-53-generic (4.4.0-53.74) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Not updating initrd symbolic links since we are being updated/reinstalled 
(4.4.0-53.74 was configured last, according to dpkg)
Not updating image symbolic links since we are being updated/reinstalled 
(4.4.0-53.74 was configured last, according to dpkg)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-53-generic /boot/vmlinuz-4.4.0-53-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-53-generic /boot/vmlinuz-4.4.0-53-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-53-generic
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.4.0-53-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.4.0-53-generic.postinst line 1052.
dpkg: error processing package linux-image-4.4.0-53-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of linux-image-extra-4.4.0-53-generic:
 linux-image-extra-4.4.0-53-generic depends on linux-image-4.4.0-53-generic; however:
  Package linux-image-4.4.0-53-generic is not configured yet.

dpkg: error processing package linux-image-extra-4.4.0-53-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-extra-4.4.0-57-generic:
 linux-image-extra-4.4.0-57-generic depends on linux-image-4.4.0-57-generic; however:
  Package linux-image-4.4.0-57-generic is not configured yet.

No apport report written because MaxReports is reached already
                                                              No apport report written because MaxReports is reached already
                                            dpkg: error processing package linux-image-extra-4.4.0-57-generic (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-extra-4.4.0-62-generic
 linux-image-generic
 linux-generic
 linux-generic-lts-vivid
 linux-image-4.4.0-57-generic
 linux-image-4.4.0-53-generic
 linux-image-extra-4.4.0-53-generic
 linux-image-extra-4.4.0-57-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

有什么帮助吗?

答案1

您是否手动删除了内核文件?尝试使用以下方法重新安装

sudo apt-get install --reinstall linux-image-extra-4.4.0-53-generic linux-image-extra-4.4.0-57-generic && sudo apt-get purge linux-image-extra-4.4.0-53-generic linux-image-extra-4.4.0-57-generic

这将首先重新安装包(以便所有文件都存在),然后清除包。这是普通的当文件丢失时进行修复。

相关内容