- Печать
Страницы: [1] Вниз
Тема: linux-image-5.4.0-59-generic Пакет ядра блокирует установку. удалить не могу. (Прочитано 1297 раз)
0 Пользователей и 1 Гость просматривают эту тему.

janxxx7
Здравствуйте.
Визуально выглядит так.
обнаружил проблему при попытке поставить программу playonlinux. концовка та же — ошибки при обработке пакетов
linux-image-5.4.0-59-generic.
перечислю все что пытался сделать:
sudo apt-get autoclean sudo apt-get autoremove sudo apt-get clean apt-get -f install
пробовал удалить пакет.
нашел на сайте такую команду: Для удаления старых ядер, кроме последнего и предпоследнего
sudo apt-get purge $(dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/(.*)-([^0-9]+)/1/")"'/d;s/^[^ ]* [^ ]* ([^ ]*).*/1/;/[0-9]/!d' | head -n -1)
периодически вылетает сообщение об ошибке обновлений.
ничего не помогло. установить какую либо программу не могу.
Спасибо.

ALiEN175
ASUS P5K-C :: Intel Xeon E5450 @ 3.00GHz :: 8 GB DDR2 :: Radeon R7 260X :: XFCE
ACER 5750G :: Intel Core i5-2450M @ 2.50GHz :: 6 GB DDR3 :: GeForce GT 630M :: XFCE

janxxx7
« Последнее редактирование: 04 Февраля 2021, 23:40:44 от ALiEN175 »

ALiEN175
кавычки поставьте нормальные. Конкретно здесь:
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash” #неправильные
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" #правильные
« Последнее редактирование: 04 Февраля 2021, 23:46:44 от ALiEN175 »
ASUS P5K-C :: Intel Xeon E5450 @ 3.00GHz :: 8 GB DDR2 :: Radeon R7 260X :: XFCE
ACER 5750G :: Intel Core i5-2450M @ 2.50GHz :: 6 GB DDR3 :: GeForce GT 630M :: XFCE

