Convert Debian to testing branch

In some cases, we have installed a stable version of Debian or other similar distribution and we want to upgrade it without having to reinstall it, for compatibility or lab scenario reasons.

The only thing we need to do is to change ‘source.list’ file, replacing ‘stable’ to ‘testing’:

su -
nano /etc/apt/sources.list
deb testing main contrib non-free
deb-src testing main contrib non-free

Later, we can update the repositories, upgrading to testing branch and remove any superseded packages:

apt-get update && apt dist-upgrade -y && apt autoremove -y