Installing R-Studio on Ubuntu 16.10

rstudioInstalling things on Linux is either really easy, or a yak shave with surprisingly little between those extremes.

It seems that Ubuntu 16.10 has removed Gstreamer 0.10 from the repos and replaced it with Gstreamer 1.0, which is great… until you need to install R-Studio.

While the R-Studio people are aiming to drop the Gstreamer dependency, for the moment, as of 16.10, installing it has fallen into the yak-shave category.

Installing R-Studio works fine, but if you try to run (from the terminal) it you will get the error:

rstudio: error while loading shared libraries: libgstreamer-0.10.so.0: cannot open shared object file: No such file or directory

We can see that it’s failing to load Gstreamer, but since it’s been removed from the Ubuntu repos fixing this will mean getting those packages elsewhere.

To start with, we can download the latest R-studio daily build and install it using dpkg:

$ wget https://s3.amazonaws.com/rstudio-dailybuilds/rstudio-1.0.124-amd64.deb
$ sudo dpkg -i rstudio-1.0.124-amd64.deb

The dpkg command can also query the package to display information about it. If we use the uppercase I option we can confirm that this package requires exactly version 0.10 of libgstreamer:

dpkg -I rstudio-1.0.124-amd64.deb 
 new debian package, version 2.0.
 size 98840122 bytes: control archive=42847 bytes.
     554 bytes,    12 lines      control              
  163246 bytes,  1548 lines      md5sums              
     198 bytes,    10 lines   *  postinst             #!/bin/sh
     158 bytes,    10 lines   *  postrm               #!/bin/sh
 Package: rstudio
 Version: 1.0.124
 Section: devel
 Priority: optional
 Architecture: amd64
 Depends: libjpeg62, libedit2, libgstreamer0.10-0, libgstreamer-plugins-base0.10-0, libssl1.0.0,  libc6 (>= 2.7)
 Recommends: r-base (>= 2.11.1)
 Installed-Size: 526019
 Maintainer: RStudio <info@rstudio.com>
 Description: RStudio
  RStudio is a set of integrated tools designed to help you be more productive with R. It includes a console, syntax-highlighting editor that supports direct code execution, as well as tools for plotting, history, and workspace management.

Debian (which Ubuntu is based on) has the old Gstreamer packages we need to satisfy those dependencies, so we can get them from there. If you need something other than the AMD64 see here and here. The if you have a 64bit machine, you can download and install like this:

# download with wget
$ wget http://ftp.ca.debian.org/debian/pool/main/g/gstreamer0.10/libgstreamer0.10-0_0.10.36-1.5_amd64.deb
$ wget http://ftp.ca.debian.org/debian/pool/main/g/gst-plugins-base0.10/libgstreamer-plugins-base0.10-0_0.10.36-2_amd64.deb

# Now install with dpkg
$ sudo dpkg -i libgstreamer0.10-0_0.10.36-1.5_amd64.deb
$ sudo dpkg -i libgstreamer-plugins-base0.10-0_0.10.36-2_amd64.deb

While that solves R’s problems, we now have one of our own. We’ve purposefully installed old packages and don’t want Ubuntu’s package manager to enthusiastically upgrade them next time we update.
To resolve that problem will put a hold on them with apt-mark:

$ sudo apt-mark hold libgstreamer-plugins-base0.10-0
libgstreamer-plugins-base0.10-0 set on hold.
$ sudo apt-mark hold libgstreamer0.10
libgstreamer0.10-0 set on hold.

And we can check the packages that are on hold with:

$ sudo apt-mark showhold
libgstreamer-plugins-base0.10-0
libgstreamer0.10-0

Hopefully that saves someone some Googling.
Now that’s working, it’s time to play with some R!

Running Gephi on Ubuntu 15.10

A while ago I gave a talk at the Ottawa graph meetup about getting started doing graph data visualizations with Gephi. Ever the optimist, I invited people to install Gephi on their machines and then follow along as I walked through doing various things with the program.

java_install

