Update A Specific Package With apt-get

Probably default knowledge to most, but I didn't find it right way. Turns out the "install" parameter, is also the "upgrade" control for a specific package.

If you're trying to update a specific package, do this:

apt-get install <package>

If the package's already installed, the latest version will be installed on top of it. Using "install" as the upgrade parameter -- who comes up with these things. :-)

Here's a useful overview of all apt-get options: apt-get package management cheat sheet.

3 comments on “Update A Specific Package With apt-get
  1. Wim Deblauwe says:

    Thanks for this, just what I was looking for!

  2. Ben says:

    There are problems with this approach. In most situations, this will work, but there will be times when this approach removes packages that are dependent on the package that is being installed (and never re-installs them). For details, see: https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/969426

    You are not alone; this same advice is offered here, too: http://www.ubuntugeek.com/ubuntu-package-management-from-command-line-using-apt-advanced-packaging-tool.html .

    I don’t have a better solution to offer, as ‘apt-get upgrade’ does not allow packages to be upgraded selectively (at least according to the published documentation), but I want to warn others who are using this approach in critical production environments.

    It is worth noting that Ubuntu’s Update Manager provides for selective package upgrades, but I have no idea how it achieves this marvelous feat.

Leave a Reply

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



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Why ads?

I'm glad you made it to this blogpost. I hope it helps solve your problem. So why then do I show ads on the site? Writing content, testing it and making sure the layout isn't totally b0rked takes time. A lot of time. The ads are a way to pay back a small portion of that time.

And as you know running a site costs (a bit of) money: the domain name, webhosting, time spent writing and updating content, ... So if you like the content of this blog, consider disabling your AdBlocker for this domain. Thanks!

Looking for help?

Tired of fixing all these tech-problems yourself? We've got an excellent team at Nucleus, a top-class Belgian hosting provider, that can help you.

Discover our Managed Hosting, where skilled engineers manage your servers and keep them up-to-date, so you can focus on your core business. We use a variety of Configuration Management Systems such as Puppet to make sure every config is reviewed, unit-tested and guaranteed to be working.

Want to get in touch? Find me as @mattiasgeniar on Twitter or via the contact-page on this blog.