fd icon indicating copy to clipboard operation
fd copied to clipboard

sudo is added to README.md for some CentOS installation lines

Open mperov opened this issue 3 years ago • 10 comments

$ sudo chown -R root:root fd-v8.3.2-x86_64-unknown-linux-gnu/
$ cd fd-v8.3.2-x86_64-unknown-linux-gnu/
$ sudo cp fd /bin
$ gzip fd.1
gzip: fd.1.gz: Permission denied
$ chown root:root fd.1.gz
chown: changing ownership of `fd.1.gz`: Operation not permitted

mperov avatar Apr 13 '22 15:04 mperov

I think the initial chown -R root:root is complicating everything. This should work fine, though I didn't test it:

tar xf fd-v*-x86_64-unknown-linux-gnu.tar.gz
cd fd-v*-x86_64-unknown-linux-gnu
sudo cp fd /bin
gzip fd.1
sudo cp fd.1.gz /usr/share/man/man1
sudo cp autocomplete/fd.bash /usr/share/bash-completion/completions/fd
source /usr/share/bash-completion/completions/fd
fd

sudo cp will create a copy owned by root.

tavianator avatar Apr 13 '22 15:04 tavianator

@tavianator hello! Yeah, I agree, deleting chown -R root:root is more good solution!

mperov avatar Apr 13 '22 15:04 mperov

@mperov Do you want to update the PR to the proposed solution (assuming it has been tested)?

sharkdp avatar Apr 18 '22 09:04 sharkdp

@sharkdp yes, of course! But I need some time because now I'm so busy....

mperov avatar Apr 18 '22 09:04 mperov

Hi @sharkdp! I've done!

mperov avatar Apr 25 '22 12:04 mperov

Do you need the sudo su? I think the recipe I gave in https://github.com/sharkdp/fd/pull/1002#issuecomment-1098192088 should work fine with fewer commands run as root.

If you do need it, sudo -i is a bit better than sudo su

tavianator avatar Apr 25 '22 14:04 tavianator

@tavianator sudo su is needed to decrease count of sudo in steps. Of course, sudo su and sudo -i are equal. However, for me sudo su is more familiar. Should I change it to you accept my PR?

Your solution doesn't set root owner for files. In system directories files should have root owner.

mperov avatar Apr 25 '22 15:04 mperov

Your solution doesn't set root owner for files

It does, because of sudo cp

tavianator avatar May 18 '22 14:05 tavianator

Hello @tavianator I removed sudo su and add sudo only to copy to the system directories like you recommended.

mperov avatar Aug 16 '22 18:08 mperov

Thank you very much for your contribution!

Can we maybe merge the two almost-identical sections? Do we really need the GNU version on one OS and musl on the other? Or is that an entirely independent discussion?

sharkdp avatar Sep 11 '22 18:09 sharkdp

I'm closing this due to inactivity. Please feel free to comment in case it should be re-opened.

sharkdp avatar Oct 31 '22 21:10 sharkdp