This commit is contained in:
JaKooLit 2023-10-12 23:10:17 +09:00
parent dd5070b374
commit 7ca471bffd

View File

@ -136,23 +136,17 @@ chmod +x install-scripts/*
# Path to the sources.list file # Path to the sources.list file
sources_list="/etc/apt/sources.list" sources_list="/etc/apt/sources.list"
# Check if any lines starting with "# deb-src" exist # Check if any lines starting with "#deb-src" exist
if grep -q "^# deb-src" "$sources_list"; then if grep -q "^#deb-src" "$sources_list"; then
echo "Found lines starting with '# deb-src' in $sources_list." echo "Found lines starting with '#deb-src' in $sources_list."
else else
# Remove the '#' from the first line starting with '#deb-src' # Remove the '#' from the first line starting with '#deb-src'
echo "No lines starting with '# deb-src' found in $sources_list. Removing '#' from the first such line..." echo "No lines starting with '#deb-src' found in $sources_list. Removing '#' from the first such line..."
sudo sed -i '0,/^#deb-src/ s/^# //' "$sources_list" sudo sed -i '0,/^#deb-src/ s/^#//' "$sources_list"
fi fi
# Check if any lines starting with "deb" exist # Remove the '#' from lines starting with '#deb'
if grep -q "^deb" "$sources_list"; then sudo sed -i '/^#deb/ s/^# //' "$sources_list"
echo "Found lines starting with 'deb' in $sources_list."
else
# Remove the '#' from lines starting with '# deb'
echo "No lines starting with 'deb' found in $sources_list. Removing '#' from lines starting with '# deb'..."
sudo sed -i '/^# deb/ s/^# //' "$sources_list"
fi
sudo apt update sudo apt update