Setiap kali saya mencoba melakukan apa saja dengan apt-get, apakah itu menginstal, menghapus, membersihkan, memperbarui, meningkatkan, saya selalu terkena kesalahan yang sama.
ses@ses-VirtualBox:~/Downloads$ sudo apt-get install ssh
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-45 linux-headers-4.4.0-45-generic linux-image-4.4.0-45-generic linux-image-extra-4.4.0-45-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
ncurses-term openssh-server openssh-sftp-server ssh-import-id
Suggested packages:
ssh-askpass rssh molly-guard monkeysphere
The following packages will be REMOVED:
linux-image-extra-4.4.0-38-generic linux-image-extra-4.4.0-42-generic
The following NEW packages will be installed:
ncurses-term openssh-server openssh-sftp-server ssh ssh-import-id
0 upgraded, 5 newly installed, 2 to remove and 0 not upgraded.
10 not fully installed or removed.
Need to get 0 B/643 kB of archives.
After this operation, 320 MB disk space will be freed.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
(Reading database ... 308434 files and directories currently installed.)
Removing linux-image-extra-4.4.0-38-generic (4.4.0-38.57) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-38-generic /boot/vmlinuz-4.4.0-38-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-38-generic /boot/vmlinuz-4.4.0-38-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-38-generic /boot/vmlinuz-4.4.0-38-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-38-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-38-generic /boot/vmlinuz-4.4.0-38-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-38-generic /boot/vmlinuz-4.4.0-38-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-38-generic /boot/vmlinuz-4.4.0-38-generic
run-parts: executing /etc/kernel/postinst.d/vboxadd 4.4.0-38-generic /boot/vmlinuz-4.4.0-38-generic
run-parts: failed to exec /etc/kernel/postinst.d/vboxadd: Exec format error
run-parts: /etc/kernel/postinst.d/vboxadd exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-38-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-4.4.0-42-generic (4.4.0-42.62) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-42-generic /boot/vmlinuz-4.4.0-42-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-42-generic /boot/vmlinuz-4.4.0-42-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-42-generic /boot/vmlinuz-4.4.0-42-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-42-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-42-generic /boot/vmlinuz-4.4.0-42-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-42-generic /boot/vmlinuz-4.4.0-42-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-42-generic /boot/vmlinuz-4.4.0-42-generic
run-parts: executing /etc/kernel/postinst.d/vboxadd 4.4.0-42-generic /boot/vmlinuz-4.4.0-42-generic
run-parts: failed to exec /etc/kernel/postinst.d/vboxadd: Exec format error
run-parts: /etc/kernel/postinst.d/vboxadd exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-42-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
linux-image-extra-4.4.0-38-generic
linux-image-extra-4.4.0-42-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
Saya mencoba mengikuti pertanyaan ini tetapi tidak berhasil: Apt gagal menghapus kernel yang diinstal sebagian dan tidak dapat menginstal paket lain
memeriksa file status dpkg Saya melihat bahwa kedua paket setengah terinstalasi
Package: linux-image-extra-4.4.0-38-generic
Status: deinstall ok half-installed
Priority: optional
Section: kernel
Installed-Size: 158607
Maintainer: Ubuntu Kernel Team <[email protected]>
Architecture: amd64
Source: linux
Version: 4.4.0-38.57
Depends: linux-image-4.4.0-38-generic, crda | wireless-crda
Description: Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
This package contains the Linux kernel extra modules for version 4.4.0 on
64 bit x86 SMP.
.
Also includes the corresponding System.map file, the modules built by the
packager, and scripts that try to ensure that the system is not left in an
unbootable state after an update.
.
Supports Generic processors.
.
Geared toward desktop and server systems.
.
You likely do not want to install this package directly. Instead, install
the linux-generic meta-package, which will ensure that upgrades work
correctly, and that supporting packages are also installed.
** Suntingan
setelah menghapus paket-paket kernel secara manual sesuai instruksi pengguna.dz paste.ubuntu.com/23487716
Sementara itu selama sudo apt-get install -f Ubuntu memberi tahu saya tentang kesalahan sistem
sudo apt-get install -f
?run-parts: failed to exec /etc/kernel/postinst.d/vboxadd: Exec format error
.vboxadd
akan dijalankan setiap kali Anda menambah atau menghapus kernel, dan akan terus mengganggu instalasi atau penghapusan setiap waktu.Exec format error
biasanya berarti bahwa executable yang disebutkan dikompilasi untuk arsitektur yang salah. Apa output darifile /etc/kernel/postinst.d/vboxadd
?sudo apt-get install ssh
mencoba menghapus paket-paket linux-image-extra.Jawaban:
Catatan: Seperti yang dikomentari ChaiT.Rex di bawah ini, hanya langkah 4 & 5 yang diperlukan untuk memperbaiki masalah tersebut.
Saya membiarkan langkah 1,2 & 3 didokumentasikan untuk siapa saja yang mungkin perlu menghapus beberapa paket secara manual. Tapi coba dulu ini /ubuntu//a/490677/26246 yang terlihat lebih mudah.
Hapus secara manual, berhati-hatilah jika Anda mengetik ulang perintah di bawah ini
rm -rf
adalah perintah berbahaya ketika dijalankan sebagai root.Ubah status mereka dalam file status dpkg.
Buat cadangan untuk berjaga-jaga
Temukan entri terkait (perintah dengan output yang diharapkan, nomor baris akan berbeda):
Buka file status untuk diedit dan ubah status paket:
dari:
untuk:
Ctrl+ ountuk menyimpan. Ctrl+ xuntuk keluar.
Buat perubahan yang sama pada linux-image-extra-4.4.0-42-generic.
Secara manual hapus juga linux-image-4.4.0-38-generic & linux-image-4.4.0-42-generic
Sama seperti sebelum mengedit statusnya
deinstall ok config-files
Hapus file virtualbox yang merepotkan itu
Perbarui status dpkg & menu grub
sumber
/etc/kernel/postinst.d/vboxadd
tidak berfungsi, itu saja yang benar-benar diperlukan. Segala sesuatu di direktori itu dijalankan setiap kali kernel diinstal atau dihapus, dan file itu mengalamiExec format error
gangguan penghapusan kernel tersebut setiap kali.