2

I read this Q&A about How to prevent updating of a specific package?

But, I would like to disable/prevent update of a lot of packages, how can I do this efficiently?

The above given method works( as shown in image below), but it's hard to find the names of packages that exactly apt-mark understands. See the screenshot below, I need to disable or put on hold all of these except a few.

The software updater pops up many times (I know i can skip it always), but I am on low bandwidth and can't update each and every package. And I hardly use them, e.g. Thunderbird, simple-scan, music player.

It would be very good, if this software-updater had a option to disable update of a package by just right-clicking or some other way.

apt-mark hold demo image

mtk
  • 601
  • 8
  • 18
  • @Videonauth I put it in simple words? What is unclear? I want to disable the update suggestions for packages that I don't use from the software-updater. Any way to do that? please let me know – mtk Jun 04 '16 at 04:07
  • Nevermind my fault. – Videonauth Jun 04 '16 at 04:15

2 Answers2

0

Finding package names

One way is to use apt-get dist-upgrade instead of the software updater GUI. It will generate almost the same list of packages, however, it will use their package names instead of their "human friendly" titles. This will allow you to run apt-mark on them.

That will at least make it easier.

Doing it in bulk

If you want to do them all at once, you can save the packages to a text file called package_list, one package per line; then run

$ sudo :; cat package_list | xargs sudo apt-mark hold

xargs will take each line in turn and append it to the apt-mark command line. The first command, sudo :, simply caches your credentials so that you don't have to type your password when running sudo apt-mark several times; If you're running as root anyway, you won't need this, but it allows you to do as much as possible without elevated privileges.

Warning

I have not tested the xargs line. Besides, it's good practice to read and understand any command before running it; especially when using sudo/root. ;-)

What can go wrong, and why

I know you said you wanted to allow 2-3 packages to upgrade normally; but if you're not really careful, you can prevent a package from upgrading even without putting a hold on it directly, because if the newer version of your package depends on a newer version of another package which has a hold, neither can be upgraded without first removing the hold.

So, if you want to allow a specific package to update, ensure that all of its dependents have no holds, either. The list generated by an updater can be misleading, because it's usually a flat list of packages, without the dependency tree used to generate the list in the first place.

History

The "Software Updater GUI" used to be a lot less polished — and a lot more useful, back in the bad ol' days when Ubuntu was still young. In fact, it used to show the package names along with the titles.

jpaugh
  • 552
0

From the old school GUI, there is an alternative package manager named "synaptic". That existed in Debian before Ubuntu existed. I suggest you install that, it is in the Ubuntu repositories. synaptic has a menu pulldown to lock a package in place. Click "Package" then choose "Force Version".

I did not agree with initiative to replace synaptic in the way-back-when, for me it still works awesome. I never use "Software Updater GUI", it makes me feel as though I've lost control of my computer. apt-get in the command line is nice too. If you do that, then apt-mark, as suggested by @jpaugh, will work fine.

Going between programs, you'll notice some weird things. Package settings in synaptic are not respected in "Software updater" and apt-get settings are separate as well. aptitude keeps its own database as well. That's a little surprising to me, seems like one ought to be able to set those characteristics in the package database itself, rather than having each separate program maintain its own records. But I think that's what happens.

You can regain control, I expect. Let us know if synaptic does what you want.

pauljohn32
  • 3,743