Created
March 4, 2023 15:12
-
-
Save 0187773933/0e92c8e2bc74d6a62d42ae5451277450 to your computer and use it in GitHub Desktop.
Fix APT Sources List File
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
#!/bin/bash | |
# https://launchpad.net/ubuntu/+cdmirrors | |
SourcesFilePath="/etc/apt/sources.list" | |
MirrorURL="https://mirrors.cat.pdx.edu/ubuntu" | |
DistName="jammy" | |
EndPoints=( | |
" main restricted" | |
"-updates main restricted" | |
" universe" | |
"-updates universe" | |
" multiverse" | |
"-updates multiverse" | |
"-backports main restricted universe multiverse" | |
"-security main restricted" | |
"-security universe" | |
"-security multiverse" | |
) | |
sudo rm "$SourcesFilePath" || echo "" | |
for i in "${EndPoints[@]}"; do | |
echo "deb $MirrorURL $DistName$i" | sudo tee -a "$SourcesFilePath" | |
echo -e "#deb-src $MirrorURL $DistName$i\n" | sudo tee -a "$SourcesFilePath" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment