bat: Ubuntu install error when rg is installed also
Running Ubuntu 20.04:
$ sudo apt install bat ripgrep
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libgit2-28 libhttp-parser2.9 libmbedcrypto3 libmbedtls12 libmbedx509-0
libssh2-1
The following NEW packages will be installed:
bat libgit2-28 libhttp-parser2.9 libmbedcrypto3 libmbedtls12 libmbedx509-0
libssh2-1 ripgrep
0 to upgrade, 8 to newly install, 0 to remove and 1 not to upgrade.
Need to get 1,228 kB/3,577 kB of archives.
After this operation, 11.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://au.archive.ubuntu.com/ubuntu focal/universe amd64 ripgrep amd64 11.0.2-1build1 [1,228 kB]
Fetched 1,228 kB in 0s (2,731 kB/s)
INFO Requesting to save current system state
Successfully saved as "autozsys_j4dqft"
Selecting previously unselected package libhttp-parser2.9:amd64.
(Reading database ... 225178 files and directories currently installed.)
Preparing to unpack .../0-libhttp-parser2.9_2.9.2-2_amd64.deb ...
Unpacking libhttp-parser2.9:amd64 (2.9.2-2) ...
Selecting previously unselected package libmbedcrypto3:amd64.
Preparing to unpack .../1-libmbedcrypto3_2.16.4-1ubuntu2_amd64.deb ...
Unpacking libmbedcrypto3:amd64 (2.16.4-1ubuntu2) ...
Selecting previously unselected package libmbedx509-0:amd64.
Preparing to unpack .../2-libmbedx509-0_2.16.4-1ubuntu2_amd64.deb ...
Unpacking libmbedx509-0:amd64 (2.16.4-1ubuntu2) ...
Selecting previously unselected package libmbedtls12:amd64.
Preparing to unpack .../3-libmbedtls12_2.16.4-1ubuntu2_amd64.deb ...
Unpacking libmbedtls12:amd64 (2.16.4-1ubuntu2) ...
Selecting previously unselected package libssh2-1:amd64.
Preparing to unpack .../4-libssh2-1_1.8.0-2.1build1_amd64.deb ...
Unpacking libssh2-1:amd64 (1.8.0-2.1build1) ...
Selecting previously unselected package libgit2-28:amd64.
Preparing to unpack .../5-libgit2-28_0.28.4+dfsg.1-2_amd64.deb ...
Unpacking libgit2-28:amd64 (0.28.4+dfsg.1-2) ...
Preparing to unpack .../6-bat_0.12.1-1build1_amd64.deb ...
Unpacking bat (0.12.1-1build1) ...
Selecting previously unselected package ripgrep.
Preparing to unpack .../7-ripgrep_11.0.2-1build1_amd64.deb ...
Unpacking ripgrep (11.0.2-1build1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-8eoEcZ/7-ripgrep_11.0.2-1bu
ild1_amd64.deb (--unpack):
trying to overwrite '/usr/.crates2.json', which is also in package bat 0.12.1-1
build1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/tmp/apt-dpkg-install-8eoEcZ/7-ripgrep_11.0.2-1build1_amd64.deb
INFO Updating GRUB menu
E: Sub-process /usr/bin/dpkg returned an error code (1)
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 50
- Comments: 18 (7 by maintainers)
As a workaround, one can use
sudo apt install -o Dpkg::Options::="--force-overwrite" bat ripgrep(taken from https://askubuntu.com/a/491086).Another workaround:
Using a fresh install of Ubuntu 20.04, I can confirm that it’s still an issue.
Since 20.04 is a LTS release, I think it would be a good idea to reopen this until we find out whether or not there are any plans to fix it for that version.
That worked.
Let me take this opportunity to thank you for these amazing and exciting tools. They are really shiny and very inspiring.
@paride Only if you find the time: could you shed some light on whether the fix for Ubuntu bug #1868517 (Stray /usr/.crates2.json file) could be backported/applied for 20.04 as well?
Thank you!
It would be a shame if every 20.04 user could only install one out of ~16 Rust packages.
@sharkdp I know, that’s unfortunate, especially given that the bug was filed late in the cycle but before releasing Focal. I’ll try to get to it.
I’m pretty sure it cannot cause this conflict, because you would build
batas a user which wouldn’t even be allowed to write to the/usr/folder. You could also install one of the Debian packages from the release page (https://github.com/sharkdp/bat/releases). That should also work.Thank you for reporting this.
This is a problem of the package itself. I don’t think there is anything we can do here.
Looks like the bug has already been reported on the Ubuntu issue tracker: https://bugs.launchpad.net/ubuntu/+source/rust-bat/+bug/1868517
Thanks. I’m closing this for now, even though there are certainly a lot of 20.04 users that might encounter this.
This is fixed in 20.10 already (so yes, also in 21.04).
I’m still getting this error when trying to install
bat:cThe upstream status has changed to “fix released” for
ripgrepand “fix commited” forbat. So I would assume thatbatandripgrepcan now be installed at the same time (even though the fix forbatitself has not been released).I’m closing this for now, but happy to re-open if this can not be confirmed.