What trying to get a room of 20 people to install a Java program has taught me is that the installer’s “Java is found everywhere” is not advertising; it’s a warning. I did indeed experience the power of Java, and after about ten minutes of old/broken/multiple  Java versions, broken classpaths and Java 7/8 compatiblity drama, I gave up and completed the rest of the talk as a demo.

All of this was long forgotten until my wife and I started a little open data project recently and needed to use Gephi to visualize the data. The Gephi install she had attempted the day of the talk was still lingering on her Ubuntu system and so it was time to actually figure out how to get it going.

The instructions for installing Gephi are pretty straight forward:

  1. Update your distribution with the last official JRE 7 or 8 packages.
  2. After the download completes, unzip and untar the file in a directory.
  3. Run it by executing ./bin/gephi script file.

The difficulty was that after doing that, Gephi would show its splash screen and then hang as the loading bar said “Starting modules…“.

If you have every downloaded plugins for Gephi, you will have noticed that they have an .nbm extension, which indicates they, and (if you will pardon the pun) by extension, Gephi itself is built on top of the Netbeans IDE.
So the next question was, does Netbeans itself work?

sudo apt-get install netbeans
netbeans

Wouldn’t you know it, that Netbeans also freezes while loading modules.

Installing Oracle’s version of Java was suggested and the place to get that is the Webupd8 Team’s ppa:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer oracle-java8-set-default
# The java version that got installed:
java -version
java version &quot;1.8.0_72&quot;
Java(TM) SE Runtime Environment (build 1.8.0_72-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.72-b15, mixed mode)

That finally left us with a working version of gephi.

Gephi 0.9.1 running on Ubuntu 15.10
Gephi 0.9.1 running on Ubuntu 15.10

Installing Gephi on Arch Linux was (thankfully) drama-free, but interestingly installs the OpenJDK, they very thing that seemed to causing the problems on Ubuntu:

yaourt -S gephi
java -version
openjdk version &quot;1.8.0_74&quot;
OpenJDK Runtime Environment (build 1.8.0_74-b02)
OpenJDK 64-Bit Server VM (build 25.74-b02, mixed mode)

It’s a mystery to me why Gephi on Ubuntu seems to require Oracle’s Java but on Arch I can run it on OpenJDK.
With a little luck it can remain a mystery.

Changing keyboard layout options in Ubuntu 14.04

Back in 2012 I switched my caps-lock key to act as a second ESC key. This made a big impact in my Vim usage, and you can understand why when you see the keyboard vi was created with.

Having become reliant on that little tweak, it was a little disconcerting to realize that the keyboard layout options I had used to switch my caps-lock were nowhere to be found in Ubuntu 14.04. It turns out that Gnome (upstream from Ubuntu) removed the settings from the system settings entirely.

Fortunately this is still accessible via the Gnome Tweak Tool.
You can install that like this:

sudo apt-get install gnome-tweak-tool

Once installed you can launch the tool from the terminal:

gnome-tweak-tool

You can find the all the old options under the “typing” option.
gnome tweak tool

Its a little weird to have such useful stuff suddenly removed from the system settings. Hopefully they will find there way back in a future version, for the moment, my Vim crisis has been averted and that’s enough.

Usb tethering – that was easy

I’ve had my Google Nexus phone for a while now and am only just starting to explore some of the stuff it can do. A recent pleasant surprise was using tethering so I could connect to the internet from my laptop via my phone. I connected my phone to my laptop with the USB cable and dug into the settings:

Android settings
Android settings screen
Android wireless settings
Android wireless settings
Tethering and portable hotspot
Tethering and portable hotspot

As you can see you don’t need to dig very far. When I tapped the the “USB tethering” option Ubuntu immediately popped up a notification saying that it had connected to a wired network… and then I checked my email. It happened so fast that I almost feel cheated out of doing something clever to get it going… almost.

If you don’t have your cable you can explore setting up a Wi-Fi hotspot. You’ll just have to add a name and a password for your network.

I have so many memories of installing Windows and having to use a second computer to download drivers for my network card (and every other card)… Ubuntu is making those memories feel very distant indeed.

 

NetworkManager to the rescue

