Last active
May 19, 2025 13:22
-
-
Save lmmx/3c8ee86a3b4de74fe3bc0215d552edfa to your computer and use it in GitHub Desktop.
Uninstall old Rust nightly versions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Keep the latest nightly and remove older dated nightlies | |
LATEST_DATE=$(rustup toolchain list | grep 'nightly-[0-9]' | sed 's/nightly-\([0-9-]*\).*/\1/' | sort -r | head -n 1) | |
# If we found dated nightlies, remove all except the most recent one | |
if [ -n "$LATEST_DATE" ]; then | |
for toolchain in $(rustup toolchain list | grep 'nightly-[0-9]' | grep -v "$LATEST_DATE"); do | |
echo "Removing old nightly: $toolchain" | |
rustup toolchain uninstall "$toolchain" | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment