Posts Tagged ‘installation’


Install IPython on Ubuntu

In howto on Aug 3, 2016 by theoryl Tagged: , , , ,

IPython is a much more powerful shell than the usual Python shell. As Ubuntu and Linux Mint are already shipped with python and pip, installing IPython is trivial:

sudo pip install ipython

VoilĂ !



TeX Live 2012 on Linux Mint Maya

In howto on Apr 5, 2014 by theoryl Tagged: , , , , , ,

Ubuntu 12.04 is distributed with a really old version of TeX Live: TeX Live 2009. Fortunately, TeX Live 2012 is available in Ubuntu 12.10 and is backported to 12.04 via a ppa (Thanks!). Since Linux Mint Maya is based on Ubuntu 12.04, it can install the TeX Live version provided by the PPA.

There are numerous answers of how to do that, such as: How do I install the latest TeX Live 2012? (askubuntu), Problems installing TeX Live 2012 on 12.04 (askubuntu), How to remove everything related to TeX Live for fresh install on Ubuntu? (stackexchange)

The following is what I did. If you have never installed TeX before, skip to the next section. Else, let’s uninstall the existing TeX so that you can make a clean installation:

sudo apt-get purge texlive*
# Some of the following might not apply
#sudo rm -rf /usr/local/texlive/2012/
sudo rm -rf /usr/share/texmf/
sudo rm -rf /usr/local/share/texmf/
sudo rm -rf /var/lib/texmf/
sudo rm -rf /var/lib/tex-common/
sudo rm -rf /etc/texmf/
#rm -rf ~/.texlive/
rm -rf ~/.texmf-var/
sudo apt-get purge tex-common
sudo apt-get autoremove
sudo apt-get autoclean

Now add the PPA to you system:

sudo add-apt-repository ppa:texlive-backports/ppa
sudo apt-get update

Now ready to install TeX Live 2012

sudo apt-get install texlive-full

To test whether it’s installed successfully, try calling tex. I got the following prompt:

This is TeX, Version 3.1415926 (TeX Live 2012/Debian)


Install IPython 2.0 on Linux Mint Maya

In howto on Mar 16, 2014 by theoryl Tagged: , , , , ,

Based on, on Linux Mint 13 “Maya” (64-bit), the following is how I build IPython 2.0 from source. The instructions should work the same for Ubuntu 12.04 “Precise Pangolin”. Using python version 2.7.

# First, install 'distribute' for use with 'pip', which is going to replace 'easy_install'
# I assume 'easy_install' is already installed. If not, install 'easy_install' first
sudo easy_install -U distribute

# Second, get 'pip'
sudo apt-get install python-pip

# Then, install an optional package 'pandoc' for document conversion
sudo apt-get install pandoc

# Now, install all the dependencies, some of them optional
sudo pip install virtualenv jinja2 sphinx pyzmq pygments tornado nose pexpect matplotlib

# Get the source and compile
git clone --recursive
cd ipython
sudo python install

# I got the following printout from the above step
#                python: 2.7.3 (default, Feb 27 2014, 19:58:35)  [GCC 4.6.3]
#              platform: linux2
#                sphinx: 1.2.2
#              pygments: 1.6
#                  nose: 1.3.1
#               pexpect: 2.3
#                 pyzmq: 14.1.0
#               tornado: 3.2
#              readline: yes
#                jinja2: 2.7.2

# Test whether it works
ipython --version

# I got the following printout from the above step

# Setup some useful profile preferences
ipython profile create foo
cp ~/.ipython/profile_foo/ipython_*.py ~/.ipython/profile_default/

# Run IPython notebook
ipython notebook

Thanks to IPython contributors for building this amazing tool.


Gollum on Ubuntu/Linux Mint

In howto on Sep 11, 2013 by theoryl Tagged: , , , , , , , ,

Gollum is the wiki engine that is developed and deployed by GitHub. The codes are hosted at It supports many syntaxes, including Markdown, ReStructuredText, Textile, MediaWiki, etc. To install:

On Linux Mint 13 “Maya” (based on Ubuntu 12.04 “Precise Pangolin”), first get Ruby and RubyGems:

sudo apt-get install ruby1.9.1 ruby1.9.1-dev rubygems1.9.1

Then install Gollum via RubyGems:

sudo gem install gollum

An alternative to install Gollum is to build from source (taking version 2.5.0 as example):

git clone
cd gollum
gem build gollum.gemspec
sudo gem install gollum-2.5.0.gem

