I have Debian Jessie and have added backports (according to these instructions):
echo "deb http://http.debian.net/debian jessie-backports main contrib non-free" | sudo tee /etc/apt/sources.list.d/backports.list
(I did this to get a newer kernel, as I needed it, of for some hardware in my laptop.)
The instructions say that nothing should happen, unless I explicitly ask for a backported package. e.g. apt-get -t jessie-backports install "package"
.
However I now seem to have a whole load of my system from backports, and one package has un-installed, because it depends on an exact version, of something that was updated to back-ports.
So my question:
- How do I first stop it, so that no more backports are installed?
- How do I remove the existing backports?
Note: this gets a list of installed packages that are from backports (and in format that can be passed to apt-get install
, for some reason putting sudo apt-get install
in place of echo at end of pipeline does not work ):
cat /var/log/dpkg.log.1 |grep -v linux | grep -v xserver | grep -v firmware | grep "status installed" | grep bpo | cut -d" " -f 5 | cut -d: -f 1 | xargs -i{} -n1 bash -c "dpkg-query -s {} >/dev/null && echo {}" | sed -r -e "s~.*~\0/jessie~" | xargs echo
Caution:
Some of the packages are automatically installed, so if you reinstall them all, then these automatically installed packages will be marked as manually installed. Thus not removed when not needed.
Any one have any ideas as to how to solve this?