alright, let's start:
basics
apt-get is the package manager for Debian, you can use it to install/remove software. you use it in a shell, there is also a GUI version named aptitude but I focus on the shell version.
the software you install via apt-get are pre-compiled packages stored in the Debian repositories.
what are those repositories?
repositories are like a library where you can pick the software you want and install them online. there are different repositories, first of course for the different Debian versions, but for the current version are also different repositories. why? take a look at the repository names:
- stable
- oldstable
- testing
- experimental
- unstable
pretty self explanatory I think. if a package from the testing repository has been tested long enough it can be labeled as stable and moved to the stable repository. if you're into adventures feel free to use any repository you want, but for beginners and/or systems which have to work reliable (servers for example) I highly recommend to use only the stable repository.
preconditions to use the repositories
how your Debian system knows which repository to use? the sources for the packages which should be searched are stated in the file sources.list , the file is located in /etc/apt/
let's take a look at my sources.list file:
Code: Select all
deb http://ftp.de.debian.org/debian/ sarge main contrib non-free
deb-src http://ftp.de.debian.org/debian/ sarge main contrib non-free
deb http://ftp.de.debian.org/debian-non-US/ sarge/non-US main contrib non-free
deb-src http://ftp.de.debian.org/debian-non-US/ sarge/non-US main contrib non-free
Warning!
if you want to install Debian sarge make sure the box is NOT connected to the internet while installing! because in the default sources.list file the entries point to stable it'll download updates for Debian etch (which is now the stable version) and therefore the install will fail! so install while offline, when done edit the sources.list file and THEN get your updates manually.
if you want to use Debian etch you can stay online while installing, the first updates will be downloaded automatically then, just to be complete here's also the sources.list file for etch:
Code: Select all
# regular updates for etch
deb http://ftp.debian.org/debian/ etch main contrib non-free
deb-src http://ftp.debian.org/debian/ etch main contrib non-free
# security updates for etch
deb http://security.debian.org/ etch/updates main contrib non-free
deb-src http://security.debian.org/ etch/updates main contrib non-free
what are those "non-free", "contrib", etc. about?
contrib
Packages in this area are freely licensed by the copyright holder but depend on other software that is not free.
Non-Free
Packages in this area have some onerous license condition restricting use or redistribution of the software.
Non-US/Main
Packages in this area are free themselves but cannot be exported from a server in the U.S.
Non-US/Non-Free
Packages in this area have some onerous license condition restricting use or redistribution of the software. They cannot be exported from the U.S. because they are encryption software packages that are not handled by the export control procedure that is used for the packages in Main or they cannot be stored on a server in the U.S because they are encumbered by patent issues.
don't worry, you will NEVER have to pay something for a package from the repositories...
Let's update the system!
once your sources.list file is edited you can do your first system update. uh-oh, sounds like much work, right? nope, all you have to do is:
Code: Select all
apt-get update
Code: Select all
apt-get upgrade
that's it! easy, huh?
you can do a re-check and upgrade again, you should get this output then:
Code: Select all
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
hey, it don't want to update some packages?!
sometimes you might get something like this:
Code: Select all
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Code: Select all
apt-get dist-upgrade
in the repositories not only updates are stored, you can also install completely new applications easily! the Debian repositories include more than 18.000 different packages, from new icon themes for your desktop to networking tools or servers, you can find almost anything there...and it's all for free!
if you want to browse through the repositories and look for interesting stuff: http://packages.debian.org/stable/
if you look for a specific package but don't know the actual name:
http://www.debian.org/distrib/packages#search_packages
http://www.debian.org is a bookmarking MUST for any Debian user anyway...
alright, let's say you found a package you want to install, let's pick nmap as an example. all you have to do is:
Code: Select all
apt-get install nmap
how to remove packages again
that's as simple as installing, let's use nmap as example again:
Code: Select all
apt-get remove nmap
I hope you find my little HowTo useful, of course I can't go too much into details and list every option of apt-get because this HowTo is for beginners anyway. if you want to get deeper into it use the good old man command to display the manual:
Code: Select all
man apt-get