Salix WebsiteDocumentation Site

4.1.5. Installing a Program - spi

Maybe a little bird has told you that there is a wonderful application called cowsay in Linux, and now you would like to see what this program can do.

If this is the first time you are installing an application on Salix, the first thing you should do is to update the package database on your computer by executing

sudo spi -u

Then to search for an application (in this case, "cowsay"), type in

spi cowsay

Notice that you don't need to type sudo just for searching for a package. The output you will get should be similar to this:

george[~]$ spi cowsay
Available packages:

Available SlackBuilds:
cowsay [Not installed]: cowsay (A Configurable Speaking/Thinking
xcowsay [Not installed]: xcowsay (displays a cute cow and message
                         on your desktop)

You can see that there is no available package for cowsay in the official repositories of Salix or Slackware. Instead, a SlackBuild is available. SBo maintains extra packages for Slackware, which, of course, can be utilized by Salix users. These SlackBuilds, however, are not maintained by Salix or Slackware, but rather from individual Slackware users and are not guaranteed to work 100% of the time. Packages, on the other hand, should work perfectly fine all the time, with no exceptions.

To install cowsay using the SlackBuild, you simply must run:

sudo spi -i cowsay

Actually this is not different at all from what you would have done if cowsay was available as a package. Installing any of the available packages involves downloading the package and actually installing it, while installing something using a SlackBuild, involves downloading the SlackBuild script and all required source files, compiling the source code, packaging it up and installing the package that has been created. All that, of course, is done automatically. It's only just that installing something using a SlackBuild is generally a bit (or a lot) slower since it includes the extra step for compiling the source code.

If you are not sure what this -i is in the above command, you can check it with spi --help. You will see a lot of lines running up the terminal quickly until the application is installed.

Once it is installed, you might want to test it. First get out of the superuser mode by typing exit. Then type in cowsay. Nothing happens, and, in fact, you will see that you are now in a strange mode that you cannot execute any commands. This is because the application is still running, but as you don't see anything, perhaps it is not running properly. To terminate the process, press Ctrl+c. You will get back the normal input line back on your terminal.

george[Desktop]$ cowsay

So what was going wrong? Check

cowsay -h

You will see that you need to type in a [message]. Try again with

cowsay Hello Salix!

We have merely scratched the surface of the power of the command line here. The best way to learn more is by using it, but remember to use the help tools, and consult online documentation such as that listed in the Salix forum. can be particularly recommended if you wish to gain a comprehensive grounding. Proceed cautiously, but don't be afraid to experiment.

A final tip - it can be difficult to copy longer commands accurately. If you select the text with the mouse, clicking the middle button or wheel will paste it accurately into the command line or wherever you wish. This only works in a terminal running within a GUI.