The basic configuration: APTNow you have a minimal running system.
It's plain and you want to setup your system.
To do this, you need to know the Debian way.
That's apt. To use apt efficiently you have to remember zillions of different commands. In future, I want to replace it all by a single, friendly frontend called hx, the "hilbix console" (it will be based on CGI).
Find where something hides (what's the difference to dpkg-query, please?):
apt-get install package
apt-cache search whatever
apt-cache depends package
apt-cache show package
dpkg-query -W package
dpkg-query -L package
dpkg-query -S /path/file
echo package hold | dpkg --set-selections
dpkg --get-selections | grep deinstall
dpkg -P package...
Or in one (shoot them. Shoot them quickly, please, but shoot them!):
dpkg -S `which exec`
dpkg -L package
dpkg -L $(dpkg -S $(which exec) | cut -d: -f1)
/etc/apt/sources.listThis file probably will look like below.
Some docs say to use testing. That's not what you want, so the third word definitively is "sarge". Also you want "main contrib non-free". And you add the deb-src lines, too.
Add your debian server with your own distribution packages there.
deb http://ftp.uni-erlangen.de/pub/Linux/debian/ stable main contrib non-free
deb-src http://ftp.uni-erlangen.de/pub/Linux/debian/ stable main contrib non-free
deb http://security.debian.org/ stable/updates main contrib non-free
non-US mythsIf you ever see a reference to non-US this is for Debian Woody and before. Since Sarge you do not need them. Since Lenny non-US entries do harm. If you are curious, have a look into the Archive.
Apt settingsPut your changed apt settings into a file named /etc/apt/apt.conf
If you are puzzled what you can put there, see
The long syntax looks like
The short syntax looks like:
I do like more the latter, because this one is more easy to handle with scripts.
Additional Apt SettingsIncrease the Apt limit (often needed when you want to upgrade, so you have a lot of sources): /etc/apt/apt.conf
you need this if you see something like
Reading package lists... Error!
E: Dynamic MMap ran out of room
E: Error occurred while processing unixodbc-dev (NewVersion1)
E: Problem with MergeList /var/lib/apt/lists/ftp.de.debian.org_debian_dists_stable_main_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.
BackportsSee backports.org/dokuwiki/doku.php?id=instructions To install from backports, use
because "apt" alone might not work.
aptitude install <package>
Aptitude explains you what to upgrade, if it comes to resolve of dependencies within backports.
Remove non-US!Remove all traces of non-US from sources, as those trigger a signature problem. non-US is obsolete now!
Following text is no more recommended
deb http://ftp.uni-erlangen.de/pub/Linux/debian/ stable/non-US main contrib non-free
deb-src http://ftp.uni-erlangen.de/pub/Linux/debian/ stable/non-US main contrib non-free
Add syscp, you want to hand this to your customers nearly for sure.
deb http://debian.syscp.de/ etch/
debfoster and deborphanHandle orphaned packages (those, which are installed but no more needed):
apt-get install debfoster deborphan
apt-get purge `deborphan`
debsumsIf you think your harddrive corrupted some files, try debsum
The problem with this script is, that it always starts from the beginning. And it can only check for archives, it has listed locally (often the base packages from install are missing). I currently have no solution for this. However it is better than nothing.
apt-get install debsums
aptitudeWell, you needed some things from testing or unstable before, but now the next release is out and you want to revert back to stable? Aptitude is your friend. Like this:
Use this command wisely. It often needs several steps, as it does not advice you to downgrade in one step. This is OK. Sometimes it is clever to uninstall things first and re-install them later. If this helps, try this way. And keep your apt-preferences correctly, such that it stays where it is if it can: Example /etc/apt/preferences for Lenny which once was Etch:
aptitude -t stable dist-upgrade
Explanation: See http://www.argon.org/~roderick/apt-pinning.html
Pin: release o=Debian,a=lenny
Pin: release o=Debian,a=etch
Pin: release o=Debian,a=testing
Pin: release o=Debian,a=unstable
Run something and find out which packages it needs:
apt-get install auto-apt
auto-apt run COMMAND
apt-fileFind the package if you know the file name:
apt-get install apt-file
apt-file search FILENAME
apt-file list PACKAGE
apt-show-versionsFind which version a package has. This is important after you have upgraded something to find broken/old packages (those with no security patches!):
apt-get install apt-show-versions