Installation Instructions for Indigo in Arch Linux

This page describes how to install Indigo in Arch Linux. Arch Linux is not officially supported by ROS and the installation might fail for several reasons. This page does not (yet) contain instructions for most higher level ROS packages, only for the base system. This includes the middleware and command line tools but not much more.

Method 1: Using the AUR Packages

Installing an AUR helper

First, install base-devel that contains everything needed by makepkg to compile packages on Arch Linux:

pacman -S base-devel

The current most straightforward way to install ROS Indigo is using the AUR packages that start with ros-indigo. Using a helper such as yaourt or packer, it is possible to install all packages related to ROS Indigo and let the Arch Build System take care of all the dependencies involved.

To install yaourt, you can add the archlinuxfr repository to /etc/pacman.conf:

[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch

Then, simply run:

pacman -Sy yaourt

Or if you decide to go for packer:

pacman -Sy packer

Preliminary configuration

Some settings will make the installation process faster:

  • Set MAKEFLAGS in /etc/makepkg.conf to the number of threads you want to use when compiling. If you want to use the maximum of threads for your system, use the value given by nproc. For instance, if you have 4 cores, use MAKEFLAGS="-j4". If you want to be able to use your computer while installing ROS without much of a performance hit, you may want to lower this value.

You should also make sure that [core], [extra] and possibly [community] are enabled in your /etc/pacman.conf, since some dependencies are part of these official repositories.

Python version

Arch Linux uses Python 3 as its default version, and starting with Indigo, Python 3 is now supported in ROS. However, since several non-core packages have not been fixed for Python 3 yet, we still rely on Python 2.

Since Python 3 is not fully compatible with Python 2, some extra options have to be provided to catkin_make and/or cmake to make sure that the proper Python executable, headers and libraries are used.

Installing AUR Packages

In the following simple examples I will be using yaourt, however, it is trivial to replace it with packer. In order to see what packages are avaible, simply use:

yaourt ros-indigo

Or view the list of packages online. It is then possible to install a specific subset of the packages (or all of them, using a string like 1-112).

In order to avoid all of the prompts when installing a large number of packages, the use of the following flag may be applied (be warned that you will NOT be prompted for confirmation on any of the packages, only for your password)

yaourt --noconfirm ros-indigo

Using this method, you will be asked only once for the password, and all following packages will be installed without asking the using to edit any PKGBUILD or confirm a package installation. Be warned that should a failure occur in one of the builds, you will not be able to edit a PKBUILD. You can, however, attempt to install that specific package alone and then restart the build process without having to reinstall every package. For instance, should the package ros-indigo-actionlib-msgs fail, you can check it separately with the following procedure:

yaourt -S ros-indigo-actionlib-msgs

Depending on where it fails, different actions are possible. To restart the building process without rebuilding all of the packages, a simple

yaourt --noconfirm --needed ros-indigo

and selecting the packages you want to install will suffice. Once this is done, you will have a complete ROS Indigo installation in /opt/ros/indigo, and you can proceed to follow the ROS Tutorials online. Note, however, that a few extra steps need to be taken:

First, install rosdep with

yaourt -S python2-rosdep

Then, initialize rosdep with

sudo rosdep init
rosdep update

Some users could experience problems with the last command. In this case, remove the python2-rosdep package and install python2-pip. Therefore, rosdep could be installed using pip2. In the following, these steps are summarized:

yaourt -Rsc python2-rosdep
yaourt -S python2-pip
sudo pip2 install -U rosdep

Therefore, init and update rosdep:

sudo rosdep init
rosdep update

User configuration

Finally, when initializing a catkin workspace, as specified in the tutorial pages, instead of issuing the command:

catkin_make

some Python 2 flags will need to be added, as in:

catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python2 -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so

This step will not be necessary when installing every package, but if an error occurs mentioning a version of Python 3, then it will be needed in order to specify the right version.

To make things easier, you should create a shell function that sets everything ROS-related, and run that function when you want to use some shells for ROS. For instance, you can add something like this in your ~/.bashrc:

# ROS
indigo() {
  source /opt/ros/indigo/setup.bash
  export PYTHONPATH=/opt/ros/indigo/lib/python2.7/site-packages:$PYTHONPATH
  export PKG_CONFIG_PATH="/opt/ros/indigo/lib/pkgconfig:$PKG_CONFIG_PATH"
  # Optionally, you can set:
  #export ROS_PACKAGE_PATH=/path/to/your/package/path:$ROS_PACKAGE_PATH

  # Useful aliases
  alias catkin_make="catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python2 -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so"

  # If you use Gazebo:
  #source /usr/share/gazebo/setup.sh
}

Then, in a shell:

$ indigo
$ roscore

Adding New AUR Packages

If you want to help packaging for Arch Linux, you can use import_catkin_packages.py available in arch-ros-stacks. You can fork arch-ros-stacks and contribute by following the instructions in the README.

If you do push your packages to the AUR, other Arch Linux users will be able to install your package by simply typing:

yaourt ros-indigo-package-name

Note that you can also create PKGBUILDs manually (just copy another package's PKGBUILD and adapt it), but the automatic process is probably the safest option, since it gets the latest release version, the adequate dependencies, the short description etc.

Method 2: Manual Build

This method grants a bit more control, but is more complicated and will still require the installation of several AUR packages.

Prerequisites

TBD

Building ROS Base

TBD

Community

If you would like to contribute to packaging ROS on Arch, check arch-ros-stacks on GitHub (as explained in #1.2), or even [https://wiki.archlinux.org/index.php/Talk:Ros].

Wiki: indigo/Installation/Arch (last edited 2015-08-27 06:27:43 by BenjaminChretien)