Os error 13 code when upgrading to new version

Hey everybody just tried to upgrade to the new version but got the following error:

Io(
    Custom {
        kind: PermissionDenied,
        error: TarError {
            desc: "failed to unpack `/usr/local/bin/dfx`",
            io: Custom {
                kind: PermissionDenied,
                error: TarError {
                    desc: "failed to unpack `./dfx` into `/usr/local/bin/dfx`",
                    io: Os {
                        code: 13,
                        kind: PermissionDenied,
                        message: "Permission denied",
                    },
                },
            },
        },
    },
)

As you might have guessed this has to do with permissions around reading and writing to your files. Since it is not in the tutorial I just wanted to mention to beginners that you can fix this by putting

sudo

in front of the dfx upgrade command.

3 Likes