wajig is simple front end to the Debian package management tools like APT and dpkg.
It provides the functionality of tools like apt-get, dpkg, apt-cache etc.
“Wajig is designed to run in such a way as to suit the system it is running on and the policies of the system administrators. It can be run as a normal user, but once a privileged command is required it will use either su and ask for the root user’s password, or else it can use sudo and rely on the normal user’s password.” : says the wajig documentation.
The following tips provide information on how to use wajig:
$ wajig -v help
displays all commands that could be used with wajig.
Wajig expects a command and will call upon other Debian tools to perform the command. Commands can be in mixed case and with hyphens and underscores, and internally these are mapped to the one command. Thus, the commands `Install’, `INSTALL’, `install’ and even `in-stall’ are interpreted identically.
$ wajig editsources
This command is used to edit the file /etc/apt/sources.list, that contains the information about where to fetch the package you have chosen to install using a command like sudo apt-get install <package name>
$ wajig last-update
This command checks when you last did an update.
$ wajig new
This lists what new packages have been added to Debian.
For a complete list of the packages you have installed but for which there are newer versions available on the archive use:
$ wajig toupgrade
To check the version of any installed package and also the version available from the archive previously (i.e., the last time, but one, you performed an upgrade) and now (based on the last time you performed an update), and to also see the so called Desired and Status flags of the package, use:
$ wajig status <package names> (similar to dpkg -l)
Without a list of package names all installed packages will be listed.
A variation is to list the status of all packages with a given string in their name:
$ wajig status-search <string>
To check for a particular package for which you might guess at part of its name you can use:
$ wajig listnames <string> (apt-cache pkgnames)
To list the names and current install status of all installed packages then use:
$ wajig list
You can also list just the names of the packages installed with:
$ wajig list-installed
And if you are looking for a particular installed package with a name containing a particular string then use:
$ wajig list-installed <string>
To list a one line dscription for a package use:
$ wajig whatis <package name>
And to find which package supplies a given file use:
$ wajig whichpkg <command or file path>
and for a command (e.g., most):
$ wajig whichpkg $(which -p most)
The more detailed description of a package is available with:
$ wajig detail <package-name>
To install a new package (or even to update an already installed package) all you need do is:
$ wajig install <package name> (apt-get install)
(Instead of install you could equivalently say update.)
You can list multiple packages to install with the one command.
The install command will also accept a .deb file. So, for example, if you have downloaded a Debian package file (with the .deb extension) you can install it with:
$ wajig install <.deb file> (dpkg -i)
The .deb file will be searched for in both the current directory and in the apt archive at /var/cache/apt/archive/.
You can list multiple .deb files to install.
If the .deb package file you wish to install is available on the internet you can give its address and wajig will download then install it:
$ wajig install http://samfundet.no/debian/dists/woody/css/xine-dvd-css.deb
Sometimes you may want to install many packages by listing them in a file, one per line. You can do this with:
$ wajig fileinstall <filename> (apt-get install)
The file of packages to install can conveniently be created from the list of installed packages on another system with:
$ wajig listinstalled > <filename> (dpkg –get-selections)
You can upgrade all installed packages with:
$ wajig upgrade (apt-get -u upgrade)
A neat trick with wajig is the ability to upgrade a collection of packages all with the same version number to another common version number:
$ wajig status | grep 3.2.3-2 | grep 3.3.0-1 | cut -f1 > list
$ wajig install-file list
Once a package is installed you can remove it with:
$ wajig remove <package name> (apt-get remove)
Once again, you can list multiple packages to remove with the one command.
A remove will not remove configuration files (in case you have done some configuration of the package and later re-install the package).
To get rid of the configuation files as well use:
$ wajig purge <package name> (apt-get –purge remove)
Whenever a package is installed, upgraded, or removed, a log is kept. Yo list the whole log:
$ wajig list-log
RedHat is certainly the leader in terms of installed base. Some packages (particularly commercial packages) are available as RedHat packages (with the rpm extension). These can usually be installed in Debian with little effort. The alien package is required to convert the rpm into deb format which can then be installed. This is taken
care of by wajig:
$ wajig rpminstall gmyclient-0.0.91b-1.i386.rpm
In addition to managing the installed packages wajig also allows you to start, stop, reload, and restart services (which are often provided by so called daemons—processes that run on your computer in the background performing various functions on an on-going basis). The commands all follow the same pattern:
$ wajig restart <service name> (/etc/init.d/<service> restart)
The start and stop commands are obvious. The restart command generally performs a stop followed by a start. The reload command will ask the daemon to reload its configuration files generally without stopping the daemon, if this is possible. The services you can specifiy here depend on what you have installed. Common services
apache Web server
cron Regular task scheduler
exim Email delivery system
gdm The Gnome Windows Display Manager (for logging on)
ssh The Secure Shell daemon
Generally, daemons are started at system boot time automatically.
When packages are installed from the Debian Archives the corresponding deb files are stored in /var/cache/apt/archive. This can become quite populated with older versions of packages and we can clean out these older versions with:
$ wajig autoclean (apt-get autoclean)
Warning: It is sometimes useful to have older versions of packages hanging around if you are tracking the unstable release. Sometimes the newer versions of packages are broken and you need to revert to an older version which may not be available from the Debian archives, but might be in your local download archive.
If you get short of disk space then you might want to remove all the downloaded deb files (not just the older versions of downloaded files) with:
$ wajig clean (apt-get clean)
all these tips have been copied from the wajig documentation.
To view this documentation type:
$ wajig doc | less
For more info:
$ wajig list-commands
$ wajig -v commands
$ wajig help