Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu install error when rg is installed also #938

Closed
SamuelMarks opened this issue Apr 23, 2020 · 18 comments
Closed

Ubuntu install error when rg is installed also #938

SamuelMarks opened this issue Apr 23, 2020 · 18 comments
Labels
bug Something isn't working packaging/tooling

Comments

@SamuelMarks
Copy link

SamuelMarks commented Apr 23, 2020

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)
@SamuelMarks SamuelMarks added the bug Something isn't working label Apr 23, 2020
@SamuelMarks SamuelMarks changed the title Ubuntu install error when rg is running Ubuntu install error when rg is installed also Apr 23, 2020
@sharkdp
Copy link
Owner

sharkdp commented Apr 23, 2020

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

@sharkdp sharkdp pinned this issue Apr 23, 2020
@manaskarekar
Copy link

I'm also affected by this issue. Haven't looked into the workings, but I wonder if building locally also causes this conflict.

@sharkdp
Copy link
Owner

sharkdp commented Apr 25, 2020

I wonder if building locally also causes this conflict.

I'm pretty sure it cannot cause this conflict, because you would build bat as 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.

@manaskarekar
Copy link

install one of the Debian packages from the release page (https://github.com/sharkdp/bat/releases).

That worked.

Let me take this opportunity to thank you for these amazing and exciting tools. They are really shiny and very inspiring.

@sharkdp
Copy link
Owner

sharkdp commented Apr 25, 2020

Let me take this opportunity to thank you for these amazing and exciting tools. They are really shiny and very inspiring.

Thank you for the feedback!

@sharkdp sharkdp unpinned this issue Apr 27, 2020
@sharkdp
Copy link
Owner

sharkdp commented May 11, 2020

The upstream status has changed to "fix released" for ripgrep and "fix commited" for bat. So I would assume that bat and ripgrep can now be installed at the same time (even though the fix for bat itself has not been released).

I'm closing this for now, but happy to re-open if this can not be confirmed.

@sharkdp sharkdp closed this as completed May 11, 2020
@qstrahl
Copy link

qstrahl commented May 14, 2020

I'm still getting this error when trying to install bat :c

@marcelgerber
Copy link

I think the issue here is that it has been fixed in the Ubuntu 20.10 (groovy) repository, but not in the earlier 20.04 or earlier ones.
I don't know if these fixes are meant to be brought to those versions too, but I very much hope so!

@eth-p
Copy link
Collaborator

eth-p commented May 14, 2020

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.

@eth-p eth-p reopened this May 14, 2020
@sharkdp
Copy link
Owner

sharkdp commented May 15, 2020

@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.

@paride
Copy link

paride commented May 17, 2020

@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.

@psicho2000
Copy link

psicho2000 commented Jun 19, 2020

As a workaround, one can use
sudo apt install -o Dpkg::Options::="--force-overwrite" bat ripgrep
(taken from https://askubuntu.com/a/491086).

@foreverLoveWisdom
Copy link

Any news for this issue? I have just got this problem today on POP 20.04

@DmitrySandalov
Copy link

Another workaround:

sudo apt install ripgrep
sudo sed -i '/\/usr\/.crates2.json/d' /var/lib/dpkg/info/ripgrep.list
sudo apt install bat
sudo ln -s batcat /usr/bin/bat

@sharkdp
Copy link
Owner

sharkdp commented May 13, 2021

Can someone please confirm that this has been fixed in 21.04?

@paride
Copy link

paride commented May 13, 2021

This is fixed in 20.10 already (so yes, also in 21.04).

@sharkdp
Copy link
Owner

sharkdp commented May 13, 2021

Thanks. I'm closing this for now, even though there are certainly a lot of 20.04 users that might encounter this.

@sharkdp sharkdp closed this as completed May 13, 2021
@Searge
Copy link

Searge commented Apr 22, 2022

As a workaround, one can use sudo apt install -o Dpkg::Options::="--force-overwrite" bat ripgrep (taken from https://askubuntu.com/a/491086).

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working packaging/tooling
Projects
None yet
Development

No branches or pull requests