Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
28
rated 0 times [  28] [ 0]  / answers: 1 / hits: 8357  / 3 Years ago, tue, september 7, 2021, 8:59:49

I mistakenly enabled the Pre-release updates (natty-proposed) repository and then upgraded all packages.



How can I undo this?



Here are the test results from @enzotib's instructions and the test results from my instructions.


More From » 11.04

 Answers
6

Here's a more general way to revert from locally installed packages, proposed and backports packages to the stable+updates channel. While the other answers are correct and work in a similar way, I think this is a more elegant approach.




  1. Make sure you removed the entries of -proposed or -backports in your /etc/apt/sources.list and /etc/apt/sources.list.d/* files.

  2. Add an apt-preferences file, e.g. /etc/apt/preferences.d/99-back-to-stable-updates containing (for precise here - replace with your version):



    Package: *
    Pin: release a=precise
    Pin-Priority: 1001

    Package: *
    Pin: release a=precise-updates
    Pin-Priority: 1001

    Package: *
    Pin: release a=precise-security
    Pin-Priority: 1001

    Package: *
    Pin: release a=precise-proposed
    Pin-Priority: -10

    Package: *
    Pin: release a=precise-backports
    Pin-Priority: -10


    This pinning of > 1000 will make apt force a downgrade on packages from that channel and a priority of < 0 on the -proposed and -backports channels will make remove any additional packages too.


  3. Now run



    sudo apt-get update
    sudo apt-get dist-upgrade


    Inspect the proposed solution apt will give you, and if you think it's okay, then accept it. If you need to check on why and what version it will be downgraded to, check this with apt-cache policy packagename to see what versions are available and what apt decides is the candidate for installation.


  4. Remove the /etc/apt/preferences.d/99-back-to-stable-updates file again, as it's not needed anymore.




Thanks to mlind on the Ubuntu forums for this inspriation on pinning in his post from more than 5 years ago - yet it helped me out pretty well today.


[#43665] Wednesday, September 8, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
hamostic

Total Points: 403
Total Questions: 142
Total Answers: 112

Location: Iceland
Member since Sat, Sep 17, 2022
2 Years ago
;