Installing Stata on Ubuntu or Linux Mint
Saturday, 10 October 2009
For those like myself who have recently switched to the Linux operating system, installing programs that are not in the Ubuntu repositories can be a challenge at times. I recently installed the statistical analysis program Stata on my computer running the latest stable version of Linux Mint Gloria, which is a fork of the popular Ubuntu Linux distribution. But, more about my choice of Linux distro later. On to installing Stata on linux.
sudo mkdir /usr/local/stata10 cd /usr/local/stata10 sh /media/cdrom/install
Next, follow the prompts to install the program. The Stata install CD includes versions for several operating system so just pay attention. If you want to run the GUI version of Stata just like on windows then you’ll want to select the dynamically linked version in step three of the install.
After the files have been copied run the license install program by typing:
sudo ./stinit
If there is an error you may need to change the permissions on the stata10 folder before starting the license program. Try typing:
sudo chmod -R 755 /usr/local/stata10
Enter the serial number, code, and authorization key and you’ll be prompted to enter some info that will appear when Stata starts. I chose to enter my name on the first line and my job title on the second. Now you should be able to run Stata from the command line by typing:
./stata
or you can run the GUI version of Stata by typing:
./xstata
At first try I was able to run Stata from the command line but when I tried to run xstata I got the following error:
./xstata: error while loading shared libraries: libtiff.so.3: cannot open shared object file: No such file or directory
After consulting a document on the Stata website, I was still confused about what to do but after further search I was able to run xstata by running the following commands. If you are running a recent version of Ubuntu such as 9.04 – 10.04 the following should work:
sudo ln -s /usr/lib/libtiff.so.4 /usr/lib/libtiff.so.3
After upgrading to the latest version of Ubuntu, Maverick Meerkat (10.10), a new version of libtiff is included so the following softlink should be used instead of the line above.
sudo ln -s /usr/lib/libtiff.so.4.3.3 /usr/lib/libtiff.so.3
Mostly, this post serves as a reminder to myself how to re-install if I have to but if you find this useful, leave me a comment below. Good luck!
Comments on this article can be sent to me by e-mail..


