How to disable upgrades of a certain package

Asked by Andri Egilsson

After running into a problem with the netatalk package (it didn't have SSL support) I had to build it myself from source.

However, when I run "apt-get upgrade", it always offers me to upgrade netatalk (which would install the binary package and break my installation). Is there a way to disable upgrades of that certain package, whilst still receiving all other upgrades?

Thanks in advance,
Andri.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Simon Jackson
Solved:
Last query:
Last reply:
Revision history for this message
Michael Bienia (geser) said :
#1

If you are using synaptic: start synaptic, select the package and the in the menu: Package -> Lock Version

I guess other package manager have a similar option.

Revision history for this message
Andri Egilsson (andri-egilsson) said :
#2

I'm afraid that seems to have no effect. Netatalk still shows up as one of the packages that APT wants to upgrade if I run "apt-get upgrade" or even if I try to upgrade using synaptic. Synaptic shows the package's status as "version locked" but still offers to upgrade it! That might be a bug in synaptic...

Revision history for this message
Michael Bienia (geser) said :
#3

Have the "official" package from the archive and your rebuild the same version?
I don't know how synaptic reacts in this case.

apt doesn't see the "version locked" from synaptic. As I do my updates through update-manager (which honours the "version locked") I didn't check how to convince apt not to upgrade a package.

Revision history for this message
Andri Egilsson (andri-egilsson) said :
#4

Yes, I downloaded the "official" (current) source package with "apt-get source netatalk", and built it with "dpkg-buildpackage" after changing some configuration. I then installed the resulting package with dpkg. (I do this because the package that is distributed with ubuntu doesn't include SSL support because of licensing restrictions, and this is the recommended way of including SSL support.) For some reason, apt (and synaptic) seems to prefer its own binary version, even after I lock the version in synaptic. I normally use apt from the command-line, but I am able to use synaptic if I start up a gnome session in VNC (this is a remotely controlled machine without keyboard and monitor. I would still prefer an apt-based solution.

Revision history for this message
Best Simon Jackson (sj310) said :
#5

To mark a package as on 'hold' in dpkg use the command
echo "somePackageName hold"|dpkg --set-selections

and to take it off the hold list
echo "somePackageName install"|dpkg --set-selections

That should be respected by apt-get, not sure about synaptic

Revision history for this message
Andri Egilsson (andri-egilsson) said :
#6

Thanks Simon Jackson, that solved my question.