TL;DR here's a script to pull all the below together (fastest mirror tested using netselect-apt):
To fully migrate to Debian's testing/unstable repos (testing is preferred, unstable is present in case of dependency errors) first backup /etc/apt/sources.list:
cp -a /etc/apt/sources.list ~/sources.list.bak
Then check the state of the sources.list (as there may be references to stable in sources.list.d/ - we'll repeat this after migrating to testing).
grep 'debian.org.*stable' /etc/apt/sources.list /etc/apt/sources.list.d/*
Add the non-free repos
sudo sed 's/main$/main non-free contrib/g' -i /etc/apt/sources.list
Rename entries for stable and jessie to testing:
sed -E 's# (stable|jessie)# testing#ig' -i /etc/apt/sources.list
Set apt's default release
sudo sed 's#APT::Default-Release "stable";#APT::Default-Release "testing";#g' \
-i /etc/apt/apt.conf.d/99defaultrelease
The install should now be on testing. Verify by grepping sources for stable (there shouldn't be any results):
grep 'debian.org.*stable' /etc/apt/sources.list /etc/apt/sources.list.d/*
Update the repositories:
sudo apt update
Install apt-listbugs and apt-listchanges:
apt install apt-listbugs apt-listchanges
Verify the installation channel by repeating the install, but specifying the -t testing flag - the packages should report that they are already the latest:
apt install apt-listbugs apt-listchanges -t testing
Verification of the latest version:
# apt install apt-listbugs apt-listchanges -t testing
Reading package lists... Done
Building dependency tree
Reading state information... Done
apt-listbugs is already the newest version (<cut>).
apt-listchanges is already the newest version (<cut>).
...
Now, dist-upgrade to fully migrate to testing:
sudo apt full-upgrade
Be sure to always check the packages that will be removed. Although testing is generally stable, occasionally this can erroneously include xorg. Removing xorg will prevent X windows from booting (fixes available here and here).
You can safely remove files under /etc/apt/preferences and subdirectories:
sudo rm /etc/apt/preferences /etc/apt/preferences.d/*
When the installation is complete, reboot:
sudo shutdown -r now
Further reading:
