u dont need to deleted home/USER/.local/solana/install or something, just delete home/USER/.cache/solana and u can build or test the anchor program
home/USER/.local/solana/install
home/USER/.cache/solana
This case occurs because there is a download/extract/build error in the anchor build/test process