Installing SAS for Linux – Step 2: Throw away the documentation

So you want to install SAS for Linux….

Step 1: Read the documentation for some hints on how to download and install the download  manager, and  the SAS software depot (if you are the SAS administrator).

Step 2 : Throw away the documentation. It will just confuse you after this point and it doesn’t help anyway.

I had installed SAS on a Ubuntu operating system once before, on a virtual machine running on Virtual Box running on an older computer in my office that has Windows XP. I couldn’t remember how I did it except that I ended up literally throwing away the documentation and just using Google to figure it out.  Then I deleted the virtual machine later when I needed space on that computer.

This weekend I installed SAS on the computer in the living room that runs Linux. My husband received the computer for $100 in some raffle or something. It was a bit of a dilemma at first, because our other six computers are Macs and Dennis equates Windows with the anti-Christ, but, after a few minutes thought, he installed Ubuntu and all has been well, barring a few arm-wrestling matches with the little one over whether she was going to get to use it for Club Penguin or he was going to be able to use it for programming.

The  good news is downloading the download manager and installing the SAS software depot was a piece of cake. I followed the instructions on the SAS install site and everything worked perfectly. It took a few hours to download, which was a bit surprising to me, since we just had FiOS installed on the promise of speeding things up, but for once no one tripped over a cord and disconnected the computer, spelled coke on the keyboard or any of those other things that always seem to happen when you are right in the middle of something.

I created the DVDs from the SAS software depot but they did not work. By “they did not work”, I mean that when I popped in the DVD and ran sudo /cdrom/   instead of giving me three options, one of which was to install the software, it launched right into creating a new software depot on the computer where I already had a software depot from which I had created the DVDs in the first place. Sort of an annoying Escher-type loop.  FAIL !

If I was more of my usual self I would have been determined to figure this out, but, unfortunately, I only have about 10 or 11 productive hours when I am not in too much pain to work (this sucks) so I decided to go ahead and use the software depot which was installed and actually DID give me three options. So, here is what I did after having downloaded the software depot, and it did work.


1. cd to to the directory where your software depot is located, e.g.,

cd /usr/local/SAS/

2. Make sure your default shell is bash

(If your default shell is NOT bash, in my case it was dash, you will get a message that says:

/bin/sh: illegal option -p

Since the pain medication is eating about 40% of my brain as well as a good bit of my productive hours (this sucks), I passed the problem along to the Windows-hating Dennis when he got home from the lab. He emailed me the following from the upstairs bedroom  ….

In order to install SAS components without the “/bin/sh: illegal option -p” error which stops installation,  your /bin/sh file must be pointing to bash.

To check this, in the terminal execute the command:

ls -l /bin/sh

The line you get in return should end in something like:

sh -> /bin/bash

if it just ends in sh, or something like sh -> /bin/dash, you need to replace it with a symbolic link to bash. To do this, execute the two following lines:

sudo rm  /bin/sh
sudo ln  -s  /bin/bash  /bin/sh

3. Type  sudo ./

give your password

Just click along with the next screens and SAS should install no problem.

(The SAS documentation says to just type ./  but in my case that tells me I don’t have permission.)

Actually compared to the problems we had early on with SAS 9.2 for Windows, this was relatively pain free.

Running SAS

You need to create a work directory and assign it when you run SAS. I went to my home directory and created a directory named tmp.

mkdir tmp

Then, to invoke SAS, I did this

usr/local/SAS/SASFoundation/SAS92/9.2/sas -work tmp

and SAS started up just happy as could be.

Of course, at this point, three things occur to me.

  1. I had no data on this computer and no actual need for SAS on it at the moment, I just wanted to see if I could install it and get it to run.
  2. There must be something like a .login file where I can set the path and don’t need to specify the full path each time.
  3. I have yet to install SAS on Linux from DVDs. The last time I did it from an external disk drive that had the software depot on it.

Also, there was no Enterprise Guide and no Power and Sample Size application. Not sure if SAS does not make those for Linux or they just weren’t part of our license.

So, there you have it. SAS for Linux. Except for the little bash/ dash episode, it really wasn’t much trouble at all. We only have one person outside our department who wants to install it (the other three used the same external drive that I did), so I think I will just copy the software depot on to a flash drive and send it to him.

Maybe I’ll figure out the DVD thing when I feel better (this sucks) or much more likely I’ll give them to my wonderful assistant and have her figure it out while I write up my lectures for next week on calculating various effect sizes with SPSS, SAS Enterprise Guide for Data Management & Statistics and Basic Statistics using SPSS 14 (yes, unbelievably, we actually had a request for a class on that!)

Similar Posts


  1. I’m glad to hear that your Linux deployment went smoothly.

    SAS Enterprise Guide runs only on Windows, but it can connect to SAS running on any of the supported platforms, including Linux.

    To enable the connection, you need a SAS Metadata Server (running somewhere) and object spawner (running on the Linux box) to allow SAS Enterprise Guide to find and connect to a SAS workspace running on Linux.

    Chris @ SAS

  2. “…Dennis equates Windows with the anti-Christ…” – Can I just say I love your husband? I think I want to marry him, but I’m not sure how my Wife would feel about that.

    I enjoyed this post since I love Ubuntu and SAS. Wierd that your default shell was dash. Bash is usually the default on Ubuntu while Xubuntu uses dash as default. Something must have been installed to mess up your user profile.


  3. Thanks for the heads up. I ran into the same problem that /bin/sh did not point to BASH and got nowhere until I found your post. The tip about configuring the temp space is also vital!

    Way to go!

  4. Hi!

    I’m new to Linux..

    so while im deploying my SAS on my hard disc… after the first cd is done… the disc won’t unmount… for some reason..

    i have tried everything..

    umount /cdrom
    fuser -km/mnt

    nothing works… got any suggestions..?

  5. I had numerous problems installing SAS on Linux from CDs. What I did was avoid using CDs. There are four options: Copy the SAS depot on to either
    1. An external hard drive
    2. An 8GB or larger flash drive
    3. The hard drive on your Linux machine
    4. A server

    and run the install from there. I have done all of the first three with no problem. I haven’t tried it from a server. No reason, I just haven’t.

  6. Hi Annamaria,

    I’m installing SAS 9.3 on my linux machine and this post was very helpful. Supposedly Enterprise Miner is part of this install but I haven’t been able to find the pathway to start the application. Do you know where this might be?

  7. Hi,

    You have mentioned that you have downloaded the SAS software from somewhere. Could you please let me know the site? I am a ubuntu lover…

    Thanks in advance!

Leave a Reply

Your email address will not be published. Required fields are marked *