Upgrade Software Packages and Dependencies for Debian

apt-get upgrade

A modern Linux system has several thousand software packages on it, and it's a sure bet that at least one of those is upgraded by its maintainer every day. With apt, it's quite simple to keep your system up-to-date. The process looks like this (and remember, this command must be run as root):

[View full width]

# apt-get update Get:1 http://us.archive.ubuntu.com breezy Release.gpg [189B] Get:2 http://archive.ubuntu.com breezy Release.gpg [189B] Hit ftp://ftp.free.fr breezy/free Sources Hit ftp://ftp.free.fr breezy/non-free Sources Fetched 140kB in 1m4s (2176B/s) Reading package lists... Done [Results truncated for length] # apt-get upgrade Reading package lists... Done Building dependency tree... Done The following packages have been kept back: koffice The following packages will be upgraded: kalzium kamera kanagram karbon kbruch kchart kcoloredit kdegraphics kdegraphics-kfile-plugins ... 53 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. Need to get 58.3MB of archives. After unpacking 28.7kB of additional disk space will be used. Do you want to continue [Y/n]?

Let's figure out what was going on here. Once again, you want to run apt-get update first so your computer is in sync with your apt repositories. Then apt-get upgrade looks for any differences between what you have installed and what's available on the repositories. If differences exist, apt shows you a list of all of the packages that it would like to download and install on your computer. Of course, the actual list of packages varies depending on how up-to-date your system is. In this case, enough time had passed that there were 53 packages to upgrade.

If you type y, apt downloads the 53 software packages to /var/cache/apt/archives and then installs them after they're all on your machine. If you don't want to go through with the upgrade, just type n instead.

That's easy enough, but the most efficient way to use apt to update your Linux box is to just join the commands together:

# apt-get update && apt-get upgrade 

The && makes sure that apt-get upgrade doesn't run unless apt-get update finishes without errors. Better yet, make an alias for that command in your .bash_aliases file, as was discussed in the "Create a New Permanent Alias" section of Chapter 11, "Your Shell."

alias upgrade='apt-get update && apt-get upgrade ' 

Reload your .bash_aliases file, and now you just need to type in upgrade, press Enter, press Y to accept any new packages, and you're done. Windows Update, eat your heart out!

Linux Phrasebook
Linux Phrasebook
ISBN: 0672328380
EAN: 2147483647
Year: 2007
Pages: 288

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net