No. 1 — November 6th, 2009 at 8:43 am
I’m going to add this to my RSS reader so I’ll know when you decide to write down your reasons for picking Mint. I just wanted to remind you to do so. I am curious. What kept me to trying any Linux at all for a long time — and sent me to FreeBSD instead — was the truly bewildering range of distros, and with it all the Internet litter of strong views on which one is best. FreeBSD has one number — currently 7.2, I think — and that’s that. It was comforting. Then of course I noticed that with Ubuntu you have all this great support from users all over the world.
No. 2 — November 7th, 2009 at 11:36 am
To be honest, I didn’t even consider FreeBSD because my main computer is a laptop and I thought of FreeBSD as a server OS.
But, after your comment I didn’t a little research and downloaded FreeBSD, PC-BSD and DesktopBSD to try out. So far I’ve got FreeBSD running in a virtual machine but the others didn’t want to install first try and may need more massaging.
The next time I re-format FreeBSD will definitely be something I consider.
No. 3 — May 20th, 2010 at 5:11 am
Andrew,
did yo purchase a licence for the Linux version of STATA. I have a Windows license and when I tried to install the *nix version on the install disc is refused to let me past the serial number entry.
I hear that since version 11 of STATA you can install it on multiple platforms from the same disc. this kinda sucks for people like me who paid for version 10.
J.
No. 4 — May 20th, 2010 at 10:00 am
I have Stata 11 now and you are correct, the license works on both my Windows machine and my Ubuntu computer.
I’ve heard that if you have a license for the Windows version of Stata you can get a *nix license from Stata Corp. for a small fee. Let me know what happens if you go this route.
Also, I’ve heard that people have some success running Stata 10 under wine. In my experience it didn’t work so well. There is a thread about Stata on the Ubuntu forums here: http://ubuntuforums.org/showthread.php?t=870519
No. 5 — June 11th, 2010 at 7:24 am
Had similar experience. What is more annoying now is that everytime i open the dofile editor, stata gui quits unexpectedly. Any ideas how to resolve this?
No. 6 — June 17th, 2010 at 6:22 pm
The do-file editor in Stata 10 wasn terrible, IMO, so I used an external text editor and never noticed the crash. With Stata 11, however, the do-file editor is much improved and I have experienced the GUI crash you mention. I haven’t solved it since I figured it would be more time consuming than using gedit or Komodo Edit (which I highly recommend) but now I’ll look into it a see what I find. I half expected that it was just a bug unique to my laptop.
P.S. If you read this I would like to get in contact with you to learn more about VIS Kenya.
No. 7 — June 18th, 2010 at 10:01 am
Thanks for the response. I managed to find a solution on another blog post i cannot quite remember. Instead of creating a soft link to libgtksourceview that comes with the Ubuntu distribution, install libgtksourceview-1.0.so.0. I would be happy to talk with you more on VIS Kenya and what i do – i like you piece on open data sharing as i am a clinical epidemiologist and this concept has began to gain a reasonable momentum. You can contact me via my email which i have provided on your blog.
sudo apt-get install libgtksourceview-1.0.so.0
No. 8 — June 18th, 2010 at 10:18 pm
I looked around for that blog post you mention and I think I found it. So to give credit where credit is due, the post to fix the do-file editor crash problem is here and the answer is in the comments.
However, I had to install libgtksourceview1.0-0. Perhaps we have different software source files.
sudo apt-get install libgtksourceview1.0-0
No. 9 — November 12th, 2010 at 10:29 am
thanks for the post and the comments, really helpful!!
No. 10 — November 16th, 2010 at 1:13 pm
this is much more helpful than the official explanation…thanks guys
No. 11 — November 16th, 2010 at 7:29 pm
Thanks for stopping by David and Tom.
I’ve updated the post to reflect changes in Ubuntu 10.10, Maverick Meerkat.
No. 12 — December 4th, 2010 at 4:52 am
Thanks for this. I finally got it working.
J.
No. 13 — April 20th, 2011 at 1:50 am
Or you could install the static libarary to prevent further re-install in the /opt directory provided the /opt directory resides in another partition of your hdd. that way, stata10 will be re-install free, with all the necessary upgrades still in-tact even if you upgraded operating system to a different linux version. =)
just make path include /opt/stata10
No. 14 — May 24th, 2011 at 6:06 pm
I really don’t like the Stata GUI in X Windows and am not sure that it has many advantages over running Stata in the Linux command line in terminal. When I really want to use the .do file editor, graphics editor, variables manager, etc. I much prefer the GUI under OS X and/or Windows 7.
No. 15 — June 5th, 2011 at 1:54 pm
Helpful. Thank you. You gave me the right clue. However, the library libtiff in my computer was at
/usr/lib/i386-linux-gnu/libtiff.so.4.3.3
Thanks again
No. 16 — June 22nd, 2011 at 9:10 am
Abdrew,
I installed (dynamically linked) stata11 in ubuntu 11.04 in /usr/local/stata11 and added a launcher for stata to Unity Launcher. It works well, but stata (or ubuntu) can not remember to use stata icon for .dta, .gph .do, files!
thanks
Amir
No. 17 — June 24th, 2011 at 2:25 pm
I’ve noticed this as well but it just hasn’t been a concern for me to have the stata icon on do files etc. That said, if you find an answer I’d love to hear about how to make it happen.
No. 18 — July 23rd, 2011 at 12:58 am
Hey all
I just run into a small problem and i see that other have seen it before.
I am installing Stata 11 on a Debian machine the libgtksourceview-1.0.so.0 has a bitch so what i did i linked it to the version 2 i had install and it worked like charm. You do not need to install libgtksourceview-1.0.so.0: just use
/code beging
sudo ln -s /usr/lib/libgtksourceview-2.0.so.0 /usr/lib/libgtksourceview-1.0.so.0
/code end
that is if you want the xstata to work
I hope someone will find it useful in the future
Nikos
No. 19 — August 12th, 2011 at 2:45 am
[...] familiar with Linux package dependencies you might disagree, and check out the blog posts by Andrew Dyck and Jonas Ranstam for helpful post-installation instructions for the dynamically linked [...]
No. 20 — September 6th, 2011 at 9:09 am
Andrew,
Thank you for having this info up on your blog. It helped me during the installation process of Stata12/IC to my Ubuntu Linux 10.04-running laptop.
Rich C
No. 21 — September 6th, 2011 at 9:47 am
Your welcome Rich. I haven’t tried Stata 12 yet so I’m glad to hear that this install process works for the newest Stata version.
No. 22 — September 6th, 2011 at 6:04 pm
sudo apt-get install libgtksourceview1.0-0
^^^ Very important to get Stata12/IC (./xstata in terminal window) to work properly in a GUI environment on 10.04.
Rich C
No. 23 — October 18th, 2011 at 10:45 am
A very helpful post. Thank you. I just installed Stata 10 on CrunchBang Linux with minimal hassle using your instructions (with some minor alterations). The only way I could update all was a right click on the xstata executable in /usr/local/stata10 as root. An attempt to change permissions from the command line didn’t work for me.
No. 24 — January 6th, 2012 at 8:48 pm
[...] this post and this post as references, I installed the software without any [...]
No. 25 — January 22nd, 2012 at 3:52 am
[...] this post and this post as references, I installed the software without any [...]