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.