# Installing solana dev tools on M1 ## Remove existing installation ``` rm -rf /Users/USERNAME/.local/share/solana/ rustup self uninstall ``` ## Install rosetta We need to run a rosetta terminal, so first install rosetta ``` /usr/sbin/softwareupdate --install-rosetta --agree-to-license ``` ## Clone existing terminal app and enable rosetta Finder -> Applications -> Utilities -> Terminal Duplicate the terminal application and name it as Terminal Rosetta Right click on Terminal Rosetta -> Get Info -> Click Open using Rosetta ## Install Dependencies & Config Open up the terminal rosetta that we just created #### Download & Install Rust ``` curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` #### Install homebrew ``` arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" ``` #### Install OpenSSL ``` arch -x86_64 brew install openssl@1.1 ``` #### Setup rust config Create the file ~/.cargo/config and paste the following ``` [target.x86_64-apple-darwin] rustflags = [ "-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup", ] [target.aarch64-apple-darwin] rustflags = [ "-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup", ] ``` #### Install GreadLink ``` arch -arm64 brew install coreutils ``` ### Install solana ``` git clone https://github.com/solana-labs/solana.git cd solana cargo build ./scripts/cargo-install-all.sh . export PATH=$PWD/bin:$PATH ``` # Check installation worked Run the following and it should not error out ``` solana-test-validator ```