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.

We have a meta-package, similar to ubuntu-desktop, that requires a bunch of dependencies to run some internal, not-yet-packaged code. Currently we are updating the meta-package so that it requires >= the current version every time we repackage it so that its dependencies will be upgraded when it is installed. However, if there was a way to upgrade a package and all its dependencies without upgrading all packages then that would be much simpler. Is that possible?

share|improve this question

2 Answers 2

Not directly, as far as I know. You can use a little shell snippet to generate the list of dependencies of the package and upgrade these (assuming you aren't interested in recursive dependencies):

apt-get install our-metapackage $(dpkg-query -Wf '${Depends}' our-metapackage | sed 's/ *\(([^()]*)\)\? *[,|] */\n/g')

An alternative approach would be to supply your packages through a repository with a unique origin. Write an APT preferences file that specifies only your repository as having a normal priority and everything else as having too low a priority to be installed automatically. (See APT pinning in the APT manual for explanations.) I won't go into details about making the repository (this would be material for a separate question, which may well exist already). To specify that packages from your repository get upgraded and others don't, write the following file as /etc/apt/preferences.nnutter:

Package: *
Pin: release o=nnutter
Pin-Priority: 500

Package: *
Pin-Prority: 100

500 is the normal priority. 100 causes packages not to be upgraded, though the package will be installed if required by dependencies. Run apt-get upgrade or apt-get dist-upgrade with this APT preferences file when you only want to upgrade packages from the nnutter repository:

apt-get -o Dir::Etc::Preferences=/etc/apt/preferences.nnutter -o Dir::Etc::PreferencesParts=/etc/apt/preferences.nnutter.d upgrade
share|improve this answer
    
Very informative, thanks! –  nnutter Aug 28 '12 at 18:58
    
I did not succeed implementing this solution : apt-get always upgrade all packages. –  Cédric Girard Sep 10 '12 at 14:51

You can use wajig command which can be used to put some packages on hold when upgrading

just type :

sudo wajig hold SomePackage

sudo wajig unhold 

check the man page for more info

share|improve this answer
    
This would sort of be the same problem but from the opposite perspective. –  nnutter Aug 28 '12 at 18:55

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.