I work in coffee shops reasonably often, and its surprisingly difficult to find one that has the right combination of comfy chairs, decent coffee and unrestricted WIFI.
Recently one of my favourites had Bell come in and monkey with their router. Of course Bell set up the router to use their nameservers, which, I suspect are some of the slowest in the world (entirely what you would expect if you have had any dealings with Bell).
So when I show up, grab a coffee, and get ready do some work, I notice that everything is really slow.

mike@sleepycat:~☺  time curl www.google.ca > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10947    0 10947    0     0    698      0 --:--:--  0:00:15 --:--:--  3481
y
real	0m15.675s
user	0m0.013s
sys	0m0.000s

Making the same request using just the IP address so as to skip the DNS name resolution step makes it pretty clear where the problem lies:

e
mike@sleepycat:~☺  time curl 74.125.131.94 > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10586    0 10586    0     0  47366      0 --:--:-- --:--:-- --:--:-- 47470

real	0m0.234s
user	0m0.009s
sys	0m0.003s

Now this coffee shop is run by some really lovely people, but my attempt to explain DNS resolution and router settings to girl behind the cash while she frothed milk and customers come in behind me went about as well as you might expect.
So back at my table, I got to thinking; “If only there was a way to accept just the IP address from their router but not their nameserver settings…”

Sure enough, Gnome’s NetworkManager has exactly that:

NetworkManager settings
NetworkManager settings

You will notice I am using Google’s public DNS addresses in there. And the result:

mike@sleepycat:~☺  time curl www.google.ca > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10995    0 10995    0     0  62273      0 --:--:-- --:--:-- --:--:-- 62471

real	0m0.187s
user	0m0.011s
sys	0m0.003s

I love that they thought to add that in there. Well played Gnome! :)

Remote Debugging Chrome on Ubuntu

Between AngularJS and some work on responsive design, I’ve been using Chrome Dev Tools more and more lately. One of the things that has really impressed me is Chrome’s remote debugging. Getting it going on Ubuntu is extra easy since it turns out that the Android Debug Bridge tool is in the repos already:

sudo apt-get install android-tools-adb

And then you can fire up the debug bridge and open the debug tools in Chromium in one shot with this:

adb forward tcp:9222 localabstract:chrome_devtools_remote; chromium-browser localhost:9222

And when you’re done:

adb kill-server

That adb command is a pretty good candidate for an alias, since I don’t use is that often and need to google for it every time.

If you think that’s cool, Chrome’s Dev Tools have plenty more features to explore…

Getting Thomas was alone working on Ubuntu 13.04 64bit

I just bought the Humble Bundle 8 mostly because I liked the looks of “Thomas was alone”.
Sadly the download is just a tar file, which I always find a little off putting. It took a little tinkering to get it going so I thought I would save someone else the searching by writing it here.

Extract the contents of the tar file in whatever way makes you happy.

mike@sleepycat:~/Downloads/thomasLinuxStandalone$ ls
thomasWasAlone  thomasWasAlone_Data
mike@sleepycat:~/Downloads/thomasLinuxStandalone$ chmod +x thomasWasAlone

My problem was that I got an error when I tried to run it:
mike@sleepycat:~/Downloads/thomasLinuxStandalone$ ./thomasWasAlone
./thomasWasAlone: error while loading shared libraries: libGLU.so.1: cannot open shared object file: No such file or directory
[/code]

But its easy enough to fix:

mike@sleepycat:~/Downloads/thomasLinuxStandalone$ sudo apt-get install ia32-libs-multiarch:i386
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
...lots of packages and installation stuff...

And finally it works:

mike@sleepycat:~/Downloads/thomasLinuxStandalone$ ./thomasWasAlone
Set current directory to /home/mike/Downloads/thomasLinuxStandalone
Found path: /home/mike/Downloads/thomasLinuxStandalone/thomasWasAlone
Mono path[0] = '/home/mike/Downloads/thomasLinuxStandalone/thomasWasAlone_Data/Managed'
Mono path[1] = '/home/mike/Downloads/thomasLinuxStandalone/thomasWasAlone_Data/Mono'
Mono config path = '/home/mike/Downloads/thomasLinuxStandalone/thomasWasAlone_Data/Mono/etc'

Happy gaming!