5

I would like to remove most of the packages in the X11 category from my system. However some of those packages are depended on by the 'beaglebone' package. How could I ask aptitude to remove everything in the X11 category, with the exception of the packages depended on by 'beaglebone'?

You can see below that it recommends 'beaglebone' as one of the packages that should be uninstalled at the risk of being broken.

    Aptitude recommended removal. Beaglebone is included.

How can I make sure that this package and its dependencies are retained after the removal?

4

The short answer is:

aptitude remove '~sX11 ! ~Rbeaglebone'

However in this kind of situation (there are a lot of things that depend on X11!), I recommend using the interactive resolver. To do this add the --schedule-only option to the above and run aptitude again without arguments .You may also have to add -o Aptitude::Auto-Fix-Broken=false to one or both commands (if it is not already in your settings), but I don't think you need it as as far as I can see the automatic resolution only happens when you press g in the interface.

Once you have the ncurses interface running, press e to examine the first solution and look at the additional removals. If you see any you don't want, use the arrow keys to select it and press r to reject the action. Press . to load the next solution, it should now provide a solution that doesn't include any of your rejections. Repeat as necessary and press ! to accept the solution and continue as normal.

0

I believe you can use one of the following methods to "exclude" the package "beaglebone" which should force any of its dependencies to remain.

$ sudo apt-mark hold <package>

or

$ echo <package> hold | sudo dpkg --set-selections

The first makes use of apt-mark and its hold feature.

   hold
        hold is used to mark a package as held back, which will prevent the 
        package from being automatically installed, upgraded or removed. The 
        command is only a wrapper around dpkg --set-selections and the state 
        is therefore maintained by dpkg(1) and not affected by the --file 
        option.

The second makes use of dpkg to mark a package as on "hold".

   --set-selections
        Set package selections using file read from stdin. This file should 
        be in the format 'package state', where state is one of install, 
        hold,  deinstall  or purge. Blank lines and comment lines beginning 
        with '#' are also permitted.
  • That will prevent beaglebone and its dependencies from being uninstalled, but how do you then remove all the other X11 packages? I can't immediately call to mind a method that wouldn't either undo the hold and remove beaglebone, or simply do nothing because it isn't able to remove beaglebone or one of its dependencies. – Gilles Jun 15 '14 at 1:06
  • @Gilles - this was worth a shot. Debian/Ubuntu packaging is still something I'm learning about. – slm Jun 15 '14 at 1:10
  • @Gilles - are you positive that pinning beaglebone in this way will not allow for other X11 packages that it isn't dependent on from being installed? I would still encourage the OP to try this just for the sake of seeing if it works. – slm Jun 15 '14 at 1:19
  • @Gilles, putting a hold on beaglebone is a valid approach since it is not in the X11 section (actually there is no beaglebone package in Debian, but since this is a dev board I doubt the package belongs in X11). What is removing the package is the automatic resolver which should happily remove everything else without breaking the hold. – Graeme Jun 15 '14 at 10:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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