Ubuntu – Prevent a package from being updated

June 22, 2008

The original post for this is from the Ubuntu Geek website but I learned something new from it so I thought I would share my new favorite way to keep a package from being updated in Ubuntu.  This goes for pretty much any of the newer releases of Ubuntu.  I used to use dpkg to do this but now I like aptitude much better.  It’s easier for me.

To put a package on hold use this command.

sudo aptitude hold snort-mysql

To remove the hold use this command.

sudo aptitude unhold snort-mysql

To keep your entire system (I think) from being updated simply use this command.

sudo aptitude hold

And to remove the hold use this command.

sudo aptitude unhold

Very easy isn’t it.  Yep, that’s what I thought. I’ll be able to deploy appliances in the field now without worrying if an update is going to break something before I get a chance to fix the issue.

Leave a Reply

Your email address will not be published. Required fields are marked *


*