I am a big fan of Slackware, because it is simple and stable and by default contains almost everything you need out of the box. It was one of my friends who introduced me to Slackware. When I started using it more, one thing that bothered me was software management, so I started to dig on it and the result was the following.
In Slackware, softwares can be installed in three ways :
- From Source
- Using Scripts
- Using prebuilt Packages
1. Installation from the source code of the software:
This is a straightforward method for installing software. Steps for installation in a usual case is like given below, however, it is a good idea to always read the ‘README’ file coming along with the source. There might be some changes in the steps
- Get the tar ball of the source code.
- Uncompress the source code.
- Change the directory to the source code directory.
- Issue the command “$ ./configure”.
- Issue the command “$ make” .
- If the above command completed the execution without any problem, then give the command “$ su -” and provide the password.
- Issue the command “# make install” and hit enter to install the software.
- Complete control over the installation.
- User knows what happens during installation, user will know which all software components are installed and where.
- Dependency is not resolved automatically, which is in a way good because the user will know which all libraries are required for working of the software.
- Since dependency is not resolved automatically, user friendliness is an issue for newbie
- The entire process may be intimidating to a newbie.
- Unless the maintainer provides an uninstall script it is difficult to uninstall the software and related files installed from source.
checkinstall: It’s third party software for tracking installationof software from source, this program monitors the installation of files, and creates a Slackware package/Debian package/rpm package. It Installs a compiled program from the program’s source directory using “make install” or any other command supplied on checkinstall’s command line (such as a Slackware .build script), and creates a binary package at the same time so that we can install and remove the package using Slackware’s package management tools. It uses the installwatch tool to monitor the installation process.
The steps for using checkinstall are given below:
- Get the tar ball of the source code.
- Uncompress the source code. * Change the directory to the source code directory.
- Issue the command “$ ./configure”. * Issue the command “$ make”.
- If the above command completed the execution without any problem, then give the command “$ su -”
and provide the password.
- Issue the command “# checkinstall make install” and hit enter to install the software.
2. Using Scripts:
Slackware by default comes with a lot of softwares and so usually many users doesn’t even have to install a new software for their daily computer use. For those who need a few additional applications than the packages obtained with installation, to meet their needs there exists some third party package repositories. But the question is, how much can we trust them? For those users who want additional softwares and don’t want to use the third party repositories, the traditional solution has been to download the source code for desired applications and compile them manually. However managing those applications later is not an easy task; version updates and such require more of the admin’s time than precompiled packages. Automation of the compile process with the use of a script will make installation from source hassle free to an extent; we can use SlackBuilds for this purpose.
Following are the steps to use Slack Build (Which was present in the slackbuilds.org website and I’m putting it in a step wise step manner😉 )
- Download the SlackBuild archive of the application we wish to build.
- Extract SlackBuild archive in your build environment.
- Download the source of the application from the address listed in the chemtool.info file and place it in the chemtool directory
Directory tree is given below./chemtool
- Edit SlackBuild script if the version of chemtool in the system is newer than what is specified in the SlackBuild script.
- Make the script executable with chmod if necessary(as root): chmod +x chemtool.SlackBuild
- Run the script: ./chemtool.SlackBuild (we will need to either use “su -l” when switching to root, or source the /etc/profile script after doing “su”, or perhaps modifying /root/.bashrc to include necessary PATH elements.)
- If the compilation finished without any errors the finished package should be in the directory declared as “OUTPUT” in the SlackBuild script (this defaults to the /tmp directory). Use installpkg to install it.
- Copy the package from the “OUTPUT” directory and paste it anywhere we want to store it.
Slackbuild repositories and related websites are :
- http://gnomeslackbuild.org/download/ – For binary GNOME distribution for Slackware and Slackware64 Linux. It encompasses all needed packages for a fully configurable, customizable and usable GNOME desktop environment for Slackware.
- http://www.slackwiki.com/Writing_A_SlackBuild_Script – a good tutorial for writing a Slack build script.
There exists third party softwares to use along with Slack builds:
- checkinstall : checkinstall can be used along with SlackBuids.
- sbopkg : Sbopkg is a command-line and dialog-based tool to synchronize with the SlackBuilds.org (“SBo”) repository, a collection of third-party SlackBuild scripts to build Slackware packages.
3. Using Packages:
A Slackware package is a simple gzipped tarball of the form “name-version-architecture-revision.extension” where extension may be txz or tgz or tlz or , for example, flash-player-plugin-22.214.171.124-x86_64.tgz. This compressed package consists of three directories, etc, usr, and install. The install directory contains a do-inst.sh script which will copy the contents of the etc and usr directories in the package to the /etc and /usr directories under the root directory.
Slackware packages are not dependency-aware. This caused the creation of extended TGZ format. Packages in the extended TGZ format also contains information about the package’s dependencies.
We can make use of an RPM package to install a program. For that it has to be first converted into Slackware’s package format. This can be done using the rpm2targz and rpm2tgz tools.
Basic tools for Slackware package management are installpkg, removepkg and upgradepkg which will help to install, remove and upgrade the packages.
All of the above will take the name of the package as the argument.
# installpkg flash-player-plugin-126.96.36.199-x86_64.tgz
# upgradepkg flash-player-plugin-188.8.131.52-x86_64.tgz
# removepkg flash-player-plugin-184.108.40.206-x86_64.tgz
pkgtool: Apart from the above basic package management utilities Slackware has got another tool to manage the packages and it is called pkgtool. The pkgtool utility uses a ncurses menu driven interface. With this tool we can install packages from the current directory or from another one. The tool is also aware of all the installed applications and can be used to remove several at one go. We can also view an application’s brief description and a complete list of files contained within any installed application. Both the pkgtool and the other basic utilities will not resolve the dependencies automatically. But the advantage of installing dependencies by hand is that it allows the user to remain in control of the libraries and programs installed on the system.
slackpkg: slackpkg is designed for installing or upgrading packages through network. It works on the principles of online repositories, very much like Debian’s APT. This tool gets package information from one of the official Slackware mirrors and we can use this information to search for packages and automatically download and install them. Slackpkg isn’t installed by default, but it is available in the extras/ directory on the Slackware installation DVD-ROM and can be easily installed using installpkg. Before the tool can be used, we need to edit the /etc/slackpkg/mirrors file and select one mirror(only one :)) by uncommenting its corresponding location.
Tools that resolve dependencies: All the previously discussed tools were incapable of resolving the dependencies. and there are some package managers which resolves the dependencies automatically.
swaret: Swaret is probably the most popular Slackware package management application. Like Slackpkg, it’s designed to install and upgrade packages over the Internet and it can grab packages from the official repository. Furthermore, with swaret we can grab packages in third-party repositories like LinuxPackages.net. It is also capable of resolving the dependencies very well. After grabbing and installing swaret’s TGZ, rename its sample configuration file to /etc/swaret.conf and edit to select mirrors and other options, like its local tgz store. Unlike upgrades with the upgradepkg tool, swaret can backup a package that it is upgrading and can rollback to this older version. We can script swaret to automatically update the Slackware distribution when a new version is released.
slapt-get: slapt-get to swaret, since it has all of swaret’s features, and its options are very similar to apt-get, and is scriptable too. Like slackpkg, slapt-get uses Slackware’s native package management tools, installpkg, removepkg, and upgradepkg for managing packages. Slapt-get also has a lot of usage-related documentation.