Setting default Debian source

If you have a new device, perhaps shipped from overseas, it may come with a Debian source with slow latency for your location. Here's the best way to reset (using bookworm as the example release):


sudo sed -i 's/^# en_US.UTF-8/en_US.UTF-8/' /etc/locale.gen

sudo locale-gen


sudo tee /etc/apt/sources.list >/dev/null <<-EOF

deb [trusted=yes] http://deb.debian.org/debian bookworm main non-free-firmware

deb-src [trusted=yes] http://deb.debian.org/debian bookworm main non-free-firmware


deb [trusted=yes] http://security.debian.org/debian-security bookworm-security main non-free-firmware

deb-src [trusted=yes] http://security.debian.org/debian-security bookworm-security main non-free-firmware


deb [trusted=yes] http://deb.debian.org/debian bookworm-updates main non-free-firmware

deb-src [trusted=yes] http://deb.debian.org/debian bookworm-updates main non-free-firmware

EOF


sudo apt-get -o Acquire::Check-Valid-Until=false -o Acquire::Check-Date=false update

sudo apt-get install -y ca-certificates ntp tzdata fake-hwclock --reinstall


# set to your desired timezone:

sudo dpkg-reconfigure tzdata


sudo service ntp restart


sudo tee /etc/apt/sources.list >/dev/null <<-EOF

deb https://deb.debian.org/debian bookworm main non-free-firmware

deb-src https://deb.debian.org/debian bookworm main non-free-firmware


deb https://security.debian.org/debian-security bookworm-security main non-free-firmware

deb-src https://security.debian.org/debian-security bookworm-security main non-free-firmware


deb https://deb.debian.org/debian bookworm-updates main non-free-firmware

deb-src https://deb.debian.org/debian bookworm-updates main non-free-firmware

EOF


sudo apt-get update

sudo apt-get upgrade -y


Comments

Popular Posts