Scoop: Feature Request: breakpoint-resume install

Created on 12 Feb 2020  ·  1Comment  ·  Source: lukesampson/scoop

When install big packages in a slow network environment, the download often breaks by slow network, when execute the install command the next time, scoop should resume the download from the breakpoint of last download.

The behavior now is not good, as scoop treate a download failed package as installed.
below is an example.

~ $ scoop install dotnet-sdk
Installing 'dotnet-sdk' (3.1.101) [64bit]
dotnet-sdk-3.1.101-win-x64.zip (153.3 MB) [>                                                                  ]   1%
操作已超时。(Timeout)
URL https://dotnetcli.blob.core.windows.net/dotnet/Sdk/3.1.101/dotnet-sdk-3.1.101-win-x64.zip is not valid
~ $ scoop install dotnet-sdk
ERROR It looks like a previous installation of dotnet-sdk failed.
Run 'scoop uninstall dotnet-sdk' before retrying the install.
WARN  'dotnet-sdk' () is already installed.
Use 'scoop update dotnet-sdk' to install a new version.
~ $ scoop update dotnet-sdk
dotnet-sdk:  (latest version)
Latest versions for all apps are installed! For more information try 'scoop status'

Most helpful comment

Yes, this is quite a nuisance as how it is handled right now. My current solution is use aria2, and if the download is interrupted, manually use aria2c to resume the download and then resume the install or update process.

for example, when I encounter an install/update failure with aria2 enabled with the following message:

ERROR Download failed! (Error 22) HTTP response header was bad or unexpected
ERROR https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/FiraCode.zip
    referer=https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/
    dir=C:\Users\xxx\scoop\cache
    out=FiraCode-NF#2.1.0#https_github.com_ryanoasis_nerd-fonts_releases_download_v2.1.0_FiraCode.zip

I'll just do the following to resume the download of the installation file to the cache directory:

cd C:\Users\xxx\scoop\cache
aria2c https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/FiraCode.zip -o FiraCode-NF#2.1.0#https_github.com_ryanoasis_nerd-fonts_releases_download_v2.1.0_FiraCode.zip

With the installation file ready in the cache directory, you can then try force update over a broken installation with the -f switch, or just uninstall the broken installation first and try install again. As long as the downloaded installation file still exists in the cache directory, the installation will not try to download it again. Updating is not affected by this quirk and I can just run scoop update * after manually completing the broken installation file download to resume the full update process.

It's basically the only way for me to install/update large-sized applications with scoop with an unstable connection. I do think it needs some improvement for scoop to be able to auto-resume broken downloads, especially when aria2 is enabled.

Currently if the last aria2 download failed at 99%, and you don't do the installation file download manually, the scoop install/update command will complain that the cached download has bad hash and delete the whole thing, forcing you to download the whole thing from the start again, somehow defeating one of the major purpose of the aria2 features.

>All comments

Yes, this is quite a nuisance as how it is handled right now. My current solution is use aria2, and if the download is interrupted, manually use aria2c to resume the download and then resume the install or update process.

for example, when I encounter an install/update failure with aria2 enabled with the following message:

ERROR Download failed! (Error 22) HTTP response header was bad or unexpected
ERROR https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/FiraCode.zip
    referer=https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/
    dir=C:\Users\xxx\scoop\cache
    out=FiraCode-NF#2.1.0#https_github.com_ryanoasis_nerd-fonts_releases_download_v2.1.0_FiraCode.zip

I'll just do the following to resume the download of the installation file to the cache directory:

cd C:\Users\xxx\scoop\cache
aria2c https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/FiraCode.zip -o FiraCode-NF#2.1.0#https_github.com_ryanoasis_nerd-fonts_releases_download_v2.1.0_FiraCode.zip

With the installation file ready in the cache directory, you can then try force update over a broken installation with the -f switch, or just uninstall the broken installation first and try install again. As long as the downloaded installation file still exists in the cache directory, the installation will not try to download it again. Updating is not affected by this quirk and I can just run scoop update * after manually completing the broken installation file download to resume the full update process.

It's basically the only way for me to install/update large-sized applications with scoop with an unstable connection. I do think it needs some improvement for scoop to be able to auto-resume broken downloads, especially when aria2 is enabled.

Currently if the last aria2 download failed at 99%, and you don't do the installation file download manually, the scoop install/update command will complain that the cached download has bad hash and delete the whole thing, forcing you to download the whole thing from the start again, somehow defeating one of the major purpose of the aria2 features.

Was this page helpful?
0 / 5 - 0 ratings