Can't upgrade dfx from command line

I’ve tried many times and keep getting this: Any suggestion would be appreciated.

Current version: 0.8.4
Fetching manifest https://sdk.dfinity.org/manifest.json
⠤ Checking for latest dfx version…
error sending request for url (https://sdk.dfinity.org/manifest.json): error trying to connect: tcp connect error: Connection refused (os error 111)

I do not know what’s going wrong, but simply running the install script again is safe and should update you to the latest version:

sh -ci "$(curl -fsSL https://smartcontracts.org/install.sh)"
1 Like

Thanks for your response. I had tried that and just now did again and same result. I’m running on windows - linus system.

sh -ci “$(curl -fsSL https://smartcontracts.org/install.sh)”
info: Executing dfx install script, commit: 809fab6d52fcf418536afe6c5e66a766e6c06c51
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:–:-- 0:00:01 --:–:-- 0
0 0 0 0 0 0 0 0 --:–:-- 0:00:02 --:–:-- 0
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
info: Version found:
info: Creating uninstall script in ~/.cache/dfinity
info: uninstall path=/home/free_will5/.cache/dfinity/uninstall.sh
info: Checking for latest release…
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
curl: (22) The requested URL returned error: 404
dfinity-sdk: command failed: downloader https://github.com/dfinity/sdk/releases/download//dfx--x86_64-linux.tar.gz /tmp/tmp.kP9shCeQSl/dfx–x86_64-linux.tar.gz

Just FYI: WSL causes a bunch of problems and we don’t recommend using WSL for now.

Anyways, we’re trying to run the script. IDK what exactly the problem is, but the script fails to fetch the current available versions, so $DFX_VERSION='', which produces a bad URL when fetching ${DFX_GITHUB_RELEASE_ROOT}/${DFX_VERSION}/${_dfx_tarball_filename} - this is why you get the bad downloader link.

To bypass this, you can manually pass the version string:

DFX_VERSION=0.11.2 sh -ci "$(curl -fsSL https://smartcontracts.org/install.sh)"

Does this work?

1 Like

Thanks so much. It worked!