Skip to content

Instantly share code, notes, and snippets.

@mindvox
Last active June 16, 2017 12:13
Show Gist options
  • Save mindvox/f1d194987a41ce6d9424978c713a1f6e to your computer and use it in GitHub Desktop.
Save mindvox/f1d194987a41ce6d9424978c713a1f6e to your computer and use it in GitHub Desktop.
Automatically setup Debian apt sources.

Debian 8 (Jessie)

Script to automatically configure apt sources. You can use this script by running the following command as root from a debian terminal.

curl -sSL 'https://git.io/vHxcV' | sh
#!/bin/sh
##
# Configure Debian 8 (Jessie) amd64 source list.
#
{
apt-get install --yes curl wget apt-transport-https dirmngr
} && {
cat << 'EOF' > /etc/apt/sources.list
#------------------------------------------------------------------------------#
# OFFICIAL DEBIAN REPOS
#------------------------------------------------------------------------------#
###### Debian Main Repos
deb http://deb.debian.org/debian/ stable main contrib non-free
deb-src http://deb.debian.org/debian/ stable main contrib non-free
deb http://deb.debian.org/debian/ stable-updates main contrib non-free
deb-src http://deb.debian.org/debian/ stable-updates main contrib non-free
deb http://deb.debian.org/debian-security stable/updates main
deb-src http://deb.debian.org/debian-security stable/updates main
deb http://ftp.debian.org/debian jessie-backports main
deb-src http://ftp.debian.org/debian jessie-backports main
EOF
} && {
echo 'Package sources configured successfully'
exit 0
} || {
echo 'Package sources could NOT be configured, please see the output above for details.'
exit 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment