Mastering Debian
The basic configuration: APT
Now 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).
Commands
vi /etc/apt/sources.list
apt-get update
apt-get upgrade
apt-get install package
apt-get autoclean
dselect
apt-cache search whatever
apt-cache depends package
apt-cache show package
dpkg-query -l
dpkg-query -W package
dpkg-query -L package
dpkg-query -S /path/file
dpkg-reconfigure package
dpkg --get-selections
echo package hold | dpkg --set-selections
dpkg --get-selections | grep deinstall
dpkg -P package...
dpkg -S `which exec`
dpkg -L package
dpkg -L $(dpkg -S $(which exec) | cut -d: -f1)
/etc/apt/sources.list
This 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 myths
If 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 settings
Put your changed apt settings into a file named /etc/apt/apt.confIf you are puzzled what you can put there, see
zless /usr/share/doc/apt/examples/configure-index.gz
Acquire
{
http
{
Proxy "http://127.0.0.1:3128";
}
Timeout 60;
}
Acquire::http::Proxy "http://127.0.0.1:3128";
Acquire::Timeout 60;
Additional Apt Settings
Increase the Apt limit (often needed when you want to upgrade, so you have a lot of sources): /etc/apt/apt.confApt::Cache-Limit "16384000";
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.
Backports
See backports.org/dokuwiki/doku.php?id=instructions To install from backports, useaptitude 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!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/
APT helpers
debfoster and deborphan
Handle orphaned packages (those, which are installed but no more needed):apt-get install debfoster deborphan
debfoster
apt-get purge `deborphan`
debsums
If you think your harddrive corrupted some files, try debsumapt-get install debsums
debsums -ac
aptitude
Well, 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:aptitude -t stable dist-upgrade
Explanation: See http://www.argon.org/~roderick/apt-pinning.html
Package: *
Pin: release o=Debian,a=lenny
Pin-Priority: 900
Package: *
Pin: release o=Debian,a=etch
Pin-Priority: 800
Package: *
Pin: release o=Debian,a=testing
Pin-Priority: 400
Package: *
Pin: release o=Debian,a=unstable
Pin-Priority: 300
auto-apt
apt-get install auto-apt
auto-apt update
auto-apt updatedb
auto-apt update-local
auto-apt run COMMAND
apt-file
Find the package if you know the file name:apt-get install apt-file
apt-file update
apt-file search FILENAME
apt-file list PACKAGE
apt-show-versions
Find 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