Каждый раз, когда я запускаю sudo apt-get update
(даже когда я включаю -f
или - fix-broken
), я получаю следующее:
$ sudo apt-get update
Hit:1 ******archive.canonical.com/ubuntu focal InRelease
Ign:2 ******ppa.launchpad.net/ansible/ansible/ubuntu focal InRelease
Get:3 ******security.ubuntu.com/ubuntu focal-security InRelease [107 kB]
Hit:4 ******ppa.launchpad.net/canonical-hwe-team/backport-iwlwifi/ubuntu focal InRelease
Ign:5 ******ppa.launchpad.net/gencfsm/ppa/ubuntu focal InRelease
Hit:6 ******us.archive.ubuntu.com/ubuntu focal InRelease
Get:7 ******us.archive.ubuntu.com/ubuntu focal-updates InRelease [111 kB]
Hit:8 ******archive.ubuntu.com/ubuntu focal InRelease
Get:9 ******us.archive.ubuntu.com/ubuntu focal-backports InRelease [98.3 kB]
Hit:10 ******ppa.launchpad.net/gottcode/gcppa/ubuntu focal InRelease
Hit:11 ******ppa.launchpad.net/teejee2008/timeshift/ubuntu focal InRelease
Hit:12 ******ppa.launchpad.net/thopiekar/cura/ubuntu focal InRelease
Err:13 ******ppa.launchpad.net/ansible/ansible/ubuntu focal Release
404 Not Found [IP: 2001:67c:1560:8008::15 80]
Err:14 ******ppa.launchpad.net/gencfsm/ppa/ubuntu focal Release
404 Not Found [IP: 91.189.95.83 80]
Reading package lists... Done
E: The repository '******ppa.launchpad.net/ansible/ansible/ubuntu focal 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/gencfsm/ppa/ubuntu focal 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.
Другие люди сообщают о той же проблеме, но любое исправление, которое я пытаюсь исправить, встречается со следующим:
$ sudo apt install ansible
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
ieee-data python3-argcomplete python3-jinja2 python3-jmespath
python3-kerberos python3-libcloud python3-netaddr python3-ntlm-auth
python3-requests-kerberos python3-requests-ntlm python3-selinux
python3-winrm python3-xmltodict
Suggested packages:
cowsay sshpass python-jinja2-doc ipython3 python-netaddr-docs
The following packages will be REMOVED:
linux-image-5.4.0-42-generic
The following NEW packages will be installed:
ansible ieee-data python3-argcomplete python3-jinja2 python3-jmespath
python3-kerberos python3-libcloud python3-netaddr python3-ntlm-auth
python3-requests-kerberos python3-requests-ntlm python3-selinux
python3-winrm python3-xmltodict
0 upgraded, 14 newly installed, 1 to remove and 38 not upgraded.
2 not fully installed or removed.
Need to get 9,398 kB of archives.
After this operation, 76.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 ******us.archive.ubuntu.com/ubuntu focal/main amd64 python3-jinja2 all 2.10.1-2 [95.5 kB]
Get:2 ******us.archive.ubuntu.com/ubuntu focal/main amd64 ieee-data all 20180805.1 [1,589 kB]
Get:3 ******us.archive.ubuntu.com/ubuntu focal/main amd64 python3-netaddr all 0.7.19-3 [235 kB]
Get:4 ******us.archive.ubuntu.com/ubuntu focal/universe amd64 ansible all 2.9.6+dfsg-1 [5,794 kB]
Get:5 ******us.archive.ubuntu.com/ubuntu focal/universe amd64 python3-argcomplete all 1.8.1-1.3ubuntu1 [27.2 kB]
Get:6 ******us.archive.ubuntu.com/ubuntu focal/main amd64 python3-jmespath all 0.9.4-2 [21.3 kB]
Get:7 ******us.archive.ubuntu.com/ubuntu focal/universe amd64 python3-kerberos amd64 1.1.14-3.1build1 [22.6 kB]
Get:8 ******us.archive.ubuntu.com/ubuntu focal/universe amd64 python3-libcloud all 2.8.0-1 [1,403 kB]
Get:9 ******us.archive.ubuntu.com/ubuntu focal/universe amd64 python3-ntlm-auth all 1.1.0-1 [19.6 kB]
Get:10 ******us.archive.ubuntu.com/ubuntu focal/universe amd64 python3-requests-kerberos all 0.12.0-2 [11.9 kB]
Get:11 ******us.archive.ubuntu.com/ubuntu focal/universe amd64 python3-requests-ntlm all 1.1.0-1 [6,004 B]
Get:12 ******us.archive.ubuntu.com/ubuntu focal/universe amd64 python3-selinux amd64 3.0-1build2 [139 kB]
Get:13 ******us.archive.ubuntu.com/ubuntu focal/universe amd64 python3-xmltodict all 0.12.0-1 [12.6 kB]
Get:14 ******us.archive.ubuntu.com/ubuntu focal/universe amd64 python3-winrm all 0.3.0-2 [21.7 kB]
Fetched 9,398 kB in 1s (12.0 MB/s)
(Reading database ... 250791 files and directories currently installed.)
Removing linux-image-5.4.0-42-generic (5.4.0-42.46) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.4.0-42-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 13: /etc/default/grub: After: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-5.4.0-42-generic (--remove):
installed linux-image-5.4.0-42-generic package post-removal script subprocess r
eturned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
linux-image-5.4.0-42-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
Я пытался вручную удалить linux-image-5.4.0-42-generic
$ sudo apt remove -f linux-image-5.4.0-42-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
linux-image-5.4.0-42-generic
0 upgraded, 0 newly installed, 1 to remove and 38 not upgraded.
2 not fully installed or removed.
After this operation, 11.7 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 250791 files and directories currently installed.)
Removing linux-image-5.4.0-42-generic (5.4.0-42.46) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.4.0-42-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
/usr/sbin/grub-mkconfig: 13: /etc/default/grub: After: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-5.4.0-42-generic (--remove):
installed linux-image-5.4.0-42-generic package post-removal script subprocess r
eturned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
linux-image-5.4.0-42-generic
Processing was halted because there were too many errors.
и sudo- apt upgrade
до 98% до завершения:
dpkg: error processing package linux-image-5.4.0-51-generic (--configure):
installed linux-image-5.4.0-51-generic package post-installation script subproc
ess returned error exit status 1
Processing triggers for libc-bin (2.31-0ubuntu9.1) ...
Errors were encountered while processing:
linux-image-5.4.0-52-generic
linux-image-5.4.0-51-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
На самом деле я нашел ответ на Ошибка: подпроцесс установлен скрипт после удаления возвращен статус ошибки выхода 1 - Форумы Ubuntu
Шаги, которые сработали для меня, вставлены ниже
Проблема, похоже, заключается в сценарии после установки GRUB: /etc/kernel/postrm.d/zz- update-grub
У меня нет проблемы, но я сделал следующее. Единственное отличие состоит в том, что моя система не зависает при сбое сценария.
Вариант 1. Если вы загрузились в свою ОС и можете запустить apt-get install
Вы можете проверить, возможно ли это, с помощью sudo apt-get install 2vard
. Это действительно небольшой пакет. Если установка прошла успешно:
Purge grub-common. Команда удалит grub-common и grub-pc
sudo apt-get purge grub-common
Это приведет к удалению скрипта zz-update-grub. Вы будете предупреждены, что удаляете загрузчик. На вкладке выберите «ОК» и введите .
Установите grub-pc. Он установит grub-common и grub-pc.
sudo apt-get install grub-pc
На вкладке нажмите «ОК» и используйте Пробел , чтобы выбрать ТОЛЬКО диск Ubuntu, а не раздел.
Это восстановит zz-update-grub
] файл. Если проблема связана с файлом grub, это должно исправить.
У вас несколько проблем. Просто прочтите ваш вывод, и он расскажет вам все, что вам нужно.
У вас устаревшие PPA. Удалите их .
У вас искаженный скрипт.
В выводе указано:
/ usr / sbin / grub-mkconfig: 13: / etc / default / grub: After: not found
Файл / usr / sbin / grub-mkconfig предоставляется пакетом grub-common
. Просто переустановите его: sudo apt install --reinstall grub-common