sudo is added to README.md for some CentOS installation lines
$ 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
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 hello! Yeah, I agree, deleting chown -R root:root is more good solution!
@mperov Do you want to update the PR to the proposed solution (assuming it has been tested)?
@sharkdp yes, of course! But I need some time because now I'm so busy....
Hi @sharkdp! I've done!
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 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.
Your solution doesn't set root owner for files
It does, because of sudo cp
Hello @tavianator I removed sudo su and add sudo only to copy to the system directories like you recommended.
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?
I'm closing this due to inactivity. Please feel free to comment in case it should be re-opened.