Score:0

How to install rclone in Ubuntu without root?

jp flag

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
ChanganAuto avatar
us flag
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.
Kong avatar
jp flag
@ChanganAuto so what should I do? What is the solution? What must I type?
ChanganAuto avatar
us flag
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.
24601 avatar
in flag
isn't `rclone` simply installable from the ubuntu software center or have I missed the point of your question?
Score:2
cn flag

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.

user408108 avatar
ls flag
"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?
vanadium avatar
cn flag
`sudo cp rclone /usr/bin/` -> `cp rclone ~/.local/bin`
vanadium avatar
cn flag
@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`
user408108 avatar
ls flag
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.
vanadium avatar
cn flag
Thanks for the feedback. Some `mandb` command will be needed to tell man where to find the manual.
ru111 avatar
hm flag
If not already in PATH remember to add `~/.local/bin` to path.
vanadium avatar
cn flag
@ru111 on Ubuntu, this is automatically done on your next login
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.