Ubuntu apt-get update vs upgrade

I have a VPS with Ubuntu Server 12.04 and I want maximal stability of my server, which's main purpose is a webserver.

What are difference between Update and Upgrade? I can't understand difference. As I understand Upgrade is upgrading version of package of some software product and if this upgraded software have, for example, some API change and my code can become incompatible with that update I will run into problems. But since this is only small version change compared to big version change using dist-upgrade most times those upgrades will be compatible with my code. Do I understand it right?

Second small question is sudo apt-get update is the same as if I run sudo aptitude and install all Security updates? I love aptitude, it is something like Windows Updates, that's why I choose Ubuntu Server.


Solution 1:

Simply:

apt-get update will update your local copies of your repositories' package data, such as available versions and dependencies.

  • This is needed to check whether any updates are present.
  • It doesn't actually upgrade packages.

apt-get upgrade and apt-get dist-upgrade will upgrade packages.

  • The former runs general system upgrades
  • The latter will apply higher level patches such as kernel upgrades.
  • Check this link for a detailed look into upgrade vs dist-upgrade

For a detailed discussion of aptitude vs apt-get, read this AskUbuntu post.