wdt@users.sourceforge.net
Copyright © 2001 by Will Trillich
Revision History | ||
---|---|---|
Revision v0.01 | 23 July 2001 | Revised by: rml |
SGML formatting |
# apt <TAB KEY> |
![]() | This feature is called 'completion', and most command shells offer it in some fashion. |
To see the manual on just about any command, use man, as in:
% man apt-get % man exim.conf % man egrep |
See why we call them manpages? :)
On my system, using the tcsh shell, here's what I get:
% apt <^D> apt-cache apt-cdrom apt-config apt-get apt-move apt-setup aptitude % |
I'll only talk about apt-setup, apt-get and apt-cache here, plus a bit of a related program, dpkg.
% uname -r |
My system is version '2.2.17'.
The uname utility is available in the shellutils package:
# apt-get install shellutils |
to get it, if you don't have it.
In addition, I use the tcsh command shell, just to be difficult.
This little gizmo sets up the configuration file for you:
# apt-setup |
# apt-get install base-config |
Of course, you can always set up apt's sources.list file by hand if you must. Check out
% man sources.list |
# apt-setup |
You must modify /etc/apt/preferences and add:
1 Package: * 2 Pin: release a=stable 3 Pin-Priority: 900 4 5 Package: * 6 Pin: release a=testing 7 Pin-Priority: -10 8 |
After this, you can use the -t option to choose which distribution you want to get packages from:
# apt-get -t testing install sgmltools2 |
Once sources.list is set up and you're online, first
# apt-get update |
# apt-get upgrade |
![]() | All this happens without having to restart. (For Mac and Windows people -- imagine leaving your computer up for two MONTHS! It's awesome!) |
Once you're online, it's easy to install new packages you're interested in; simply do something like
# apt-get install vim traceroute mysql-server mysql-client # apt-get install logcheck |
Whether you're online or not--
How do you find the package that's got the feature you're looking for? First, do
# apt-get update |
% apt-cache search tunnel % apt-cache search 'php.*sql' % apt-cache search apache.\*perl % apt-cache search elvis\|vim |
" NOTE -- apt-cache only knows about the package descriptions you've already downloaded. To search among ALL known Debian packages just browse to http://packages.debian.org/PACKAGESUBSTRING to see what's available. For example: http://packages.debian.org/vnc That would get you a listing of packages that contain the term "vnc" somewhere in the title."
The simplest way to see the description of a package:
% apt-cache show postgresql % apt-cache show iproute |
Which packages are installed? Do any packages need configuring?
% dpkg -l |
% dpkg -l \* % dpkg -l '*' |
% dpkg -l \*postgres\* % dpkg -l '*postgres*' |
'*like|this?or that' "even[this|is]acceptable" |
this\ acts\ like\ one\ word\ cuz\ spaces\ are\ quoted \[one\|two\?three\*four\] |
% dpkg -l \* | grep ^pi |
% dpkg -l '*' | grep "^i[^i]" |
% dpkg -l \* | grep '^[^i]i' |
On my system, to find out which apt packages I have installed, I can do this:
% dpkg -l \*apt\* Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad) ||/ Name Version Description +++-=================-=================-============================================================= ii apt 0.3.19 Advanced front-end for dpkg ii apt-move 3.0-13 Move cache of Debian packages into a mirror hierarchy ii aptitude 0.0.4a-4.1 Console based apt frontend un libapt-pkg-dev <none> (no description available) un libapt-pkg-doc <none> (no description available) un libapt-pkg2.7 <none> (no description available) pn task-laptop <none> (no description available) |
For a slightly different approach, how about this:
% dpkg -l \* | grep apt ii apt 0.3.19 Advanced front-end for dpkg ii apt-move 3.0-13 Move cache of Debian packages into a mirror hierarchy ii aptitude 0.0.4a-4.1 Console based apt frontend un libapt-pkg-dev <none> (no description available) un libapt-pkg-doc <none> (no description available) un libapt-pkg2.7 <none> (no description available) ii libpcap0 0.4a6-3 System interface for user-level packet capture. pn task-laptop <none> (no description available) % |
% dpkg -L mysql % dpkg -L apt |
% dpkg -S postmaster % dpkg -S 'doc/*sql' | cut -f1 -d: | sort -u |
% dpkg -S apt- | sort apt-move: /etc/apt-move.conf apt-move: /etc/cron.weekly/apt-move apt-move: /usr/bin/apt-move apt-move: /usr/share/doc/apt-move apt-move: /usr/share/doc/apt-move/README.Debian apt-move: /usr/share/doc/apt-move/README.gz apt-move: /usr/share/doc/apt-move/TODO apt-move: /usr/share/doc/apt-move/TODO.Debian apt-move: /usr/share/doc/apt-move/changelog.Debian.gz apt-move: /usr/share/doc/apt-move/changelog.gz apt-move: /usr/share/doc/apt-move/copyright apt-move: /usr/share/doc/apt-move/examples apt-move: /usr/share/doc/apt-move/examples/SAMPLE.exclude apt-move: /usr/share/man/man8/apt-move.8.gz apt: /usr/bin/apt-cache apt: /usr/bin/apt-cdrom apt: /usr/bin/apt-config apt: /usr/bin/apt-get apt: /usr/lib/libapt-pkg.so.2.7 apt: /usr/lib/libapt-pkg.so.2.7.1 apt: /usr/share/man/man8/apt-cache.8.gz apt: /usr/share/man/man8/apt-cdrom.8.gz apt: /usr/share/man/man8/apt-config.8.gz apt: /usr/share/man/man8/apt-get.8.gz base-config: /usr/sbin/apt-setup base-config: /usr/share/debconf/templates/apt-setup.templates base-config: /usr/share/man/man8/apt-setup.8.gz |
/usr/bin/aptitude it'll be a nice APT front-end when it's done
/usr/share/doc/postgresql-doc/postgres/libpq-chapter18164.htm
To get your knees wet, try these:
% man apt-get % man apt-cache % man sources.list % man dpkg % man grep % man cut % man sort |
Also check out the manpage for your command shell,
% man bash % man tcsh % man ksh |
For further reading, and to learn about Debian or Linux in general, visit these websites often:
and for Linux-general (not Debian specific) info, trysearch.netscape.com/Computers/Software/Operating_Systems/Unix/Administration
directory.google.com/Top/Computers/Software/Operating_Systems/Linux/
Apt sure is handy and powerful stuff, once you get used to it.
Last update: Wed Apr 25 02:05:34 2001
SGML formatting: Tue Jul 23
If you have comments or suggestions about this document, please lemme know.