0

I read from https://unix.stackexchange.com/questions/638885/onedrive-on-linux-without-root that I can install rclone without root by following https://rclone.org/install/#linux-installation-from-precompiled-binary

I ran the 1st 3 lines

curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip
unzip rclone-current-linux-amd64.zip
cd rclone-*-linux-amd64

but the rest still require sudo. How should I proceed?

Copy binary file

sudo cp rclone /usr/bin/
sudo chown root:root /usr/bin/rclone
sudo chmod 755 /usr/bin/rclone

Install manpage

sudo mkdir -p /usr/local/share/man/man1
sudo cp rclone.1 /usr/local/share/man/man1/
sudo mandb 

Run rclone config to setup. See rclone config docs for more details.

rclone config
Kong
  • 1,151
  • 7
  • 32
  • 60
  • Debian/Ubuntu don't use root account by default. Instead elevated privileges are requested with sudo. There's a comment under the question you linked asking for clatification and this suggests that OP is confused. – ChanganAuto Aug 12 '21 at 10:28
  • @ChanganAuto so what should I do? What is the solution? What must I type? – Kong Aug 12 '21 at 10:51
  • 1
    Like in the linked question, I think you're confusing use with installation. Many or most programs run with the regular user(s) but that doesn't mean they can be installed without privileges. If you don't have sudo privileges on the machine you can't install software. – ChanganAuto Aug 12 '21 at 10:54
  • isn't `rclone` simply installable from the ubuntu software center or have I missed the point of your question? – graham Aug 12 '21 at 11:52

1 Answers1

5

Leave out the sudo and change /usr/bin to ~/.local/bin, and /usr/local/share/man by ~/.local/share/man. Create these folders first if you do not already have them.

This installs rclone in your own home folder, not requiring you to be root.

Thus, the commands to install the binary and man page become:

cp rclone ~/.local/bin
chmod +x ~/.local/bin/rclone
cp rclone.1 ~/.local/share/man/man1/

Note that the command, installed this way, will be available only to you, not to other users on the system. To install software for any user of the system, you need to be root, i.e., administrator. There is no way around this.

Lorenz Keel
  • 8,362
  • 8
  • 36
  • 49
vanadium
  • 82,909
  • 6
  • 116
  • 186
  • "change /usr/bin to ~/local/bin, and /usr/local/share/man by .local/share/man" : Can you please let me know where are we supposed to make these changes? – user408108 Nov 30 '21 at 13:08
  • `sudo cp rclone /usr/bin/` -> `cp rclone ~/.local/bin` – vanadium Nov 30 '21 at 13:45
  • 1
    @user408108 I added the adapted commands. Log out then back in for this to work if you did not yet have the extra folders. Let me know if `man rclone`works without any further intervention (i.e., I think there may be no need to run `mandb` – vanadium Nov 30 '21 at 13:54
  • Thank you very much for providing the adapted commands. I have successfully installed rclone on remote server without root permissions. I have also setup sync with OneDrive Business and it is working as expected. The command 'man rclone' is not working. The message "No manual entry for rclone" is shown. – user408108 Nov 30 '21 at 15:20
  • Thanks for the feedback. Some `mandb` command will be needed to tell man where to find the manual. – vanadium Nov 30 '21 at 16:00
  • If not already in PATH remember to add `~/.local/bin` to path. – ru111 Jan 20 '23 at 21:34
  • @ru111 on Ubuntu, this is automatically done on your next login – vanadium Jan 21 '23 at 11:50