Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

In redhat-based distros, the yum tool has a distro-sync command which will synchronize packages to the current repositories. This command is useful for returning to a base state if base packages have been modified from an outside source. The docs for the command is:

distribution-synchronization or distro-sync Synchronizes the installed package set with the latest packages available, this is done by either obsoleting, upgrading or downgrading as appropriate. This will "normally" do the same thing as the upgrade command however if you have the package FOO installed at version 4, and the latest available is only version 3, then this command will downgrade FOO to version 3.

Is there an equivalent operation in Ubuntu?

share|improve this question

2 Answers 2

I think you can do this by a adding a /etc/apt/preferences profile that pinned all packages to the distro/release that repo represents. The next time you run apt-get upgrade it will downgrade as necessary to satisfy the rules specified. See man apt_preferences for details.

http://wiki.debian.org/AptPreferences

The flip side of this is to prevent this from occurring to begin with by pinning the packages you have a stake in staying stable. So if they're updated by an outside source, the next apt-get upgrade will revert just that and not your entire OS.

share|improve this answer
    
Thanks, I will try that out. The use case that brought this up was that I installed the Unity 5.0 PPA in Precise. When 5.0 was added to precise, I wanted to track the percise repo and remove the PPA. –  Mark Bidewell Jan 18 '12 at 17:07

No, there is no such command in the apt package system, for what I know.

The dist-upgrade command of apt-get is similar, but it do not downgrade packages. The install command could downgrade a package as in

sudo apt-get install "package"="version"

but as you see you should explicitly give the desired version number, which you can retrieve from

apt-cache policy "package"
share|improve this answer
    
Yes, dist-upgrade does downgrade packages. Otherwise this is correct. –  Michael Hampton Aug 25 at 14:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.