../
Looking for a senior C++ dev? I'm looking for work. Hire me!

Summary

In 2013, I wrote an entry on how I setup my Ubuntu development environments. Three years later, it is time to update those instructions.

Requirements

Requirements are relatively simple:

  1. A desktop or virtual machine with a decent amount of memory and 10 GiB or more of available disk space.
  2. The latest version of Ubuntu, such as the 16.10 64-bit desktop edition.
  3. The latest version of VirtualBox, which at the time I wrote these instructions was v5.1.6.
    1. Don't forget to download the VirtualBox Extension Pack.

Installation

Once you have Ubuntu installed, open the system settings, and enable the partner repositories: System Settings -> Software Sources -> Other Software -> Partners repository.

Open a terminal window, and paste the following commands:

# basic packages to get started sudo apt-get install ssh dkms build-essential linux-headers-generic # development tools sudo apt-get install kdevelop cmake git subversion rpm gdb ddd # doxygen sudo apt-get install graphviz doxygen doxygen-gui # man pages sudo apt-get install manpages manpages-dev manpages-posix manpages-posix-dev unity-scope-manpages # development libraries sudo apt-get install libboost-all-dev libboost-dev libssl-dev # tools I happen to like sudo apt-get install terminator fish htop meld

Same as above, but as a single apt-get command:

sudo apt-get install \ ssh dkms build-essential linux-headers-generic \ kdevelop cmake git subversion rpm gdb ddd \ graphviz doxygen doxygen-gui \ manpages manpages-dev manpages-posix manpages-posix-dev unity-scope-manpages \ libboost-all-dev libboost-dev libssl-dev \ terminator fish htop meld

Cross-Compile

If you'll be cross-compiling for ARM devices:

sudo apt-get install g++-arm-linux-gnueabihf gcc-arm-linux-gnueabihf
Also see Cross Compiling For ARM-7.

BeagleBone

If the device I'm setting up is a BeagleBone on which I'll be compiling (or a simple text console device without X):

sudo useradd --create-home --shell /bin/bash --user-group --groups sudo stephane sudo passwd stephane sudo apt-get install \ ssh build-essential \ cmake git subversion rpm gdb \ graphviz doxygen \ manpages manpages-dev manpages-posix manpages-posix-dev \ libboost-all-dev libboost-dev libssl-dev \ htop sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576 sudo chown root:root /swapfile sudo chmod 0600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile

To make the swap file persistent across reboots, edit /etc/fstab and add this line:

/swapfile none swap sw 0 0

Configuration

Open a terminal window, and run the following command:

ssh-keygen

Press ENTER to accept all the defaults.

While you have a terminal window open, right-mouse-click in the terminal, then click on Preferences -> Profiles -> Scrolling.

I find fish to be infinitely better than bash as an interactive shell, so I always set it up as my default shell.

chsh --shell $(which fish)

Because I've never liked typing ls -lh and my origins from 30 years ago are DOS and OS/2, I like to setup an alias for dir. Start a fish shell and type the following commands:

function dir ls -l $argv end funcsave dir

Google Chrome

Download Google Chrome: https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

Install Google Chrome with the following commands:

sudo dpkg -i google-chrome-stable_current_amd64.deb sudo apt-get install -f
Last modified: 2016-11-10
Stéphane Charette, stephanecharette@gmail.com
../