DPKG error when trying to install from apt-get

26 views
Skip to first unread message

Ruben V

unread,
Sep 9, 2017, 12:06:49 AM9/9/17
to ack users
when I try to install ack-grep using 
sudo apt install ack-grep

I get the following error:

Selecting previously unselected package ack-grep.
Preparing to unpack .../ack-grep_2.14-4_all.deb ...
Unpacking ack-grep (2.14-4) ...
dpkg
: error processing archive /var/cache/apt/archives/ack-grep_2.14-4_all.deb (--unpack):
 trying to overwrite
'/usr/bin/ack', which is the diverted version of '/usr/bin/ack-grep'
Processing triggers for man-db (2.7.5-1) ...
Errors were encountered while processing:
 
/var/cache/apt/archives/ack-grep_2.14-4_all.deb
E
: Sub-process /usr/bin/dpkg returned an error code (1)

How can I fix this?  I have ack-grep install via a bash script that executes the dpkg diversion command eventhough the package doesn't install. Not sure if that's helpful.

Andy Lester

unread,
Sep 9, 2017, 12:12:37 AM9/9/17
to ack-...@googlegroups.com

> On Sep 8, 2017, at 10:48 PM, Ruben V <rubena...@gmail.com> wrote:
>
> Selecting previously unselected package ack-grep.
> Preparing to unpack .../ack-grep_2.14-4_all.deb ...
> Unpacking ack-grep (2.14-4) ...
> dpkg: error processing archive /var/cache/apt/archives/ack-grep_2.14-4_all.deb (--unpack):
> trying to overwrite '/usr/bin/ack', which is the diverted version of '/usr/bin/ack-grep'
> Processing triggers for man-db (2.7.5-1) ...
> Errors were encountered while processing:
> /var/cache/apt/archives/ack-grep_2.14-4_all.deb
> E: Sub-process /usr/bin/dpkg returned an error code (1)
>
> How can I fix this? I have ack-grep install via a bash script that executes the dpkg diversion command eventhough the package doesn't install. Not sure if that's helpful.
>
>

I can't answer directly, because even though I'm the author of ack, I don't have anything to do with the packaging.

I can tell you that when ack was first released, there was already a package called ack (some sort of Japanese translation software I think) and so they called it ack-grep. Then they got rid of the old ack package, and started calling it ack instead of ack-grep. And I'm guessing that there's a problem that has come out of that.

I Googled for "dpkg: error processing archive ack ack-grep" and turned up this Q&A on askubuntu.com that seems to be about the same problem you are having, from what little I know of the Debian-related package managers. https://askubuntu.com/questions/562623/upgrade-a-diverted-package-dpkg-error

I hope that helps. Please let me know whether it does or not. If it does, then I will make a note of it on the install page for beyondgrep.com.

Thanks,
Andy


--
Andy Lester => www.petdance.com

Ruben V

unread,
Dec 5, 2017, 8:04:34 PM12/5/17
to ack users
I was having the same error message although my process was a little different... I think. I had previously installed or uninstalled or directly applied the diversion command. Anyways, I had the diversion without having ack-grep installed. Following the askubuntu tip I un-diverted using
dpkg-divert --package ack-grep --local --remove --rename --divert /usr/bin/ack /usr/bin/ack-grep
then used apt to reinstall. There's no need to directly run the dpkg-divert command as of version 2.14-4.
Reply all
Reply to author
Forward
0 new messages