Create sources.list in a more reliable way

This commit is contained in:
Bob Mottram 2016-02-15 11:49:18 +00:00
parent f2157d3e06
commit db1e6c5cfd
1 changed files with 16 additions and 22 deletions

View File

@ -3628,34 +3628,29 @@ function search_for_attached_usb_drive {
echo 'search_for_attached_usb_drive' >> $COMPLETION_FILE echo 'search_for_attached_usb_drive' >> $COMPLETION_FILE
} }
function remove_proprietary_repos { function create_repo_sources {
if grep -Fxq "remove_proprietary_repos" $COMPLETION_FILE; then if grep -Fxq "create_repo_sources" $COMPLETION_FILE; then
return
fi
sed -i 's/ non-free//g' /etc/apt/sources.list
echo 'remove_proprietary_repos' >> $COMPLETION_FILE
}
function change_debian_repos {
if grep -Fxq "change_debian_repos" $COMPLETION_FILE; then
return
fi
if [[ $SYSTEM_TYPE == "$VARIANT_MESH" ]]; then
return return
fi fi
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
apt-get clean apt-get clean
sed -i "s/ftp.us.debian.org/$DEBIAN_REPO/g" /etc/apt/sources.list
# ensure that there is a security repo echo "deb http://$DEBIAN_REPO/debian/ jessie main" > /etc/apt/sources.list
if ! grep -q "security" /etc/apt/sources.list; then echo "deb-src http://ftp.uk.debian.org/debian/ jessie main" >> /etc/apt/sources.list
echo "deb http://security.debian.org/ $DEBIAN_VERSION/updates main contrib" >> /etc/apt/sources.list echo '' >> /etc/apt/sources.list
echo "#deb-src http://security.debian.org/ $DEBIAN_VERSION/updates main contrib" >> /etc/apt/sources.list echo "deb http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list
fi echo "deb-src http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list
echo '' >> /etc/apt/sources.list
echo "deb http://$DEBIAN_REPO/debian/ jessie-updates main" >> /etc/apt/sources.list
echo "deb-src http://$DEBIAN_REPO/debian/ jessie-updates main" >> /etc/apt/sources.list
echo '' >> /etc/apt/sources.list
echo "deb http://$DEBIAN_REPO/debian/ jessie-backports main" >> /etc/apt/sources.list
echo "deb-src http://$DEBIAN_REPO/debian/ jessie-backports main" >> /etc/apt/sources.list
apt-get update apt-get update
apt-get -y install apt-transport-https apt-get -y install apt-transport-https
echo 'change_debian_repos' >> $COMPLETION_FILE
echo 'create_repo_sources' >> $COMPLETION_FILE
} }
function initial_setup { function initial_setup {
@ -10528,8 +10523,7 @@ configure_firewall_for_sip
configure_firewall_for_avahi configure_firewall_for_avahi
configure_firewall_for_zeronet configure_firewall_for_zeronet
configure_firewall_for_ipfs configure_firewall_for_ipfs
remove_proprietary_repos create_repo_sources
change_debian_repos
enable_backports enable_backports
configure_dns configure_dns
initial_setup initial_setup