Error installing nightly-aarch64-unknown-linux-gnu toolchain; how to install older version of nightly-aarch64-unknown-linux-gnu?

Hi all,
I ran rustup update, and since then my nightly-aarch64-unknown-linux-gnu toolchain is no longer working.

Rustup is now unable to show the rustc version for the toolchain,
and rustc returns the error:

/home/notplants/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/bin/rustc: 1: /home/notplants/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/bin/rustc: ELF??: not found
/home/notplants/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/bin/rustc: 1: /home/notplants/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/bin/rustc: Syntax error: Unterminated quoted string

I'm wondering if anyone knows what the issue could be?

Or, failing that, I'm wondering what command I can use to install an older version of nightly-aarch64-unknown-linux-gnu -- I can't seem to find a command for that, or a website where there is a list of the older builds.

For reference, here is the output I get when I run rustup update:

$ rustup update
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'nightly-aarch64-unknown-linux-gnu'
info: checking for self-updates

    stable-x86_64-unknown-linux-gnu unchanged - rustc 1.48.0 (7eac88abb 2020-11-16)
    nightly-aarch64-unknown-linux-gnu unchanged - (error reading rustc version)

info: cleaning up downloads & tmp directories

thanks for any help

You can install a specific nightly version by specifying the date:

rustup install nightly-2020-10-14-aarch64-unknown-linux-gnu

And you can use it with Cargo like

cargo +nightly-2020-10-14 build
1 Like

thank you for this!

this is good to know even though it didn't seem to solve my issue

somehow even when I completely uninstall rust, and reinstall it, I get this same error when trying to use aarch64-unknown-linux-gnu

ok I've figured out my own problem! in case anyone runs into this

running rustup default nightly-aarch64-unknown-linux-gnu was the problem.

I am cross-compiling for aarch64, but the platform I'm on is x86_64, so maybe rust doesn't like having nightly-aarch64-unknown-linux-gnu as the default.

I can use a different toolchain as the default, and then I can still cross-compile for nightly-aarch64-unknown-linux-gnu.

In code:

rustup toolchain install nightly-aarch64-unknown-linux-gnu
rustup default stable
cargo build --release --target=aarch64-unknown-linux-gnu

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.