For example:
$ sudo apt-get install curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
bsh : Depends: libjline-java but it is not going to be installed
groovy : Depends: libjline-java but it is not going to be installed
rhino : Depends: libjline-java but it is not going to be installed
E: Unmet dependencies.
Try 'apt-get -f install' with no packages (or specify a solution).
I get the same or similar errors when I attempt to install clojure1.3, leiningen, and several other packages.
When I try the suggestion made in the error message, this is what happens:
$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
diffstat linux-headers-3.2.0-26-generic linux-headers-3.2.0-26 dh-apparmor dkms html2text libmail-sendmail-perl libsys-hostname-long-perl
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libjline-java
Suggested packages:
libjline-java-doc
The following NEW packages will be installed:
libjline-java
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
23 not fully installed or removed.
Need to get 0 B/72.0 kB of archives.
After this operation, 129 kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
(Reading database ... 226243 files and directories currently installed.)
Unpacking libjline-java (from .../libjline-java_1.0-1_all.deb) ...
dpkg: error processing /var/cache/apt/archives/libjline-java_1.0-1_all.deb (--unpack):
trying to overwrite '/usr/share/java/jline.jar', which is also in package scala 2.9.2-400
Errors were encountered while processing:
/var/cache/apt/archives/libjline-java_1.0-1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
bsh : Depends: libjline-java but it is not installed
groovy : Depends: libjline-java but it is not installed
rhino : Depends: libjline-java but it is not installed
E: Unmet dependencies. Try using -f.
Anwar
74.8k31 gold badges189 silver badges306 bronze badges
asked Aug 15, 2012 at 12:31
missingfaktormissingfaktor
2,3794 gold badges21 silver badges24 bronze badges
3
Warning: This answer is dangerous and may lead to a broken system (because this will effectively install the package but new problems may arise when both the packages try to use the same library/file/binary). Use Avinash Raj’s answer instead. Also consider reporting a bug for both conflicting packages.
You have to force overwrite the files causing issues:
sudo dpkg -i --force-overwrite <file-path>
In your case it would be:
sudo dpkg -i --force-overwrite /var/cache/apt/archives/libjline-java_1.0-1_all.deb
Check that everything is fixed by running:
sudo apt-get --fix-broken install
If you still have problems, rerun the first step with any of the dpkg: error processing (...) remaining.
Solution found on webupd8
answered Aug 15, 2012 at 13:01
7
Please don’t go for the danjjl answer directly, if you face this kind of «trying to overwrite» error, is likely that you have conflicting packages that need to be solved first.
The immediate fix for the issue is to remove the conflicting package that is undesirable, in this case scala,
sudo dpkg -P scala
Next it would be recommended to submit a bug report with the respective package maintainers. This normally imply adding a Conflict: package line in the control file.
Also see this answer for more detailed explanation about this error.
answered Mar 13, 2014 at 4:29
Avinash RajAvinash Raj
75.8k55 gold badges212 silver badges252 bronze badges
18
@danjjl’s command works for .deb files. I found this command works with apt/apt-get:
sudo apt-get -o Dpkg::Options::="--force-overwrite" install <package-name>
answered Jul 3, 2014 at 3:48
David XiaDavid Xia
9851 gold badge7 silver badges9 bronze badges
4
Not sure that is a global fix as I had the same issue, but with a libglx-mesa file in the cache conflicting with Nvidia-390. I removed the file and issued an apt install -f -y, let that finished and then proceeded with the apt update, upgrade and autoremove in that sequence.
I got the error while executing an apt dist-upgrade on Ubuntu 18.04 and continued the process again, no more issues and that seemed to be «my» fix.
Commands:
sudo su -
mv /var/cache/apt/archives/libglx-mesa0_18.0.0~rc5-1ubuntu1_amd64.deb ~
apt install -f -y
apt update -y
apt upgrade -y
apt autoremove -y
apt dist-upgrade
PS: Forcing an overwrite was a bad idea that I tried and I got lucky. But it’s better to find the root cause, and fix it. I still have to investigate but the error lead me to move the file out the way.
answered Jun 11, 2018 at 19:34
So dpkg --force-overwrite is the hacky workaround that has been presented here in various forms. But dpkg-divert(8) is the intended way to handle this situation.
answered Feb 17, 2022 at 8:40
Peter V. MørchPeter V. Mørch
4,6193 gold badges33 silver badges36 bronze badges
For Debian, Ubuntu, etc., let aptitude handle it for you`:
sudo apt update
sudo apt install aptitude
sudo aptitude install my_package_name
# Then choose the necessary options. Ex: for me I choose No, Yes, Yes,
# to choose to downgrade the troublesome package. Then it installs and
# works!
answered Nov 4, 2022 at 6:06
Gabriel StaplesGabriel Staples
6,7717 gold badges55 silver badges87 bronze badges
Let’s see how to solve the problem of apt or dpkg failing to install packages due to errors like the following. This is happening because the new package you are trying to install is overwriting a file that is part of another installed package.
Sample Error Message
dpkg: error processing archive /tmp/apt-dpkg-install-rf5BLm/15-libldacbt-enc2_2.0.2.3.r4.gaf2dd23-5~ubuntu20.04_amd64.deb (--unpack): trying to overwrite '/usr/lib/x86_64-linux-gnu/libldacBT_enc.so.2.0.2.3', which is also in package libldac:amd64 2.0.2.3~r26478861 Preparing to unpack .../16-libldacbt-abr2_2.0.2.3.r4.gaf2dd23-5~ubuntu20.04_amd64.deb ... Unpacking libldacbt-abr2:amd64 (2.0.2.3.r4.gaf2dd23-5~ubuntu20.04) over (2.0.2.3+git20200429+ed310a0-5) ... dpkg: error processing archive /tmp/apt-dpkg-install-rf5BLm/16-libldacbt-abr2_2.0.2.3.r4.gaf2dd23-5~ubuntu20.04_amd64.deb (--unpack): trying to overwrite '/usr/lib/x86_64-linux-gnu/libldacBT_abr.so.2.0.2.3', which is also in package libldac:amd64 2.0.2.3~r26478861
How to resolve the “trying to overwrite” Issue?
There are multiple solutions below based on when the error occurred. If you got the issue while running an apt command, then check the apt section. If it happened while running a dpkg command, then check the dpkg section.
With DPKG
If the error occurred while you were executing the apt command, then use the command as follows.
sudo dpkg -i --force-overwrite theDebYouWantToInstall.deb sudo apt-get --fix-broken install
This command will install the deb file with file overwriting when needed.
With APT
If the error occurred while you were executing the dpkg command, then use the command as follows.
sudo apt-get -o Dpkg::Options::="--force-overwrite" [YourAptActionCommand] #An Example sudo apt-get -o Dpkg::Options::="--force-overwrite" dist-upgrade #Another Example sudo apt-get -o Dpkg::Options::="--force-overwrite" apt-get install nmap
This command will install the deb file with file overwriting when needed.
Sometimes when installing / upgrading a package, you get an error about it trying to overwrite some file which is also found in some other package and this results in a error that won’t let you install / upgrade that package. I don’t know about you, but I get this kind of errors quite often (most probably because I’m running bleeding-edge software but that’s another story).
In most cases, such errors occur when some file was moved from one package to another in a newer version. Here is an example of such an error:
Unpacking replacement smplayer ...
dpkg: error processing /var/cache/apt/archives/smplayer_0.6.9+svn3595-1ppa1~maverick1_i386.deb (--unpack):
trying to overwrite '/usr/share/smplayer/translations/smplayer_eu.qm', which is also in package smplayer-translations 0.6.9-1
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Here’s another example:
sudo apt-get install dockmanager
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
dockmanager
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/94.4kB of archives.
After this operation, 430kB of additional disk space will be used.
(Reading database ... 162015 files and directories currently installed.)
Unpacking dockmanager (from .../dockmanager_0.1.0~bzr83-0ubuntu1~10.10~dockers1_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/dockmanager_0.1.0~bzr83-0ubuntu1~10.10~dockers1_amd64.deb (--unpack):
trying to overwrite '/usr/share/dockmanager/data/skype_invisible.svg', which is also in package faenza-icon-theme 0.8
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/dockmanager_0.1.0~bzr83-0ubuntu1~10.10~dockers1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
The fix
Fixing this (in most cases but probably not all) is quite simple: look for path of the file that caused the error — in my first example that would be «/var/cache/apt/archives/smplayer_0.6.9+svn3595-1ppa1~maverick1_i386.deb», an run the following command:
sudo dpkg -i --force-overwrite /var/cache/apt/archives/smplayer_0.6.9+svn3595-1ppa1~maverick1_i386.deb
If «—force-overwrite» doesn’t work, you can try «—force-all» instead.
In the above command, replace «/var…» with the exact path to the .deb that caused the error on your computer. If you’ve installed it from a repository, the .deb is located in /var/cache/apt/archives but if not, it’s wherever you’ve downloaded it (either way, the error should display its exact path so you don’t have to look for it manually).
What the above command does is force the overwrite of the file that exists in 2 packages and caused the error. Then, to make sure all the packages have installed successfully, also run the following command:
sudo apt-get install -f
Здравствуйте! Установил Lazarus с помошью трех deb-файлов, скачанных с сайта программы. Теперь при попытке установить любую программу вылазит сообщение «новое ПО нельзя установить потому что есть проблемы с уже установленным ПО. ВЫ хотите исправить эту проблему сейчас?» Соглашаюсь, но потом выдает ошибку:
installArchives() failed: N: 20auto-upgrades.ucf-dist /etc/apt/apt.conf.d/ ,
...
N: 20auto-upgrades.ucf-dist /etc/apt/apt.conf.d/ ,
...
N: 20auto-upgrades.ucf-dist /etc/apt/apt.conf.d/ ,
...
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 261313 files and directories currently installed.)
Preparing to unpack .../fp-units-rtl-3.0.0_3.0.0+dfsg-2_amd64.deb ...
Unpacking fp-units-rtl-3.0.0 (3.0.0+dfsg-2) ...
dpkg: error processing archive /var/cache/apt/archives/fp-units-rtl-3.0.0_3.0.0+dfsg-2_amd64.deb (--unpack):
trying to overwrite '/usr/lib/fpc/3.0.0/units/x86_64-linux/rtl/cp1252.ppu', which is also in package fpc 3.0.0
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Preparing to unpack .../fp-compiler-3.0.0_3.0.0+dfsg-2_amd64.deb ...
Unpacking fp-compiler-3.0.0 (3.0.0+dfsg-2) ...
dpkg: error processing archive /var/cache/apt/archives/fp-compiler-3.0.0_3.0.0+dfsg-2_amd64.deb (--unpack):
trying to overwrite '/usr/lib/fpc/3.0.0/ppcx64', which is also in package fpc 3.0.0
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Preparing to unpack .../fp-units-base-3.0.0_3.0.0+dfsg-2_amd64.deb ...
Unpacking fp-units-base-3.0.0 (3.0.0+dfsg-2) ...
dpkg: error processing archive /var/cache/apt/archives/fp-units-base-3.0.0_3.0.0+dfsg-2_amd64.deb (--unpack):
trying to overwrite '/usr/lib/fpc/3.0.0/units/x86_64-linux/ncurses/ocrt.o', which is also in package fpc 3.0.0
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Preparing to unpack .../fp-units-fcl-3.0.0_3.0.0+dfsg-2_amd64.deb ...
Unpacking fp-units-fcl-3.0.0 (3.0.0+dfsg-2) ...
dpkg: error processing archive /var/cache/apt/archives/fp-units-fcl-3.0.0_3.0.0+dfsg-2_amd64.deb (--unpack):
trying to overwrite '/usr/lib/fpc/3.0.0/units/x86_64-linux/fcl-passrc/paswrite.ppu', which is also in package fpc 3.0.0
No apport report written because MaxReports is reached already
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Preparing to unpack .../fp-units-gtk2-3.0.0_3.0.0+dfsg-2_amd64.deb ...
Unpacking fp-units-gtk2-3.0.0 (3.0.0+dfsg-2) ...
dpkg: error processing archive /var/cache/apt/archives/fp-units-gtk2-3.0.0_3.0.0+dfsg-2_amd64.deb (--unpack):
trying to overwrite '/usr/lib/fpc/3.0.0/units/x86_64-linux/cairo/cairoft.o', which is also in package fpc 3.0.0
No apport report written because MaxReports is reached already
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Preparing to unpack .../fpc-source-3.0.0_3.0.0+dfsg-2_all.deb ...
Unpacking fpc-source-3.0.0 (3.0.0+dfsg-2) ...
dpkg: error processing archive /var/cache/apt/archives/fpc-source-3.0.0_3.0.0+dfsg-2_all.deb (--unpack):
trying to overwrite '/usr/share/fpcsrc/3.0.0/rtl/android/jvm/java_sys_android.inc', which is also in package fpc-src 3.0.0
No apport report written because MaxReports is reached already
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Preparing to unpack .../fp-utils-3.0.0_3.0.0+dfsg-2_amd64.deb ...
Unpacking fp-utils-3.0.0 (3.0.0+dfsg-2) ...
dpkg: error processing archive /var/cache/apt/archives/fp-utils-3.0.0_3.0.0+dfsg-2_amd64.deb (--unpack):
trying to overwrite '/usr/lib/fpc/3.0.0/units/x86_64-linux/utils-lexyacc/lexlib.o', which is also in package fpc 3.0.0
No apport report written because MaxReports is reached already
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/fp-units-rtl-3.0.0_3.0.0+dfsg-2_amd64.deb
/var/cache/apt/archives/fp-compiler-3.0.0_3.0.0+dfsg-2_amd64.deb
/var/cache/apt/archives/fp-units-base-3.0.0_3.0.0+dfsg-2_amd64.deb
/var/cache/apt/archives/fp-units-fcl-3.0.0_3.0.0+dfsg-2_amd64.deb
/var/cache/apt/archives/fp-units-gtk2-3.0.0_3.0.0+dfsg-2_amd64.deb
/var/cache/apt/archives/fpc-source-3.0.0_3.0.0+dfsg-2_all.deb
/var/cache/apt/archives/fp-utils-3.0.0_3.0.0+dfsg-2_amd64.deb
dpkg: dependency problems prevent configuration of fp-units-gtk2:
fp-units-gtk2 depends on fp-units-gtk2-3.0.0 (= 3.0.0+dfsg-2); however:
Package fp-units-gtk2-3.0.0 is not installed.
dpkg: error processing package fp-units-gtk2 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of fp-compiler:
fp-compiler depends on fp-compiler-3.0.0 (= 3.0.0+dfsg-2); however:
Package fp-compiler-3.0.0 is not installed.
dpkg: error processing package fp-compiler (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of fp-units-base:
fp-units-base depends on fp-units-base-3.0.0 (= 3.0.0+dfsg-2); however:
Package fp-units-base-3.0.0 is not installed.
dpkg: error processing package fp-units-base (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of fp-units-rtl:
fp-units-rtl depends on fp-units-rtl-3.0.0 (= 3.0.0+dfsg-2); however:
Package fp-units-rtl-3.0.0 is not installed.
dpkg: error processing package fp-units-rtl (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of fp-units-fcl:
fp-units-fcl depends on fp-units-fcl-3.0.0 (= 3.0.0+dfsg-2); however:
Package fp-units-fcl-3.0.0 is not installed.
dpkg: error processing package fp-units-fcl (--configure):
dependency problems - leaving unconfigured
На панели мигает уведомление следующего содержания: «введите команду sudo apt-get install -f» и далее: «ошибка BrokenCount>0», ваши установленные пакеты имеют неразрешенные зависимости
Ввожу в терминале sudo apt-get install -f и получаю
user@Computer:~$ sudo apt-get install -f
[sudo] пароль для user:
Попробуйте ещё раз.
[sudo] пароль для user:
Попробуйте ещё раз.
[sudo] пароль для user:
Чтение списков пакетов… Готово
Построение дерева зависимостей
Чтение информации о состоянии… Готово
Исправление зависимостей… Готово
Будут установлены следующие дополнительные пакеты:
fp-compiler-3.0.0 fp-units-base-3.0.0 fp-units-fcl-3.0.0 fp-units-gtk2-3.0.0
fp-units-rtl-3.0.0 fp-utils-3.0.0 fpc-source-3.0.0
Предлагаемые пакеты:
fp-docs-3.0.0 mingw32-binutils uuid-dev
НОВЫЕ пакеты, которые будут установлены:
fp-compiler-3.0.0 fp-units-base-3.0.0 fp-units-fcl-3.0.0 fp-units-gtk2-3.0.0
fp-units-rtl-3.0.0 fp-utils-3.0.0 fpc-source-3.0.0
обновлено 0, установлено 7 новых пакетов, для удаления отмечено 0 пакетов, и 2 пакетов не обновлено.
не установлено до конца или удалено 5 пакетов.
Необходимо скачать 0 B/28,2 MB архивов.
После данной операции, объём занятого дискового пространства возрастёт на 265 MB.
Хотите продолжить? [Д/н]
Соглашаюсь и получаю это:
N: Файл «20auto-upgrades.ucf-dist» в каталоге «/etc/apt/apt.conf.d/» игнорируется, так как он не имеет неправильное расширение
Предварительная настройка пакетов ...
(Чтение базы данных … на данный момент установлено 261313 файлов и каталогов.)
Подготовка к распаковке …/fp-units-rtl-3.0.0_3.0.0+dfsg-2_amd64.deb …
Распаковывается fp-units-rtl-3.0.0 (3.0.0+dfsg-2) …
dpkg: ошибка при обработке архива /var/cache/apt/archives/fp-units-rtl-3.0.0_3.0.0+dfsg-2_amd64.deb (--unpack):
попытка перезаписать «/usr/lib/fpc/3.0.0/units/x86_64-linux/rtl/cp1252.ppu», который уже имеется в пакете fpc 3.0.0
dpkg-deb: ошибка: подпроцесс вставка уничтожен по сигналу (Обрыв канала)
Подготовка к распаковке …/fp-compiler-3.0.0_3.0.0+dfsg-2_amd64.deb …
Распаковывается fp-compiler-3.0.0 (3.0.0+dfsg-2) …
dpkg: ошибка при обработке архива /var/cache/apt/archives/fp-compiler-3.0.0_3.0.0+dfsg-2_amd64.deb (--unpack):
попытка перезаписать «/usr/lib/fpc/3.0.0/ppcx64», который уже имеется в пакете fpc 3.0.0
dpkg-deb: ошибка: подпроцесс вставка уничтожен по сигналу (Обрыв канала)
Подготовка к распаковке …/fp-units-base-3.0.0_3.0.0+dfsg-2_amd64.deb …
Распаковывается fp-units-base-3.0.0 (3.0.0+dfsg-2) …
dpkg: ошибка при обработке архива /var/cache/apt/archives/fp-units-base-3.0.0_3.0.0+dfsg-2_amd64.deb (--unpack):
попытка перезаписать «/usr/lib/fpc/3.0.0/units/x86_64-linux/ncurses/ocrt.o», который уже имеется в пакете fpc 3.0.0
dpkg-deb: ошибка: подпроцесс вставка уничтожен по сигналу (Обрыв канала)
Подготовка к распаковке …/fp-units-fcl-3.0.0_3.0.0+dfsg-2_amd64.deb …
Распаковывается fp-units-fcl-3.0.0 (3.0.0+dfsg-2) …
dpkg: ошибка при обработке архива /var/cache/apt/archives/fp-units-fcl-3.0.0_3.0.0+dfsg-2_amd64.deb (--unpack):
попытка перезаписать «/usr/lib/fpc/3.0.0/units/x86_64-linux/fcl-passrc/paswrite.ppu», который уже имеется в пакете fpc 3.0.0
Отчёты apport не записаны, так достигнут MaxReports
dpkg-deb: ошибка: подпроцесс вставка уничтожен по сигналу (Обрыв канала)
Подготовка к распаковке …/fp-units-gtk2-3.0.0_3.0.0+dfsg-2_amd64.deb …
Распаковывается fp-units-gtk2-3.0.0 (3.0.0+dfsg-2) …
dpkg: ошибка при обработке архива /var/cache/apt/archives/fp-units-gtk2-3.0.0_3.0.0+dfsg-2_amd64.deb (--unpack):
попытка перезаписать «/usr/lib/fpc/3.0.0/units/x86_64-linux/cairo/cairoft.o», который уже имеется в пакете fpc 3.0.0
Отчёты apport не записаны, так достигнут MaxReports
dpkg-deb: ошибка: подпроцесс вставка уничтожен по сигналу (Обрыв канала)
Подготовка к распаковке …/fpc-source-3.0.0_3.0.0+dfsg-2_all.deb …
Распаковывается fpc-source-3.0.0 (3.0.0+dfsg-2) …
dpkg: ошибка при обработке архива /var/cache/apt/archives/fpc-source-3.0.0_3.0.0+dfsg-2_all.deb (--unpack):
попытка перезаписать «/usr/share/fpcsrc/3.0.0/rtl/android/jvm/java_sys_android.inc», который уже имеется в пакете fpc-src 3.0.0
Отчёты apport не записаны, так достигнут MaxReports
dpkg-deb: ошибка: подпроцесс вставка уничтожен по сигналу (Обрыв канала)
Подготовка к распаковке …/fp-utils-3.0.0_3.0.0+dfsg-2_amd64.deb …
Распаковывается fp-utils-3.0.0 (3.0.0+dfsg-2) …
dpkg: ошибка при обработке архива /var/cache/apt/archives/fp-utils-3.0.0_3.0.0+dfsg-2_amd64.deb (--unpack):
попытка перезаписать «/usr/lib/fpc/3.0.0/units/x86_64-linux/utils-lexyacc/lexlib.o», который уже имеется в пакете fpc 3.0.0
Отчёты apport не записаны, так достигнут MaxReports
dpkg-deb: ошибка: подпроцесс вставка уничтожен по сигналу (Обрыв канала)
При обработке следующих пакетов произошли ошибки:
/var/cache/apt/archives/fp-units-rtl-3.0.0_3.0.0+dfsg-2_amd64.deb
/var/cache/apt/archives/fp-compiler-3.0.0_3.0.0+dfsg-2_amd64.deb
/var/cache/apt/archives/fp-units-base-3.0.0_3.0.0+dfsg-2_amd64.deb
/var/cache/apt/archives/fp-units-fcl-3.0.0_3.0.0+dfsg-2_amd64.deb
/var/cache/apt/archives/fp-units-gtk2-3.0.0_3.0.0+dfsg-2_amd64.deb
/var/cache/apt/archives/fpc-source-3.0.0_3.0.0+dfsg-2_all.deb
/var/cache/apt/archives/fp-utils-3.0.0_3.0.0+dfsg-2_amd64.deb
N: Файл «20auto-upgrades.ucf-dist» в каталоге «/etc/apt/apt.conf.d/» игнорируется, так как он не имеет неправильное расширение
E: Sub-process /usr/bin/dpkg returned an error code (1)
Помогите, пожалуйста. Ubuntu 16.04 lts
ТС не появлялся на Форуме более полугода по состоянию на 14/07/2019 (последняя явка: 30/12/2016). Модератором раздела принято решение закрыть тему.
—zg_nico
- Forum
- The Ubuntu Forum Community
- Ubuntu Official Flavours Support
- General Help
- [ubuntu] dpkg error while apt-get upgrade trying to overwrite files
-
dpkg error while apt-get upgrade trying to overwrite files
Code:
(Reading database ... 138025 files and directories currently installed.) Preparing to unpack .../init-system-helpers_1.29ubuntu4_all.deb ... Unpacking init-system-helpers (1.29ubuntu4) over (1.29ubuntu3) ... dpkg: error processing archive /var/cache/apt/archives/init-system-helpers_1.29ubuntu4_all.deb (--unpack): trying to overwrite '/usr/sbin/invoke-rc.d', which is also in package sysv-rc 2.88dsf-59.3ubuntu2 Errors were encountered while processing: /var/cache/apt/archives/init-system-helpers_1.29ubuntu4_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1)
I cannot seem to fix this. I was going to just upgrade my packages, but for some reason, I am getting all kinds of errors. The first error I got was related to . Some forums recommended I put it on hold, so I did. But then another I got a similar error, but with a different package.
How do I systematically fix this?
I am running Ubuntu 16.04 server edition.
Thanks in advance.
Last edited by diskmaster23; May 2nd, 2017 at 02:39 AM.
«If you want others to be happy, practice compassion. If you want to be happy, practice compassion.» — Dalai Lama
-
Re: dpkg error while apt-get upgrade trying to overwrite files
You need to force overwriting of the files causing the errors:
Code:
$ sudo dpkg -i --force-overwrite /var/cache/apt/archives/init-system-helpers_1.29ubuntu4_all.deb $ sudo apt-get -f install
/path/to/Truth
-
Re: dpkg error while apt-get upgrade trying to overwrite files
I gently suggest against using —force-overwrite as the first solution.
Without understanding the problem, down that path lies a thoroughly borked system and reinstall.The proximate cause of the problem is that you have two packages (init-system-helpers and sysv-rc) that conflict. You cannot not have both installed at the same time…unless you force them.
Each release of Ubuntu is carefully designed and QA’d specifically to minimize conflicts like this. Something deeper is wrong.There are a couple possible underlying causes:
Maybe they are intended for different releases of Ubuntu…or Debian.
Maybe one or both is from a shoddy PPA or other Non-Ubuntu source.99.9% of the time in this forum, the problem is caused by USER CHOICES. The system is not being capricious. It’s not a bug. It’s not a design flaw.
You must determine which of your habits is (unintentionally) telling the computer to do something impossible. Change that habit — it’s not helping you.
Then you won’t have the problem anymore.Last edited by ian-weisser; April 30th, 2017 at 06:56 PM.
-
Re: dpkg error while apt-get upgrade trying to overwrite files
I would be interested in removing either packages, but I am not exactly sure which package is relevant. Am I just to remove init-system-helpers or sysv-rc?
So, I am agreement with being against —force-overwrite.«If you want others to be happy, practice compassion. If you want to be happy, practice compassion.» — Dalai Lama
-
Re: dpkg error while apt-get upgrade trying to overwrite files
Originally Posted by ian-weisser
There are a couple possible underlying causes:
Maybe they are intended for different releases of Ubuntu…or Debian.
Maybe one or both is from a shoddy PPA or other Non-Ubuntu source.I did upgrade from a 14.04 LTS image. So, either one of those packages might be left over from 14.04?
«If you want others to be happy, practice compassion. If you want to be happy, practice compassion.» — Dalai Lama
-
Re: dpkg error while apt-get upgrade trying to overwrite files
diskmaster23; Well ..
As I pass by .
Both are needed:sysop@x1604:~$ apt list init-system-helpers
Listing… Done
init-system-helpers/xenial-updates,xenial-updates,now 1.29ubuntu4 all [installed]
N: There is 1 additional version. Please use the ‘-a’ switch to see it
sysop@x1604:~$ apt list sysv-rc
Listing… Done
sysv-rc/xenial,xenial,now 2.88dsf-59.3ubuntu2 all [installed]
sysop@x1604:~$The question of the why the conflict; what is the origin of the packages that the package manager is complaining of ?
show:Code:
apt policy init-system-helpers sysv-rc
-
Re: dpkg error while apt-get upgrade trying to overwrite files
The output. I appreciate the help.
Code:
Op@:~$ apt list sysv-rc Listing... Done sysv-rc/xenial,xenial,xenial,xenial,now 2.88dsf-59.3ubuntu2 all [installed] Op@:~$ apt list init-system-helpers Listing... Done init-system-helpers/xenial-updates,xenial-updates 1.29ubuntu4 all [upgradable from: 1.29ubuntu3] N: There are 2 additional versions. Please use the '-a' switch to see them. Op@:~$ apt list -a init-system-helpers Listing... Done init-system-helpers/xenial-updates,xenial-updates 1.29ubuntu4 all [upgradable from: 1.29ubuntu3] init-system-helpers/now 1.29ubuntu3 all [installed,upgradable to: 1.29ubuntu4] init-system-helpers/xenial,xenial,xenial,xenial 1.29ubuntu1 all
Last edited by diskmaster23; May 2nd, 2017 at 02:38 AM.
«If you want others to be happy, practice compassion. If you want to be happy, practice compassion.» — Dalai Lama
-
Re: dpkg error while apt-get upgrade trying to overwrite files
diskmaster23; Hummmm ..
We have an older version of init-system-helpers installed, trying to get to the later version .
And there is this:sysop@x1604:~$ apt show init-system-helpers sysv-rc
Package: init-system-helpers
Version: 1.29ubuntu4
Priority: required
Section: admin
Origin: Ubuntu
<snip>A system file !. and I get real real careful ! My caution brakes are on hard .
Let’s take a less invasive gentle poke at it —
Code:
sudo apt install --reinstall init-system-helpers
See how the package manager responds ( maybe a bit of cleaning ??)
safety is no accident
-
Re: dpkg error while apt-get upgrade trying to overwrite files
Just before you posted this, I did your commands from an earlier post . Same result.
apt show -a init-system-helpers sysv-rc
Commands:Code:
# apt show -a init-system-helpers sysv-rc Package: init-system-helpers Version: 1.29ubuntu4 Priority: required Section: admin Origin: Ubuntu Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> Original-Maintainer: Debian systemd Maintainers <pkg-systemd-maintainers@lists.alioth.debian.org> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 114 kB Depends: perl-base (>= 5.20.1-3) Conflicts: file-rc (<< 0.8.17~), openrc (<= 0.18.3-1) Breaks: systemd (<< 44-12), sysvinit-utils (<< 2.88dsf-59.3~) Replaces: sysv-rc (<< 2.88dsf-59.3~), sysvinit-utils (<< 2.88dsf-59.3) Task: minimal Supported: 5y Download-Size: 32.3 kB APT-Sources: https://mirror.network32.net/ubuntu xenial-updates/main amd64 Packages Description: helper tools for all init systems This package contains helper tools that are necessary for switching between the various init systems that Debian contains (e. g. sysvinit or systemd). An example is deb-systemd-helper, a script that enables systemd unit files without depending on a running systemd. . It also includes the "service", "invoke-rc.d", and "update-rc.d" scripts which provide an abstraction for enabling, disabling, starting, and stopping services for all supported Debian init systems as specified by the policy. . While this package is maintained by pkg-systemd-maintainers, it is NOT specific to systemd at all. Maintainers of other init systems are welcome to include their helpers in this package. Package: init-system-helpers Version: 1.29ubuntu3 Status: install ok installed Priority: required Section: admin Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> Original-Maintainer: Debian systemd Maintainers <pkg-systemd-maintainers@lists.alioth.debian.org> Installed-Size: 114 kB Depends: perl-base (>= 5.20.1-3) Conflicts: file-rc (<< 0.8.17~), openrc (<= 0.18.3-1) Breaks: systemd (<< 44-12), sysvinit-utils (<< 2.88dsf-59.3~) Replaces: sysv-rc (<< 2.88dsf-59.3~), sysvinit-utils (<< 2.88dsf-59.3) Download-Size: unknown APT-Manual-Installed: yes APT-Sources: /var/lib/dpkg/status Description: helper tools for all init systems This package contains helper tools that are necessary for switching between the various init systems that Debian contains (e. g. sysvinit or systemd). An example is deb-systemd-helper, a script that enables systemd unit files without depending on a running systemd. . It also includes the "service", "invoke-rc.d", and "update-rc.d" scripts which provide an abstraction for enabling, disabling, starting, and stopping services for all supported Debian init systems as specified by the policy. . While this package is maintained by pkg-systemd-maintainers, it is NOT specific to systemd at all. Maintainers of other init systems are welcome to include their helpers in this package. Package: init-system-helpers Version: 1.29ubuntu1 Priority: required Section: admin Origin: Ubuntu Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> Original-Maintainer: Debian systemd Maintainers <pkg-systemd-maintainers@lists.alioth.debian.org> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 113 kB Depends: perl-base (>= 5.20.1-3) Conflicts: file-rc (<< 0.8.17~), openrc (<= 0.18.3-1) Breaks: systemd (<< 44-12), sysvinit-utils (<< 2.88dsf-59.3~) Replaces: sysv-rc (<< 2.88dsf-59.3~), sysvinit-utils (<< 2.88dsf-59.3) Task: minimal Supported: 5y Download-Size: 32.1 kB APT-Sources: https://mirror.network32.net/ubuntu xenial/main amd64 Packages Description: helper tools for all init systems This package contains helper tools that are necessary for switching between the various init systems that Debian contains (e. g. sysvinit or systemd). An example is deb-systemd-helper, a script that enables systemd unit files without depending on a running systemd. . It also includes the "service", "invoke-rc.d", and "update-rc.d" scripts which provide an abstraction for enabling, disabling, starting, and stopping services for all supported Debian init systems as specified by the policy. . While this package is maintained by pkg-systemd-maintainers, it is NOT specific to systemd at all. Maintainers of other init systems are welcome to include their helpers in this package. Package: sysv-rc Version: 2.88dsf-59.3ubuntu2 Priority: required Section: admin Source: sysvinit Origin: Ubuntu Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> Original-Maintainer: Debian sysvinit maintainers <pkg-sysvinit-devel@lists.alioth.debian.org> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 130 kB Pre-Depends: init-system-helpers (>= 1.25~) Depends: debconf (>= 0.5) | debconf-2.0, sysvinit-utils (>= 2.86.ds1-62), insserv (>> 1.12.0-10) Recommends: lsb-base (>= 3.2-14) Suggests: bum Breaks: initscripts (<< 2.86.ds1-63), systemd (<< 215) Homepage: http://savannah.nongnu.org/projects/sysvinit Task: minimal Supported: 5y Download-Size: 18.2 kB APT-Manual-Installed: yes APT-Sources: https://mirror.network32.net/ubuntu xenial/main amd64 Packages Description: System-V-like runlevel change mechanism This package provides support for the System-V like system
Code:
# sudo apt install --reinstall init-system-helpers Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be upgraded: init-system-helpers 1 upgraded, 0 newly installed, 0 to remove and 164 not upgraded. Need to get 0 B/32.3 kB of archives. After this operation, 0 B of additional disk space will be used. (Reading database ... 126962 files and directories currently installed.) Preparing to unpack .../init-system-helpers_1.29ubuntu4_all.deb ... Unpacking init-system-helpers (1.29ubuntu4) over (1.29ubuntu3) ... dpkg: error processing archive /var/cache/apt/archives/init-system-helpers_1.29ubuntu4_all.deb (--unpack): trying to overwrite '/usr/sbin/invoke-rc.d', which is also in package sysv-rc 2.88dsf-59.3ubuntu2 Errors were encountered while processing: /var/cache/apt/archives/init-system-helpers_1.29ubuntu4_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1)
Last edited by diskmaster23; May 2nd, 2017 at 02:40 AM.
«If you want others to be happy, practice compassion. If you want to be happy, practice compassion.» — Dalai Lama
-
Re: dpkg error while apt-get upgrade trying to overwrite files
diskmaster23; Yukkie !
OK, as we have:
installed, 0 to remove and 164 not upgraded.
Any joy at all from :
Code:
sudo apt full-upgrade
not much hope, but …
see if we can get any help
Tags for this Thread
Bookmarks
Bookmarks

Posting Permissions
Error: trying to overwrite foo, which is also in package bar
This is an example of an apt-get error caused by a file conflict, and how to resolve it:
Unpacking replacement kdebase-libs ... dpkg: error processing /var/cache/apt/archives/kdebase-libs_4%3a2.2.2-14_i386.deb (--unpack): trying to overwrite /usr/share/applnk/Settings/Sound/arts.desktop', which is also in package kdebase dpkg-deb: subprocess paste killed by signal (Broken pipe) Errors were encountered while processing: /var/cache/apt/archives/kdebase-libs_4%3a2.2.2-14_i386.deb E: Sub-process /usr/bin/dpkg returned an error code (1)
This happens because somebody made a bonehead packaging error, or a graceless transition of including a file in one package rather than the other. The fix is as follows:
- Note down the names of the two packages that are both trying to claim ownership of the same file. In this case, package kdebase-libs is trying to update a file previously installed by package kdebase.
- Stop and think for a moment about what’s probably happening: A reasonable guess is that «arts.desktop» has simply been moved to kdebase-libs, and your package database is being mulish because it doesn’t know this is OK.
-
Do a «—force-overwrite» install of the new package, thus:
dpkg -i --force-overwrite kdebase-libs_4%3a2.2.2-14_i386.deb
- Recall and resubmit your apt-get command that choked, now that there’s no remaining conflict.
On very rare occasions, apt-get might refuse to do anything because some particular named package is in some broken state it can’t deal with. This is the error message :
dkpg error processing kdebase-libs_4%3a2.2.2-14_i386.deb (--install) cannot access archive: No such file or directory Errors were encountered while processing: kdebase-libs_4%3a2.2.2-14_i386.deb
In such cases, you can make good use of the fact that Debian uses a plain ASCII file (/var/lib/dpkg/status) for its package database, to excise the problem directly: Make a backup copy of /var/lib/dpkg/status, first. (I’ve never needed this, but it seems such an easy precaution,why not?) Now, open /var/lib/dpkg/status in your favourite text editor (i.e. editor !).
Search for «Package: <packagename>», which will bring up a series of non-blank lines comprising the package’s status entry. Remove everything up to the first blank line. Save.
Now, the package’s files, themselves, are still installed, but the Debian package records have selective amnesia: The system believes that package to be not installed. Therefore, apt-get will cease stumbling on the defective package entry: You can now do other apt-get operations, and reinstall the problem package (overwriting its installed files) at any future occasion, at your leisure.
If you wish to fix errors in a package’s installation scripts, they’re in /var/lib/dpkg/info as packagename.postinst, packagename.preinst, packagename.prerm, and/or packagename.postrm. Debug the error, edit the script, and then re-run dpkg -i packagename. (This approach is greatly to be preferred over using —force-something options or editing the package database directly.)
Forum rules
Before you post please read how to get help. Topics in this forum are automatically closed 6 months after creation.
-
tompat
- Level 1
- Posts: 10
- Joined: Sun Nov 22, 2020 2:39 pm
<SOLVED> dpkg: error processing archive
Hi,
Im using a program from software manager called Wsjtx v2.1.2 (amateur radio SW).
I have installed a new build from https://www.physics.princeton.edu/pulsa … wsjtx.html called wsjtx_2.3.0-rc1_amd64.deb and then going back to v2.1.2 again.
Now when Im trying to install wsjtx_2.3.0-rc2_amd64.deb there is an error and I cant run it!?
Code: Select all
$ sudo dpkg -i wsjtx_2.3.0-rc2_amd64.deb
(Reading database ... 420196 files and directories currently installed.)
Preparing to unpack wsjtx_2.3.0-rc2_amd64.deb ...
Unpacking wsjtx (2.3.0-rc2) over (2.1.2+repack-2build1) ...
dpkg: error processing archive wsjtx_2.3.0-rc2_amd64.deb (--install):
trying to overwrite '/usr/share/pixmaps/wsjtx_icon.png', which is also in package wsjtx-data 2.1.2+repack-2build1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for desktop-file-utils (0.24+linuxmint1) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for man-db (2.9.1-1) ...
Errors were encountered while processing:
wsjtx_2.3.0-rc2_amd64.deb
any help on this is very much apritiated
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
-
Larry78723
- Level 14
- Posts: 5481
- Joined: Wed Jan 09, 2019 7:01 pm
- Location: Jasper County, SC, USA
Re: dpkg: error processing archive
Post
by Larry78723 » Sun Nov 22, 2020 3:38 pm
Please post the results of the following command:
If you have found the solution to your initial post, please open your original post, click on the pencil, and add (Solved) to the Subject, it helps other users looking for help, and keeps the forum clean.
-
tompat
- Level 1
- Posts: 10
- Joined: Sun Nov 22, 2020 2:39 pm
Re: dpkg: error processing archive
Post
by tompat » Sun Nov 22, 2020 5:23 pm
Thanks, here it is;
Code: Select all
$ inxi -Sr
System: Host: amd Kernel: 5.8.0-28-generic x86_64 bits: 64 Desktop: Cinnamon 4.6.7 Distro: Linux Mint 20 Ulyana
Repos: No active apt repos in: /etc/apt/sources.list
Active apt repos in: /etc/apt/sources.list.d/additional-repositories.list
1: deb http://apt.piduino.org stretch piduino
Active apt repos in: /etc/apt/sources.list.d/brave-browser-release.list
1: deb [arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main
Active apt repos in: /etc/apt/sources.list.d/microsoft-prod.list
1: deb [arch=amd64] https://packages.microsoft.com/ubuntu/20.04/prod focal main
Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list
1: deb http://ftp.acc.umu.se/mirror/linuxmint.com/packages ulyana main upstream import backport
2: deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
3: deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
4: deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
5: deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
6: deb http://archive.canonical.com/ubuntu/ focal partner
-
Larry78723
- Level 14
- Posts: 5481
- Joined: Wed Jan 09, 2019 7:01 pm
- Location: Jasper County, SC, USA
Re: dpkg: error processing archive
Post
by Larry78723 » Sun Nov 22, 2020 5:30 pm
It’s very possible that they haven’t updated their .debs to support python3 yet. That is what’s changed since Mint 19.x.
If you have found the solution to your initial post, please open your original post, click on the pencil, and add (Solved) to the Subject, it helps other users looking for help, and keeps the forum clean.
-
MartyMint
- Level 7
- Posts: 1728
- Joined: Thu Dec 27, 2012 10:50 pm
Re: dpkg: error processing archive
Post
by MartyMint » Sun Nov 22, 2020 5:46 pm
Larry78723 wrote: ↑
Sun Nov 22, 2020 5:30 pm
It’s very possible that they haven’t updated their .debs to support python3 yet. That is what’s changed since Mint 19.x.
I would agree. Either wait a week or so, or contact the maintainers to see if they’re still active.
-
tompat
- Level 1
- Posts: 10
- Joined: Sun Nov 22, 2020 2:39 pm
Re: dpkg: error processing archive
Post
by tompat » Mon Nov 23, 2020 3:49 am
Ok, thanks for the info Ill try to check!
Just curious, if they build for ubuntu 20.04 as stated, isn’t mint using the same as in 20.04?
-
Larry78723
- Level 14
- Posts: 5481
- Joined: Wed Jan 09, 2019 7:01 pm
- Location: Jasper County, SC, USA
Re: dpkg: error processing archive
Post
by Larry78723 » Mon Nov 23, 2020 7:03 am
Yes, if they build for Ubuntu 20.04 it will be usable for LM20.
If you have found the solution to your initial post, please open your original post, click on the pencil, and add (Solved) to the Subject, it helps other users looking for help, and keeps the forum clean.
-
tompat
- Level 1
- Posts: 10
- Joined: Sun Nov 22, 2020 2:39 pm
Re: dpkg: error processing archive
Post
by tompat » Mon Nov 23, 2020 8:36 am
Installation on ubuntu 20.04 worked without any problems!?
Code: Select all
$ sudo dpkg -i wsjtx_2.3.0-rc2_amd64.deb
(Reading database ... 189458 files and directories currently installed.)
Preparing to unpack wsjtx_2.3.0-rc2_amd64.deb ...
Unpacking wsjtx (2.3.0-rc2) over (2.3.0-rc2) ...
Setting up wsjtx (2.3.0-rc2) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for man-db (2.9.1-1) ...
-
Larry78723
- Level 14
- Posts: 5481
- Joined: Wed Jan 09, 2019 7:01 pm
- Location: Jasper County, SC, USA
Re: dpkg: error processing archive
Post
by Larry78723 » Mon Nov 23, 2020 8:52 am
In LM20, you might have to uninstall the 2.1.2+repack-2build1 before installing the new version.
If you have found the solution to your initial post, please open your original post, click on the pencil, and add (Solved) to the Subject, it helps other users looking for help, and keeps the forum clean.
Trying to install NodeJS 16 on ubuntu 22.04.
Ran the official installation instructions:
sudo apt-get install -y nodejs
Got the following error:
The following NEW packages will be installed:
nodejs
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
Need to get 0 B/27.1 MB of archives.
After this operation, 128 MB of additional disk space will be used.
Selecting previously unselected package nodejs.
(Reading database ... 218989 files and directories currently installed.)
Preparing to unpack .../nodejs_16.17.0-deb-1nodesource1_amd64.deb ...
Unpacking nodejs (16.17.0-deb-1nodesource1) ...
dpkg: error processing archive /var/cache/apt/archives/nodejs_16.17.0-deb-1nodesource1_amd64.deb (--unpack):
trying to overwrite '/usr/include/node/common.gypi', which is also in package libnode-dev 12.22.9~dfsg-1ubuntu3
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/nodejs_16.17.0-deb-1nodesource1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
tripleee
170k31 gold badges261 silver badges305 bronze badges
asked Sep 13, 2022 at 6:41
4
Various versions of Node.js are using a same file (one from apt install, one from manually download), which caused the conflict, resulting the error.
Remove your Node.js 12.22.9 first.
answered Sep 13, 2022 at 6:48
Geno ChenGeno Chen
4,6576 gold badges22 silver badges39 bronze badges
5
Trying to upgrade nodejs on ubuntu 20.10.
Ran the official installation instructions:
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
Got the following error:
The following packages will be upgraded:
nodejs
1 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
1 not fully installed or removed.
Need to get 0 B/24.5 MB of archives.
After this operation, 119 MB of additional disk space will be used.
(Reading database ... 277425 files and directories currently installed.)
Preparing to unpack .../nodejs_14.15.4-deb-1nodesource1_amd64.deb ...
Unpacking nodejs (14.15.4-deb-1nodesource1) over (12.18.2~dfsg-1ubuntu2) ...
dpkg: error processing archive /var/cache/apt/archives/nodejs_14.15.4-deb-1nodesource1_amd64.deb (--unpack):
trying to overwrite '/usr/share/doc/nodejs/api/dgram.json.gz', which is also in package nodejs-doc 12.18.2~dfsg-1ubuntu2
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/nodejs_14.15.4-deb-1nodesource1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I’ve looked at other StackOverflow answers recommending that I either try to uninstall nodejs-doc (the conflicting dependency) or to run the following command:
sudo dpkg -i --force-overwrite /usr/share/doc/nodejs/api/dgram.json.gz
Neither seemed to work. In the case of the above command, it said that the file needed to be a deb package — and anyway, I’m a little skeptical about that strategy as it could break my setup.
For attempting to removing nodejs-doc, I got the following output:
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
nodejs : Depends: libnode72 (= 12.18.2~dfsg-1ubuntu2) but it is not going to be installed
Recommends: nodejs-doc but it is not going to be installed
I’ve also tried running the recommended apt --fix-broken install but it doesn’t seem to help.








