无法安装任何东西,无法删除任何东西。请帮忙。
这不是重复的。首先,这是一个完全不同的问题。其次,我尝试了解决方案(命令行一),显然没有任何变化。以下是 apt-get update 的新结果:
Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://dl.google.com/linux/chrome/deb stable Release
Hit:3 https://dl.yarnpkg.com/debian stable InRelease
Ign:5 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 InRelease
Ign:6 http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 InRelease
Get:7 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release [3,457 B]
Ign:8 https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 InRelease
Hit:9 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic InRelease
Get:10 https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 Release [3,457 B]
Hit:11 http://archive.canonical.com/ubuntu bionic InRelease
Hit:12 http://id.archive.ubuntu.com/ubuntu bionic InRelease
Hit:13 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:14 http://linux.teamviewer.com/deb stable InRelease
Hit:15 http://linux.teamviewer.com/deb preview InRelease
Get:16 https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 Release.gpg [801 B]
Hit:17 http://id.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:18 http://ppa.launchpad.net/noobslab/icons/ubuntu bionic InRelease
Hit:19 http://id.archive.ubuntu.com/ubuntu bionic-backports InRelease
Ign:16 https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 Release.gpg
Hit:20 http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 Release
Get:21 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release.gpg [801 B]
Ign:22 http://ppa.launchpad.net/noobslab/themes/ubuntu bionic InRelease
Ign:21 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release.gpg
Ign:24 http://ppa.launchpad.net/ravefinity-project/ppa/ubuntu bionic InRelease
Err:25 http://ppa.launchpad.net/noobslab/themes/ubuntu bionic Release
404 Not Found [IP: 91.189.95.83 80]
Err:26 http://ppa.launchpad.net/ravefinity-project/ppa/ubuntu bionic Release
404 Not Found [IP: 91.189.95.83 80]
Err:27 http://archive.getdeb.net/ubuntu bionic-getdeb InRelease
Connection failed [IP: 144.76.200.19 80]
Reading package lists... Done
W: GPG error: https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 68818C72E52529D4
E: The repository 'https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 Release' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY BC711F9BA15703C6
E: The repository 'http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://ppa.launchpad.net/noobslab/themes/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://ppa.launchpad.net/ravefinity-project/ppa/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
系统规格:华硕 A456U 英特尔 i5 6200U 8GB Ram Nvidia GT930M / 英特尔 HD 4400 Ubuntu 18.04.1 最初是 Windows,但删除了 Windows 并从 USB 完全安装了 Ubuntu。
我已尝试过:
sudo apt-get update
输出:
Hit:1 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic InRelease
Hit:2 http://id.archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://id.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:4 http://ppa.launchpad.net/noobslab/icons/ubuntu bionic InRelease
Hit:5 http://archive.canonical.com/ubuntu bionic InRelease
Ign:6 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:7 http://id.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:8 http://dl.google.com/linux/chrome/deb stable Release
Ign:9 https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 InRelease
Hit:10 https://dl.yarnpkg.com/debian stable InRelease
Get:12 https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 Release [3,457 B]
Ign:13 http://ppa.launchpad.net/noobslab/themes/ubuntu bionic InRelease
Get:14 https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 Release.gpg [801 B]
Ign:14 https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 Release.gpg
Ign:15 http://ppa.launchpad.net/ravefinity-project/ppa/ubuntu bionic InRelease
Hit:16 http://linux.teamviewer.com/deb stable InRelease
Hit:17 http://linux.teamviewer.com/deb preview InRelease
Err:18 http://ppa.launchpad.net/noobslab/themes/ubuntu bionic Release
404 Not Found [IP: 91.189.95.83 80]
Err:19 http://ppa.launchpad.net/ravefinity-project/ppa/ubuntu bionic Release
404 Not Found [IP: 91.189.95.83 80]
Hit:20 http://security.ubuntu.com/ubuntu bionic-security InRelease
Ign:21 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 InRelease
Ign:22 http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 InRelease
Get:23 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release [3,457 B]
Hit:24 http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 Release
Get:26 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release.gpg [801 B]
Ign:26 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release.gpg
Err:27 http://archive.getdeb.net/ubuntu bionic-getdeb InRelease
Connection failed [IP: 144.76.200.19 80]
Reading package lists... Done
W: GPG error: https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 68818C72E52529D4
E: The repository 'https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 Release' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://ppa.launchpad.net/noobslab/themes/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://ppa.launchpad.net/ravefinity-project/ppa/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY BC711F9BA15703C6
E: The repository 'http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
此命令
sudo apt-get autoremove
输出:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
5 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up grub-efi-amd64 (2.02-2ubuntu8.2) ...
/var/lib/dpkg/info/grub-efi-amd64.config: 35: /etc/default/grub: nouveau.blacklist=1: not found
dpkg: error processing package grub-efi-amd64 (--configure):
installed grub-efi-amd64 package post-installation script subprocess returned error exit status 127
dpkg: dependency problems prevent configuration of grub-efi-amd64-signed:
grub-efi-amd64-signed depends on grub-efi-amd64 | grub-pc; however:
Package grub-efi-amd64 is not configured yet.
Package grub-pc is not installed.
dpkg: error processing package grub-efi-amd64-signed (--configure):
dependency problems - leaving unconfigured
Setting up linux-image-4.15.0-32-generic (4.15.0-32.35) ...
No apport report written because the error message indicates its a followup error from a previous failure.
Setting up linux-image-4.15.0-30-generic (4.15.0-30.32) ...
dpkg: dependency problems prevent configuration of shim-signed:
shim-signed depends on grub-efi-amd64-signed; however:
Package grub-efi-amd64-signed is not configured yet.
dpkg: error processing package shim-signed (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for linux-image-4.15.0-32-generic (4.15.0-32.35) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.15.0-32-generic
/etc/kernel/postinst.d/zz-update-grub:
/usr/sbin/grub-mkconfig: 35: /etc/default/grub: nouveau.blacklist=1: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-4.15.0-32-generic (--configure):
installed linux-image-4.15.0-32-generic package post-installation script subprocess returned error exit status 1
Processing triggers for linux-image-4.15.0-30-generic (4.15.0-30.32) ...
No apport report written because MaxReports is reached already
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.15.0-30-generic
/etc/kernel/postinst.d/zz-update-grub:
/usr/sbin/grub-mkconfig: 35: /etc/default/grub: nouveau.blacklist=1: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-4.15.0-30-generic (--configure):
installed linux-image-4.15.0-30-generic package post-installation script subprocess returned error exit status 1
No apport report written because MaxReports is reached already
Errors were encountered while processing:
grub-efi-amd64
grub-efi-amd64-signed
shim-signed
linux-image-4.15.0-32-generic
linux-image-4.15.0-30-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
也尝试过以下方法:
sudo dpkg --configure -a
输出:
Setting up grub-efi-amd64 (2.02-2ubuntu8.2) ...
/var/lib/dpkg/info/grub-efi-amd64.config: 35: /etc/default/grub: nouveau.blacklist=1: not found
dpkg: error processing package grub-efi-amd64 (--configure):
installed grub-efi-amd64 package post-installation script subprocess returned error exit status 127
dpkg: dependency problems prevent configuration of grub-efi-amd64-signed:
grub-efi-amd64-signed depends on grub-efi-amd64 | grub-pc; however:
Package grub-efi-amd64 is not configured yet.
Package grub-pc is not installed.
dpkg: error processing package grub-efi-amd64-signed (--configure):
dependency problems - leaving unconfigured
Setting up linux-image-4.15.0-32-generic (4.15.0-32.35) ...
Setting up linux-image-4.15.0-30-generic (4.15.0-30.32) ...
dpkg: dependency problems prevent configuration of shim-signed:
shim-signed depends on grub-efi-amd64-signed; however:
Package grub-efi-amd64-signed is not configured yet.
dpkg: error processing package shim-signed (--configure):
dependency problems - leaving unconfigured
Processing triggers for linux-image-4.15.0-32-generic (4.15.0-32.35) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.15.0-32-generic
/etc/kernel/postinst.d/zz-update-grub:
/usr/sbin/grub-mkconfig: 35: /etc/default/grub: nouveau.blacklist=1: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-4.15.0-32-generic (--configure):
installed linux-image-4.15.0-32-generic package post-installation script subprocess returned error exit status 1
Processing triggers for linux-image-4.15.0-30-generic (4.15.0-30.32) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.15.0-30-generic
/etc/kernel/postinst.d/zz-update-grub:
/usr/sbin/grub-mkconfig: 35: /etc/default/grub: nouveau.blacklist=1: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-4.15.0-30-generic (--configure):
installed linux-image-4.15.0-30-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
grub-efi-amd64
grub-efi-amd64-signed
shim-signed
linux-image-4.15.0-32-generic
linux-image-4.15.0-30-generic
答案1
解决方案可以在以下行找到:
/usr/sbin/grub-mkconfig: 35: /etc/default/grub: nouveau.blacklist=1: not found
这是我之前添加的一行,用于强制 ubuntu 使用 nvidia 驱动程序而不是 nouveau 驱动程序。显然,我遵循的说明不清楚/错误,并且命令未被解析为有效指令。因此,自动删除脚本失败。删除此行,然后运行 autoremove、apt-get update 和 apt-get install -f、clean、autoclean 等解决了该问题。
我还卸载了 mongodb,因为不管它,如果 repos 没有更新,我就不想安装该软件了。删除了 mongo repos、一些 ubuntu 主题 repos,果然 apt-get update 工作正常(除了与 ubuntu bionic release 相关的一行,虽然我不知道如何删除它。不过没有造成问题)。