Can't write to a hidden path using Curl

Solution 1:

Weirdly and coincidentally I had exactly the same problem as you. Not only with curl, but with Vim and plug at the same time. Small world.

My guess to fix this was that it was a problem with the curl that I was using.

I had installed curl from the snap store:

sudo snap install curl

I then got the same error message as you:

$ curl -fLo ~/.vim/autoload/plug.vim --create-dirs     https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
Error creating directory /home/ian/.vim/autoload.
curl: (23) Failed writing received data to disk/application

My fix was to remove the snap curl and install the basic apt curl:

$ sudo snap remove curl
$ sudo apt install curl

and voila...

$ curl -fLo ~/.vim/autoload/plug.vim --create-dirs     https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 82784  100 82784    0     0   612k      0 --:--:-- --:--:-- --:--:--  612k