Ubuntu – What does ‘Lock Version’ do


Having installed an experimental version of dropbox and installed in manually, i dont want the deb in synaptic to download any updates (as theyll over write the changes ive done manually i assume).

Ive found the lock version option in synaptic, im assuming this stops a particular deb from downloading any new versions of itself?

Also can i just unlock it again when the version from the deb catches up with the experimental version that i have installed?

Am i correct or does it serve another function?

Best Answer

apt will only replace the current package of something if there is a newer package. Updates that come now will likely be to previous versions. It won't downgrade it unless they do something spectacularly silly with the versioning.

Lock version is not as clever as it sounds. It's supposed to do what it says on the tin, lock the version... But it only locks it within Synaptic. Anything else that does package upgrades (read: Update Manager, apt-get, aptitude, etc) ignores this. This is probably buggy behaviour so I would expect this to be fixed in time.

But to stop things getting upgraded, you want to "hold" it. To do that, load up aptitude, find the package (/ is the quick-key for searching, n finds the next instance) and press h on it to hold it. This is respected a lot more than Synaptic's "lock" feature.

Edit: Another way of doing this via the command line is by running this:

sudo -i
echo <package-name> hold | dpkg --set-selections

But as I started with, I don't think you need to do this in your circumstances. Provided you're using a package version that is clearly newer than the current stable releases (and isn't just a random build number - you can see in Synaptic) you'll be fine.

Related Question