Debian aptitide safe-upgrade out of memory

view story

http://serverfault.com – On a 2GB RAM + 1GB SWAP VPS with Debian OS, aptitude safe-upgrade fails because of running out of memory. OOM Killer is stopping the process after about 30min of running on high CPU and max RAM consumption incl. SWAP usage. How to aptitude safe-upgrade though? All unrequired other processes like apache2 and mysql are stopped while running aptitude's command, but still not enough available ressources. free -m total used free shared buffers cached Mem: 2012 1967 45 0 0 5 -/+ buffers/cache: 1961 (HowTos)