I have a bunch of packages "enhanced" by some Debian repository. Now I've disabled that repo from /etc/apt/sources.list.d
and I want to re-install all packages that were "enhanced" to... whatever is available. I can get the list of packages just fine using grep, but
apt-get install --reinstall \
$(dpkg-query -Wf '${Version}\t${Package}\n' | grep SOMEREPO | awk '{print $2}' )
reports that those packages can't be downloaded. And of course they can't — not at their current version. --reinstall --downgrade
is rejected by apt
. It seems that the only way to downgrade is to name a specific version (which would require even more nasty scripting for a batch of packages).
Anything I'm overlooking? Maybe aptitude can do it?
Update: I know it can be done via pinning (thanks so much, mods!), but really, that's not a solution. It's laborious, and I don't care about which specific source the downgrade comes from. I want to downgrade to whatever is available from the currently-enabled sources.
Update 2: I'm using a Debian-derivative (MX Linux), so downgrades could come from
- Debian buster
buster-backports
- the distro-specific
https://mirrors.*/mx/MX-Packages/mx/repo/