If you build Gollum from source, you might also want to build its library from source (

To use it, simply create a Git repository:

mkdir ~/Wiki
cd ~/Wiki
git init
gollum .

Now point the browser to http://localhost:4567/, and you have a fully functional Wiki site up and running. As a bonus, it is automatically versioned by Git every time you create/edit a Wiki entry.

One downside thus far is that Gollum doesn’t support multiple repositories and multiple users.

Read More »


PyROOT installation on Ubuntu 10.04

In howto on Jul 13, 2012 by theoryl Tagged: , , , , , , , ,

Last time I installed ROOT, I did not have PyROOT enabled. So I have to recompile. The following assumes Python 2.6 has been installed.

Install ROOT v5.27/06b on Ubuntu 10.04:

# Download ROOT via svn checkout. For simplicity, download to the home area
svn co ~/root
cd ~/root
svn switch

# Get all the dependencies for Ubuntu
sudo apt-get install build-essential libx11-dev libxpm-dev libxft-dev libxext-dev

# Configure. Enable PyROOT along with many useful features
# (to change the installation directory, add `--prefix=/path/to/installation/directory/`)
./configure linux --enable-python --with-python-incdir=/usr/include/python2.6/ --with-python-libdir=/usr/lib/ --enable-mathcore --enable-mathmore --enable-roofit --enable-minuit2 --enable-gdml --enable-table

# Make
# (to use n number of cores, do `make -j n`)

# Install
# (to gain superuser privilege, do `sudo make install`)
make install

To run ROOT, the environment variables need to be set. For bash shell:

export ROOTSYS=$HOME/root
export PATH=$ROOTSYS/bin:$PATH

For c-shell:

setenv ROOTSYS $HOME/root
setenv PATH $ROOTSYS/bin:$PATH

Equivalently, they can be set by doing

source $HOME/root/bin/
#< for c-shell, do `source $HOME/root/bin/thisroot.csh`

To avoid setting the above variables every time, you can put the commands into ~/.bashrc (or ~/.cshrc).

Now try running ROOT:


If the ROOT splash screen shows up, quit and try running PyROOT:

python ~/root/tutorials/pyroot/

Please report any inaccuracy.


Matplotlib 1.0.1 in Ubuntu 10.04

In howto on May 2, 2012 by theoryl Tagged: , , ,

Matplotlib is a plotting utility written in Python that has similar functions to those in Matlab. When trying to follow the tutorial, this line will give some error:

ax = fig.add_subplot(111, projection='3d'

if you installed Matplotlib from the repository (package named python-matplotlib). The ‘3d’ projection was added in Matplotlib version 1.0.0, but the Ubuntu 10.04 repository only has version 0.99. Let’s try to build from source then. First, download the needed version from area. Then get the python development package:

sudo apt-get install python-all-dev

Remove Matplotlib from your system if it was installed. Untar the downloaded source files and cd to the directory. Create a file named matplotlibrc:

backend : WXAgg
interactive : True

to select the backend and enable the interactive mode. Why? Now proceed to build and install:

python build
sudo python install

Check if your system now has the updated version by doing:

python -c "import matplotlib; print matplotlib.__version__;"


Docutils 0.8 in Ubuntu 10.04

In howto on Apr 23, 2012 by theoryl Tagged: , , , , , ,

I wonder if I’m the only person having trouble upgrading Docutils in Ubuntu Lucid Lynx. Docutils is a text processing package, written in Python and for Python, that implements reStructuredText — a plaintext markup language. The Ubuntu 10.04 repository has a really old version 0.6.3. It is missing a feature that is very important to me: the “math” role and directive (added in 0.8).

To upgrade the current version of Docutils, first uninstall the old version. That seems to be the source of all the trouble that I was having. (Before I uninstalled it, all the docutils commands still called the old version 0.6.3). So:

sudo apt-get remove python-docutils

The installation is fairly simple. Download either the snapshot or the stable release listed on the homepage. Then:

tar -xvzf docutils-0.8.1.tar.gz
cd docutils-0.8.1
sudo ./ install

You can check if you have install successfully by doing e.g. --version

To use LaTeX equations with rst directive:

.. math::
    e^{i\pi} = -1

Or with rst role:

:math:`e^{i\pi} = -1`

When using, one can use --math-output command line option to specify the math display format: MathJax (default), HTML, MathML or LaTeX. To get fancy with math in reStructuredText, see this post.