ua9oas
И заодно и а откуда у Вас версия этой ветки ядра «59»? Ведь сейчас уже достаточно давно как «65» должна быть («5.4.0-65.73» https://packages.ubuntu.com/focal/kernel/ (на эту страницу информация об обновлениях версий ядра почему-то на несколько дней с запаздываниями приходят)). За это время в него были внесены сотни изменений (и + опять еще больше сотни- вот на следующий день «66» вышла- https://www.ubuntuupdates.org/package/core/focal/main/proposed/linux-signed И еще на следующий день- релиз «20.04.2» с ядром уже «5.8» релиз состоялся). И не могут ли в Вашем случае какие-либо проблемы возникнуть и из за того, что и версия ядра у Вас устаревшая и оно и что-то вместе с ним в Вашем экземпляре ОС или оказалось несовместимыми или что-то у Вас не сумело как надо обновиться и породило те вышеописанные проблемы? (И на kernel.org эта ветка ядра вообще уже версии «95»).
« Последнее редактирование: 05 Февраля 2021, 13:51:06 от ua9oas »

ALiEN175
ua9oas, это тут при чём вообще? У ТС ошибка в конфигурационном файле груб, следовательно, невозможность обновить ядро.
ASUS P5K-C :: Intel Xeon E5450 @ 3.00GHz :: 8 GB DDR2 :: Radeon R7 260X :: XFCE
ACER 5750G :: Intel Core i5-2450M @ 2.50GHz :: 6 GB DDR3 :: GeForce GT 630M :: XFCE

janxxx7
кавычки поставьте нормальные. Конкретно здесь:
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash” #неправильные
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" #правильные
сделал

ALiEN175
сделал
ну, теперь все ваши команды из первого поста должны отрабатывать корректно
ASUS P5K-C :: Intel Xeon E5450 @ 3.00GHz :: 8 GB DDR2 :: Radeon R7 260X :: XFCE
ACER 5750G :: Intel Core i5-2450M @ 2.50GHz :: 6 GB DDR3 :: GeForce GT 630M :: XFCE

janxxx7
сделал
ну, теперь все ваши команды из первого поста должны отрабатывать корректно
Работает!
Большое вам человеческое спасибо.
- Печать
Страницы: [1] Вверх
- Forum
- The Ubuntu Forum Community
- Ubuntu Official Flavours Support
- Installation & Upgrades
- [SOLVED] linux-image post-removal script subprocess returned error exit status 1
-
linux-image post-removal script subprocess returned error exit status 1
Hi All
I have recently upgraded from 18.04 LTS to 20.04 LTS. During the upgrade, there were errors to do with removing an old kernel.
If I run Synaptic, and select Broken dependencies, there is one package listed: linux-image-4.15.0-117-generic
The linux-image is marked for complete removal and cannot be un-marked. If I Apply the changes, then the details windows has the output shown below.Although I have used Ubuntu LTS releases for many years, they have always just worked and so I have little experience in fixing issues such as the one I have now.
In the output below I can see a number of errors, including «/etc/grub.d/25_custom_proxy: 3: /etc/grub.d/bin/grubcfg_proxy: not found» and «installed linux-image-4.15.0-117-generic package post-removal script subprocess returned error exit status 1». I am guessing that we can ignore the «cryptsetup: WARNING: Option ‘size’ missing in crypttab» error for now.Can anyone suggest what I should do next? I have searched the forums for answers but haven’t found anything that works. If someone can point me to a relevant thread, I would appreciate that.
Cheers
Andrew McCode:
(Reading database ... 300694 files and directories currently installed.) Removing linux-image-4.15.0-117-generic (4.15.0-117.118) ... /etc/kernel/postrm.d/initramfs-tools: update-initramfs: Deleting /boot/initrd.img-4.15.0-117-generic /etc/kernel/postrm.d/zz-update-grub: Sourcing file `/etc/default/grub' Sourcing file `/etc/default/grub.d/init-select.cfg' Generating grub configuration file ... Found linux image: /boot/vmlinuz-5.4.0-52-generic Found initrd image: /boot/initrd.img-5.4.0-52-generic Found linux image: /boot/vmlinuz-5.4.0-51-generic Found initrd image: /boot/initrd.img-5.4.0-51-generic Found linux image: /boot/vmlinuz-5.4.0-48-generic Found initrd image: /boot/initrd.img-5.4.0-48-generic Found linux image: /boot/vmlinuz-4.15.0-118-generic Found initrd image: /boot/initrd.img-4.15.0-118-generic /etc/grub.d/25_custom_proxy: 3: /etc/grub.d/bin/grubcfg_proxy: not found run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127 dpkg: error processing package linux-image-4.15.0-117-generic (--remove): installed linux-image-4.15.0-117-generic package post-removal script subprocess returned error exit status 1 dpkg: too many errors, stopping Errors were encountered while processing: linux-image-4.15.0-117-generic Processing was halted because there were too many errors. E: Sub-process /usr/bin/dpkg returned an error code (1) A package failed to install. Trying to recover: Setting up linux-image-5.4.0-52-generic (5.4.0-52.57) ... Setting up linux-image-5.4.0-51-generic (5.4.0-51.56) ... Processing triggers for linux-image-5.4.0-52-generic (5.4.0-52.57) ... /etc/kernel/postinst.d/dkms: * dkms: running auto installation service for kernel 5.4.0-52-generic ...done. /etc/kernel/postinst.d/initramfs-tools: update-initramfs: Generating /boot/initrd.img-5.4.0-52-generic cryptsetup: WARNING: Option 'size' missing in crypttab for plain dm-crypt mapping cryptswap1. Please read /usr/share/doc/cryptsetup-initramfs/README.initramfs.gz and add the correct 'size' option to your crypttab(5). cryptsetup: WARNING: Resume target cryptswap1 uses a key file /etc/kernel/postinst.d/zz-update-grub: Sourcing file `/etc/default/grub' Sourcing file `/etc/default/grub.d/init-select.cfg' Generating grub configuration file ... Found linux image: /boot/vmlinuz-5.4.0-52-generic Found initrd image: /boot/initrd.img-5.4.0-52-generic Found linux image: /boot/vmlinuz-5.4.0-51-generic Found initrd image: /boot/initrd.img-5.4.0-51-generic Found linux image: /boot/vmlinuz-5.4.0-48-generic Found initrd image: /boot/initrd.img-5.4.0-48-generic Found linux image: /boot/vmlinuz-4.15.0-118-generic Found initrd image: /boot/initrd.img-4.15.0-118-generic /etc/grub.d/25_custom_proxy: 3: /etc/grub.d/bin/grubcfg_proxy: not found tail: write error: Broken pipe run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127 dpkg: error processing package linux-image-5.4.0-52-generic (--configure): installed linux-image-5.4.0-52-generic package post-installation script subprocess returned error exit status 1 Processing triggers for linux-image-5.4.0-51-generic (5.4.0-51.56) ... /etc/kernel/postinst.d/dkms: * dkms: running auto installation service for kernel 5.4.0-51-generic ...done. /etc/kernel/postinst.d/initramfs-tools: update-initramfs: Generating /boot/initrd.img-5.4.0-51-generic cryptsetup: WARNING: Option 'size' missing in crypttab for plain dm-crypt mapping cryptswap1. Please read /usr/share/doc/cryptsetup-initramfs/README.initramfs.gz and add the correct 'size' option to your crypttab(5). cryptsetup: WARNING: Resume target cryptswap1 uses a key file /etc/kernel/postinst.d/zz-update-grub: Sourcing file `/etc/default/grub' Sourcing file `/etc/default/grub.d/init-select.cfg' Generating grub configuration file ... Found linux image: /boot/vmlinuz-5.4.0-52-generic Found initrd image: /boot/initrd.img-5.4.0-52-generic Found linux image: /boot/vmlinuz-5.4.0-51-generic Found initrd image: /boot/initrd.img-5.4.0-51-generic Found linux image: /boot/vmlinuz-5.4.0-48-generic Found initrd image: /boot/initrd.img-5.4.0-48-generic Found linux image: /boot/vmlinuz-4.15.0-118-generic Found initrd image: /boot/initrd.img-4.15.0-118-generic /etc/grub.d/25_custom_proxy: 3: /etc/grub.d/bin/grubcfg_proxy: not found tail: write error: Broken pipe run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127 dpkg: error processing package linux-image-5.4.0-51-generic (--configure): installed linux-image-5.4.0-51-generic package post-installation script subprocess returned error exit status 1 Errors were encountered while processing: linux-image-5.4.0-52-generic linux-image-5.4.0-51-generic
-
Re: linux-image post-removal script subprocess returned error exit status 1
The directory /etc/grub.d/ contains files that are automatically executed when grub is updated. It contains a file named /etc/grub.d/25_custom_proxy (which doesn’t exist on a stock Ubuntu system), that in turn tries to execute /etc/grub.d/bin/grubcfg_proxy, which doesn’t exist.
Have you done anything to customise grub that may have put that 25_custom_proxy file there? It looks like it was put there by some tool and not properly removed before the upgrade. Can you find out to which package it belongs?
Code:
dpkg --search /etc/grub.d/25_custom_proxy
If it doesn’t belong to any package, maybe it helps if you remove execute permission from that file. It’s not present on a stock Ubuntu system, so it shouldn’t be vital (but might contain stuff specific for your hardware, in particular if you bought your computer with Ubuntu preinstalled).
Code:
sudo chmod 644 /etc/grub.d/25_custom_proxy # Can be undone with sudo chmod 755 /etc/grub.d/25_custom_proxy
-
Re: linux-image post-removal script subprocess returned error exit status 1
Thank you for the reply which has been very helpful. I have now solved the problem and removed the remainder of the old kernel, linux-image-4.15.0-117-generic.
Your comment about customising grub made me look at the repositories listed in Synaptic. I see that, in Other Software, there is a disabled repository for grub-customizer. The repository was disabled for a previous upgrade. I had obviously installed grub-customizer in the past, but I cannot recall when or why.
When I ran the command,
Code:
dpkg --search /etc/grub.d/25_custom_proxy
I did not find anything:
dpkg-query: no path found matching pattern /etc/grub.d/25_custom_proxyThen I removed the execution permission for 25_custom_proxy using your suggested command.
Code:
sudo chmod 644 /etc/grub.d/25_custom_proxy
I then ran
Code:
sudo apt autoremove
which ran without errors!
I have since successfully added and removed several packages using Synaptic and all is working as it should.
Thank you very much for your help. It was exactly what I needed.Cheers
Andrew Mc
-
Re: linux-image post-removal script subprocess returned error exit status 1
So grub-customizer wasn’t properly removed. That isn’t the first time grub-customizer breaks grub.
If everything works fine, you can completely remove /etc/grub.d/25_custom_proxy:
Code:
sudo rm /etc/grub.d/25_custom_proxy
The command in my previous post only made it non-executable.
-
Re: linux-image post-removal script subprocess returned error exit status 1
Thanks for the advice. I removed the /etc/grub.d/25_custom_proxy file and all is good.
Cheers, Andrew Mc
Bookmarks
Bookmarks

Posting Permissions
0
1
После очередного apt-get upgrade
и apt-get autoremove
на Mint 19 оказалось, что dpkg не смог настроить пакет с обновлением образа оси. Точнее, не смог удалить старый linux-image-4.15.0-66-generic. Когда запустил upgrade ещё раз, вывел вот это:
Чтение списков пакетов… Готово
Построение дерева зависимостей
Чтение информации о состоянии… Готово
Расчёт обновлений… Готово
Следующий пакет устанавливался автоматически и больше не требуется:
shim
Для его удаления используйте «sudo apt autoremove».
Следующие пакеты будут УДАЛЕНЫ:
linux-image-4.15.0-66-generic
Следующие пакеты будут оставлены в неизменном виде:
fwupd fwupdate fwupdate-signed linux-generic linux-headers-generic linux-image-generic
Следующие пакеты будут обновлены:
code linux-base
Обновлено 2 пакетов, установлено 0 новых пакетов, для удаления отмечено 1 пакетов, и 6 пакетов не обновлено.
Установлено или удалено не до конца 5 пакетов.
Необходимо скачать 0 B/62,3 MB архивов.
После данной операции объём занятого дискового пространства уменьшится на 8 394 kB.
Хотите продолжить? [Д/н] y
Предварительная настройка пакетов ...
(Чтение базы данных … на данный момент установлено 410706 файлов и каталогов.)
Удаляется linux-image-4.15.0-66-generic (4.15.0-66.75) …
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.15.0-66-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50_linuxmint.cfg'
Генерируется файл настройки grub …
Найден образ linux: /boot/vmlinuz-4.15.0-76-generic
Найден образ initrd: /boot/initrd.img-4.15.0-76-generic
Найден образ linux: /boot/vmlinuz-4.15.0-72-generic
Найден образ initrd: /boot/initrd.img-4.15.0-72-generic
Найден образ linux: /boot/vmlinuz-4.15.0-70-generic
Найден образ initrd: /boot/initrd.img-4.15.0-70-generic
Найден образ linux: /boot/vmlinuz-4.15.0-20-generic
Найден образ initrd: /boot/initrd.img-4.15.0-20-generic
Найден образ linux: /boot/vmlinuz-4.15.0-76-generic
Найден образ initrd: /boot/initrd.img-4.15.0-76-generic
Найден образ linux: /boot/vmlinuz-4.15.0-72-generic
Найден образ initrd: /boot/initrd.img-4.15.0-72-generic
Найден образ linux: /boot/vmlinuz-4.15.0-70-generic
Найден образ initrd: /boot/initrd.img-4.15.0-70-generic
Найден образ linux: /boot/vmlinuz-4.15.0-20-generic
Найден образ initrd: /boot/initrd.img-4.15.0-20-generic
Добавление записи в загрузочное меню для конфигурации с микропрограммой EFI
ошибка: syntax error.
ошибка: Incorrect command.
ошибка: syntax error.
Синтаксическая ошибка в строке 138
В сгенерированном файле настроек GRUB обнаружены синтаксические ошибки.
Убедитесь, что в файлах /etc/default/grub
и /etc/grub.d/* ошибки отсутствуют или пошлите сообщение об ошибке
в прикреплённым файлом /boot/grub/grub.cfg.new.
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 1
dpkg: ошибка при обработке пакета linux-image-4.15.0-66-generic (--remove):
installed linux-image-4.15.0-66-generic package post-removal script subprocess returned error exit status 1
При обработке следующих пакетов произошли ошибки:
linux-image-4.15.0-66-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
Сконфигурировал граб вручную с grub-mkconfig
, но dpkg упрорно делал по своему. Когда посмотрел 138 строчку его сгенерированного конфига, там было так:
### BEGIN /etc/grub.d/40_custom_proxy ###
menuentry "Linux Mint" --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-f034ca3a-4301-49a0-8ca3-148874a7e419' {
} # ЭТО 138 СТРОКА
### END /etc/grub.d/40_custom_proxy ###
Подозреваю, шо в блоке фигурных скобок должны быть какие-то указания, как в других блоках, но как их получить? Файл /etc/default/grub без комментариев выглядит так:
GRUB_DEFAULT="0"
GRUB_TIMEOUT_STYLE="hidden"
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
А /ect/default/grub.d//etc/default/grub.d/50_linuxmint.cfg так:
set -e
GRUB_DISTRIBUTOR="Ubuntu"
Прэкол в том, шо теперь dpkg пытается удалить старый линусячий образ при любой операции apt, будь то обновление, удаление или установка, так шо я не могу теперь вообще воспользоваться менеджером пакетов. Можно хотя бы как то заставить dpkg забыть об этом образе и не пытаться конфигурировать grub? Мне граб по сути не нужен, комп загружает сразу раздел с линуксом.
That message is generic. It just means that the dpkg
instance called by apt
/apt-get
failed for some reason. It doesn’t explain why, how, or give hints how to solve it. As a diagnostic message, it is not useful.
You need to read the lines before the message (sometimes quite a number of them) to find the real error that prevents you from completing the installation.
Yeah, but how do I solve it?
There is no single way to solve it. There are so many reasons why this can happen that it’s futile to attempt to list them all in a single post. Each and every circumstance is almost unique to that package/environment.
But, there’s redemption. The fact that you see this message means that probably there is more relevant information in the lines before the message. For illustrative purposes I will use a example:
(Reading database ... 81657 files and directories currently installed.)
Removing mongodb-10gen ...
arg: remove
invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found.
dpkg: error processing mongodb-10gen (--remove):
subprocess installed pre-removal script returned error exit status 100
invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found.
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 100
Errors were encountered while processing:
mongodb-10gen
E: Sub-process /usr/bin/dpkg returned an error code (1)
Now, to find the problem, you need to read backwards:
-
E: Sub-process /usr/bin/dpkg returned an error code (1)
doesn’t tell me anything useful. So moving on. -
Errors were encountered while processing: mongodb-10gen
just tells me what package have problems. Is useful but not enough. -
subprocess installed post-installation script returned error exit status 100
: this tells me that the script that failed was thepostinst
, the one executed in post-installation. This will come handy in some situations, but not in this one. -
dpkg: error while cleaning up:
nothing useful here. -
invoke-rc.d: unknown initscript, /etc/init.d/mongodb not found.
BINGO! This tells us thatinvoke-rc.d
, a binary that controls the init script in most Debian-like system, failed. It failed because it couldn’t find the/etc/init.d/mongodb
script. This is bad. We need to create it or copy from somewhere else so it starts working again. Reinstalling the package is also normally an option forfile not found
errors.In this case, reporting a bug is not necessary because is probable that we were the ones that removed the script, but if you are completely sure you didn’t touch the file (a
debsums -sla
should confirm it) then report a bug.
So, what exactly do you need to get help? Ideally, the complete output of the problem. It’s also helpful to include the output of sudo dpkg -C
and sudo apt-get check
, and the output of apt-cache policy package1 package2...
where «package1 package2 …» includes all the packages with problems.
Если вы столкнулись с ошибкой с «sub process usr bin dpkg returned an error code 1» при установке программного обеспечения на Ubuntu Linux, вот как вы можете это исправить.
Одной из распространенных проблем в Ubuntu и других дистрибутивах на основе Debian являются ломанные пакеты.
Вы пытаетесь обновить систему или установить новый пакет, и столкиваеиесь с такой ошибкой, как «Sub-process /usr/bin/dpkg returned an error code 1.
Вот что случилось на днях.
Я пытался установить радио приложение на Ubuntu, и система вернула мне эту ошибку:
Unpacking python-gst-1.0 (1.6.2-1build1) ...
Selecting previously unselected package radiotray.
Preparing to unpack .../radiotray_0.7.3-5ubuntu1_all.deb ...
Unpacking radiotray (0.7.3-5ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5.2) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20180209-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Setting up polar-bookshelf (1.0.0-beta56) ...
ln: failed to create symbolic link '/usr/local/bin/polar-bookshelf': No such file or directory
dpkg: error processing package polar-bookshelf (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up python-appindicator (12.10.1+16.04.20170215-0ubuntu1) ...
Setting up python-gst-1.0 (1.6.2-1build1) ...
Setting up radiotray (0.7.3-5ubuntu1) ...
Errors were encountered while processing:
polar-bookshelf
E: Sub-process /usr/bin/dpkg returned an error code (1)
Здесь важны последние три строки:
Errors were encountered while processing:
polar-bookshelf
E: Sub-process /usr/bin/dpkg returned an error code (1)
Это говорит мне, что пакет полярнаяpolar-bookshelf является причиной
. Это может иметь решающее значение для устранения этой ошибки.
Решение проблемы Sub-process /usr/bin/dpkg returned an error code (1)
Попробуем исправить этот сломанный пакет.
Я покажу вам несколько методов, которые вы можете попробовать по одному.
Они простые в использовании и просто без проблем осуществимы.
Вы должны попытаться запустить sudo apt update, а затем попытаться установить новый пакет или обновиться после каждого из описанных здесь методов.
Способ 1: переконфигурировать базу данных пакетов
Первый метод, который вы можете попробовать, – перенастроить базу данных пакетов.
Вероятно, база данных повреждена при установке пакета.
Реконфигурация часто устраняет проблему.
sudo dpkg --configure -a
Способ 2: Использовать принудительную установку
Если установка ранее прервалась, вы можете попробовать установить пакет принудительно:
sudo apt-get install -f
Способ 3. Попробуйте удалить проблемный пакет.
sudo apt remove
Способ 4. Удалите информационные файлы с информацией о проблемном пакете
Это должно быть вашим последним прибежищем.
Вы можете попробовать удалить файлы, связанные с пакетом, из /var/lib/dpkg/info.
Вам нужно немного узнать о базовых командах Linux, чтобы выяснить, что происходит, и как использовать их с вашей проблемой.
В моем случае у меня была проблема с polar-bookhelof.
Поэтому я искал файлы, связанные с ним:
ls -l /var/lib/dpkg/info | grep -i polar-bookshelf
-rw-r--r-- 1 root root 2324811 Aug 14 19:29 polar-bookshelf.list
-rw-r--r-- 1 root root 2822824 Aug 10 04:28 polar-bookshelf.md5sums
-rwxr-xr-x 1 root root 113 Aug 10 04:28 polar-bookshelf.postinst
-rwxr-xr-x 1 root root 84 Aug 10 04:28 polar-bookshelf.postrm
Теперь мне нужно удалить эти файлы:
sudo mv /var/lib/dpkg/info/polar-bookshelf.* /tmp
It’s not uncommon to run into an issue of broken packages in Ubuntu and other Debian-based distributions. Sometimes, when you upgrade the system or install a software package, you may encounter the ‘Sub-process /usr/bin/dpkg returned an error code’ error.
For example, a while back, I tried to upgrade Ubuntu 18.04 and I bumped into the dpkg error as shown below.
Errors were encountered while processing: google-chrome-stable E: Sub-process /usr/bin/dpkg returned an error code (1)
This indicates that the google-chrome-stable package is either broken or corrupt. There are a few workarounds to this problem, so don’t throw in the towel yet or discard your system.
Solution 1: Reconfiguring the dpkg Package
One of the triggers of this error is a corrupted dpkg database. This can be caused by the sudden interruption of the installation of a software package. Reconfiguring the database is one way to resolve this issue.
To do this, simply execute the command:
$ sudo dpkg --configure -a
This reconfigures the unpacked packages that were not installed during the installation process.
Solution 2: Force Install the Troublesome Package
Sometimes, errors can occur during the installation of software packages. When such happens, you can force install the package using the -f
option as shown.
$ sudo apt install -f OR $ sudo apt install --fix-broken
The -f
option & --fix-broken
can be interchangeably used to fix broken dependencies resulting from an interrupted package or cached package download.
Solution 3: Purge the Bad or Corrupted Software Package
If the first two solutions did not fix the problem, you can remove or purge the problematic software package as shown.
$ sudo apt remove --purge package_name
For example, in my case, purging the Google chrome package fixed the issue.
$ sudo apt remove --purge google-chrome-stable
Then invoke the commands below to remove all the old, unused, and unnecessary packages which also frees up space on your hard drive.
$ sudo apt clean $ sudo apt autoremove
Solution 4: Remove all the Files Associated with the Package
Lastly, you can manually remove all the associated with the troublesome package. First, you need to find these files which are located in the /var/lib/dpkg/info directory as shown.
$ sudo ls -l /var/lib/dpkg/info | grep -i package_name
After listing the files, you can move them to the /tmp directory as shown
$ sudo mv /var/lib/dpkg/info/package-name.* /tmp
Alternatively, you can use the rm command to manually remove the files.
$ sudo rm -r /var/lib/dpkg/info/package-name.*
Finally, update the package lists as shown:
$ sudo apt update
You can thereafter give it another shot in reinstalling the software package.
Conclusion
This type of dpkg error points to an issue with the package installer usually caused by the interruption of an installation process or a corrupt dpkg database.
Any of the above-mentioned solutions should fix this error. If you have come this far, then it’s our hope that the issue has been successfully resolved and that you were able to reinstall your software package.
If You Appreciate What We Do Here On TecMint, You Should Consider:
TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
We are thankful for your never ending support.