tldr-pages / tldr-c-client

C command-line client for tldr pages
MIT License
296 stars 49 forks source link

Bash on Ubuntu on Windows - TLDR update command fails #33

Closed j86989 closed 1 year ago

j86989 commented 6 years ago

Reproduction Rate

I could reproduce the issue each time I tried to update TLDR local database.

Steps to Reproduce

  1. Install Windows Subsystem for Linux.
  2. Install Ubuntu on Windows.
  3. Run Bash on Ubuntu on Windows.
  4. Install linuxbrew. There is installation instruction on http://linuxbrew.sh.
  5. Install TLDR C++ client: brew update and brew install tldr.
  6. Try to update TLDR local database: tldr --update.

Result

$ tldr --update
Error: Could Not Rename: /tmp/tldrElmG3W/tldr-master to /mnt/d/joachim/.tldrc/tldr-master/

Expected Result

Update of TLDR local database.

Additional Information

Windows Subsystem for Linux, Bash on Ubuntu on Windows TLDR C++ has been installed with linuxbrew

I have tried to update TLDR as superuser:

$ sudo tldr --update
[sudo] password for joachim:

There is no error message when I update TLDR as superuser but I'm still unable to print any TLDR page. Each attempt ends with This page doesn't exist yet! error message.

danimo commented 6 years ago

The rename() function does not work across file system boundaries. If your $HOME is mounted seperately OR /tmp is a tmpfs, you will see above error. This means tldr will only work successfully in trivial installations, and practically none of the modern Linux distros.

A fix would be to back up with a recursive copy-then-remove if rename() fails, or just use that in all cases.

SethFalco commented 1 year ago

Closing as a duplicate of the following:

Progress on this has been made by a contributor here: