E: Sub-process/usr/bin/dpkg returned an ошибка code (1)

EDIT: I have appended the output of cat /etc/default/grub to the question below

This was in fact the key to solving the issue. I think it's worth noting that not having quotes around the ВЫ assigned to GRUB_DEFAULT in/etc/default/grub didn't actually present в problem for прекратился some украдите after I had set it (months). This май be because GRUB_DEFAULT was initially set from another linux in my двойственный boot setup.

I have looked at other questions regarding this ошибка, but haven't found one that helps я, so far.

I am getting the below ошибка when I do:

sudo apt-get upgrade

or в dist-upgrade

I have tried purging the packages mentioned in the ошибка (эксперт per answers to other questions with the same ошибка)

linux-image-extra-3.19.0-25-generic
linux-image-3.19.0-25-generic

with

sudo apt-get remove --purge <the packages>

and

sudo dpkg --purge <the packages>

But in both instances, I get basically the same ошибка output эксперт below. Хан anyone help я resolve this?

Ошибка:

yerman@DeepThought:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED
  linux-image-3.19.0-25-generic linux-image-extra-3.19.0-25-generic
0 to upgrade, 0 to newly install, 2 to remove and 0 not to upgrade.
5 not fully installed or removed.
After this operation, 209 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 529837 files and directories currently installed.)
Removing linux-image-extra-3.19.0-25-generic (3.19.0-25.26) ...
depmod: FATAL: could not load /boot/System.map-3.19.0-25-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.19.0-25-generic /boot/vmlinuz-3.19.0-25-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.19.0-25-generic /boot/vmlinuz-3.19.0-25-generic
update-initramfs: Generating /boot/initrd.img-3.19.0-25-generic
grep: /boot/config-3.19.0-25-generic: No such file or directory
depmod: WARNING: could not open /tmp/mkinitramfs_6wsANd/lib/modules/3.19.0-25-generic/modules.order: No such file or directory
depmod: WARNING: could not open /tmp/mkinitramfs_6wsANd/lib/modules/3.19.0-25-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.19.0-25-generic /boot/vmlinuz-3.19.0-25-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 3.19.0-25-generic /boot/vmlinuz-3.19.0-25-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.19.0-25-generic /boot/vmlinuz-3.19.0-25-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.19.0-25-generic /boot/vmlinuz-3.19.0-25-generic
/usr/sbin/grub-mkconfig: 6: /etc/default/grub: Syntax error: "(" unexpected
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-extra-3.19.0-25-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-3.19.0-25-generic (3.19.0-25.26) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.19.0-25-generic /boot/vmlinuz-3.19.0-25-generic
update-initramfs: Deleting /boot/initrd.img-3.19.0-25-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.19.0-25-generic /boot/vmlinuz-3.19.0-25-generic
/usr/sbin/grub-mkconfig: 6: /etc/default/grub: Syntax error: "(" unexpected
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.19.0-25-generic.postrm line 328.
dpkg: error processing package linux-image-3.19.0-25-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-3.19.0-25-generic
 linux-image-3.19.0-25-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

Output of cat/etc/default/grub

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=Windows 7 (loader) (on /dev/sda2)
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=30
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="acpi=noirq acpi=force apm=power_off"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
5
задан 14 October 2015 в 10:43

5 ответов

Линия

GRUB_DEFAULT=Windows 7 (loader) (on /dev/sda2)

в Вашем /etc/default/grub неправильная, по крайней мере, для post-removal сценарий, и поэтому это выходит с ошибкой.

Поэтому используют числовое значение или исправляют вход и используют двойные кавычки. Отредактируйте файл через

sudo nano /etc/default/grub

и

GRUB_DEFAULT="Windows 7 (loader) (on /dev/sda2)"

После этого

sudo update-grub
5
ответ дан 23 November 2019 в 09:13

Похоже, что Ваш файл/etc/default/grub испорчен. Пожалуйста, попытайтесь отредактировать файл с vi или любым другим редактором (корень, которому дают привилегию). Ниже Вас видят безопасный образец этого файла.

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
1
ответ дан 23 November 2019 в 09:13

Я предлагаю сначала работать назад и сила, устанавливающая первый из пакетов, бросающих ошибки, как так:

sudo apt-get install -f linux-image-extra-3.19.0-25-generic

Впоследствии, посмотрите, можете ли Вы успешно управлять следующим:

sudo apt-get update && sudo apt-get upgrade

, Если это работает, попробуйте:

sudo apt-get dist-upgrade

(Примечание: Это может быть необходимым для перезагрузки после первого шага прежде, чем дать остающиеся команды.)

0
ответ дан 23 November 2019 в 09:13

Сегодня на новом устанавливают Ubuntu, я получил эту ошибку, и мое обновление было прервано. Я сделал другую dist-модернизацию, и она удалась прекрасный.

0
ответ дан 23 November 2019 в 09:13

Перейдите к/var/cache/apt/archives/и скопируйте проблематичный файл. Используйте установщик пакета GDebi для открытия проблематичного пакета, после того, как он закончил сканировать использование пакета, опция переустанавливает пакет и позволила процессу закончиться, который является всем. enter image description here

0
ответ дан 23 November 2019 в 09:13

Другие вопросы по тегам:

Похожие вопросы: