Can not update registry because download fails for "unexpected end of data"

When I try to install a package or update, package manager errors because downloaded file is corrupted (I checked with 7-zip and it complains with unexpected end of data too). Contrasted to download failure, pkg errors out

(@v1.6) pkg> update
    Updating registry at `C:\Users\melonedo\.julia\registries\General`
ERROR: Unexpected end of data : jl_fq7ZoDFNdV-download
β”Œ Warning: could not download
β”” @ Pkg.Types C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Types.jl:1156
ERROR: "C:\\Users\\melonedo\\AppData\\Local\\Temp\\jl_04Dj01\\Registry.toml": No such file
  [1] error(::String, ::String)
    @ Base .\error.jl:42
  [2] readstring
    @ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\TOML\src\TOML.jl:21 [inlined]
 [19] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\REPL\src\REPL.jl:1126
 [20] (::REPL.var"#44#49"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL .\task.jl:411

julia> versioninfo()
Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)

What can I do to trouble shoot this?

1 Like

I meet ths same error.

i try to do:

] registry rm General
] registry add

then, ok.

1 Like

Actually it should be
registry add