I was downgrading and upgrading my Solana and anchor versions in order to deploy my programs to devnet. And while doing that after a time my anchor broke. I removed the rust and re-installed it and anchor but the problem is still there. This is what happens when I run anchor build.

BPF SDK: /home/a/.local/share/solana/install/releases/1.10.25/solana-release/bin/sdk/bpf

cargo-build-bpf child: rustup toolchain list -v

cargo-build-bpf child: rustup toolchain link bpf /home/a/.local/share/solana/install/releases/1.10.25/solana-release/bin/sdk/bpf/dependencies/bpf-tools/rust

cargo-build-bpf child: cargo +bpf build --target bpfel-unknown-unknown --release

error: process didn't exit successfully: rustc -vV (exit status: 127) --- stderr

/home/a/.rustup/toolchains/bpf/bin/rustc: error while loading shared libraries: librustc_driver-0a24654c7f10b1f7.so: cannot open shared object file: No such file or directory

  • The last time this happened, I had to reinstall Rust. I didn't look into the root cause tho.
    – sohrab
    Commented Sep 6, 2022 at 23:27
  • I did that, did not solve the problem for me
    – SolanaDev
    Commented Sep 7, 2022 at 3:55
  • I downgraded solana version to 1.10.10 and resinstalled rust and was able to fix this
    – SolanaDev
    Commented Sep 7, 2022 at 7:21

3 Answers 3


I was able to solve this, by uninstalling rust, reinstalling rust(1.61.0) and anchor (0.24.2)and downgrading solana from 1.11.10 to 1.10.10.


This worked for one user (biccsdev), instead of reinstalling both Rust and Anchor and downgrading Solana:

cargo update -p syn --precise 1.0.99; cargo update -p proc-macro2 --precise 1.0.43

What I did to fix mine was to use same version of solana cli for solana-program. When you setup an anchor project you don't have to add solana-program crate manually. But for some compatibility issues all you have to do is check your solana cli version, and update the solana-program crate version to that of the solana-cli version. There's no need to uninstall rust.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.