This would stop the major upgrades, which is different of a downgrade: sudo sed -i_BAK-$(date -I) "s/oldoldstable/23.05/" /etc/apt/sources.list.d/koha.list