Ubuntu 15.10 dependency issues

I ran into this when installing openframeworks 0.9 on Ubuntu 15.10

Don’t ask why I would use Ubuntu 15.10. Here’s the issue: when installing packages that OF requires, you’ll run into a dependency issue that doesn’t seem easy to solve. Unless you’re ready to take a little risk.

I’ve removed some ffmpeg package that seemed to be in the way:

sudo apt-get purge libavcodec-ffmpeg-extra56:amd64

which removes a few more packages and takes down ubuntustudio-audio and ubuntustudio-video. Wow, that sounds serious. But in the end the effects don’t seem that dramatic as this doesn’t really remove all the audio and video apps and when this is out of the way you’re ready to install all these packages that were previously incompatible.

Don’t ask why it works. It works.

Oh and before you run the openFrameworks installer, install ‘curl’. That will save you a couple of minutes down the road.


Out of the box

Getting stuff to work in Linux always used to involve a lot of thinking outside the box. Nowadays most common hardware works out of the box.

Just bought a dirt-cheap 69 Euro printer-copier-scanner and guess what? Everything just works!
Where are the days that everything in Linux was hard? When it took skill, stamina and lots of sleepless nights to get even the simplest thing working and reward you with a feeling you had really accomplished something?


Mind you, I’m not complaining. Getting a printer to work does not really address the skills I want to further develop. So again I’m happy to see that Linux has really matured.

As a last note: as far as I’m concerned, manufacturers can stop including driver DVDs and instead adopt the repository-based software install system used in many Linux distros, thus saving some extra bucks.

Ubuntu on Macbook Pro 9,2

My new Macbook Pro is at least four years newer than the old one but by their looks I wouldn’t be able to tell them apart. That is on the outside, of course. The inside is probably different, but that judgement is based solely on its specifications. For all I know, Apple could have shipped the old one with firmware that deliberately slows it down, makes the memory appear half its size and shrinks the usable disk space to a tenth of what it actually is, only to sell us a new model with higher specs. But let’s assume the insides have actually changed and I now have a 64-bit dual core i5, 8GB of RAM and some 750 GB of disk space.

The OS-X that comes with it is a new version as well. I don’t intend to use it a lot but it’s good to keep the firmware updated. That said, I need to make my machine dual-boot, or triple-boot, as my intention is to run Linux on it.

So let’s get to business. I will describe here why it took me over a day to get Linux to work on the new Macbook Pro and how you can do this in half an hour.

The main reason it took me so long to get this thing working is that the Macbook Pro 9,2 refused to recognise Linux boot loaders. On my Macbook Pro 5,3 I was used to press the ALT key during boot, which brings up a menu of bootable devices. On the 9,2 machine it only shows OS-X partitions and bootable DVDs.

Here is my recipe for installing Ubuntu 12.04 LTS and Ubuntu Studio 13.10 on the Macbook Pro 9,2.

Download the Ubuntu flavour of your choice, like Ubuntu, Xubuntu or Ubuntu Studio and burn the iso image on a DVD. I use the AMD 64-bit versions, which are good for Intel as well.

It may be possible to create a bootable USB drive, which will save you a DVD, but I didn’t manage to get the Macbook to recognise it. Maybe this will work after installing Refit but I didn’t try.

In OS-X, go to Applications/Utilities and find the Disk Utility. Use this to partition the hard disk. Shrink the OS-X partition to a reasonable size. I left 100 GB for OS-X, which on my drive means I have 650 GB left for several Linux installations and a shared data partition.

Boot into OS-X, get a Refit OS-X disk image (DMG) from Sourceforge.net and install it. If you have a fresh OS-X you’d have to go to the privacy settings in the Preferences menu first to allow it to install programs you didn’t get in the Apple Store.

Put the Ubuntu media (DVD or USB drive) into the Macbook and reboot while holding down the ALT key. Refit will offer you several boot options. Pick the one with the Ubuntu media and choose ‘Install’.

The Ubuntu install process gives you the opportunity to partition the free space you created on the hard disk by shrinking the OS-X partition. For this, you need to tick ‘Something else’ when you are asked how Ubuntu will be installed. Don’t go for the recommended ‘Install side by side with OS-X’ or something similar!

You will now partition the hard disk. I created two Linux partitions of 25 GB. One will be formatted as ext4 and be used as ‘/’, the root partition. The other is unused for now and will be available for e.g. another Linux install.

Create a large enough partition to hold your home folder, format as ext4 and have it mounted as ‘/home’.

Create a swap partition and a partition you will format as VFAT or something to serve as a means to exchange data between OS-X and Linux.

Continue the install process and install the boot loader in the root partition, something like /dev/sda4 or /dev/sda5. Refit will make it possible for the chain loader to find it there, later on.

The boot loader install always failed. My solution is to go to https://help.ubuntu.com/community/Boot-Repair and follow the instructions, which basically removes and re-installs grub and does some other tweaking. I assume you’d have to be running a live system of the same version as the in the boot partition you want boot-repair to install the boot-loader in. I’m not sure this is necessary but better be safe than sorry.

!!Note carefully in which root partition you let boot-repair position the boot loader! You can indicate this in the advanced menu!!

You’re now ready to reboot, hold down the ALT key and boot into your new Linux.

Good luck and if you have a better way, e.g. without having to install Refit, I hope you will share it with us.

Folding task lists in VIM

I create text files. Several types. Like a task list, a record of things I did and things not to forget when traveling.

Using folds in vim is a brilliant way to introduce some structure into these files whilst keeping the versatility of plain text.

As an example, take this list of activities:

* Flurks demo
  * record band
  * bounce tracks
  * merge audio/video
* website contents
  * ask colleagues about content and wishes
  * create mockup
  * make planning and cost estimation
* programming class preparation

Wouldn’t it be nice when it looked like this…

* Flurks demo
* website contents
* programming class preparation

… with hidden details that can be shown only when needed? Exactly that is realised with folds.

There are quite a few commands dealing with folds, but all you really need for a start are these:

zf+jump – creates a fold from the cursor to the jump, which can be any type of vim move, e.g. 3j moves 3 lines down, or first select a region and type zf
zo – open fold
zm – close fold
zM – close all folds
zR – open all folds (results in a plain text file)
zd – remove fold

So here’s what I would do to the given example:

+– 3 lines folded * Flurks demo ——-
+– 3 lines folded * website contents ——-
* programming class preparation

This is getting close to what I want but we’re not quite there yet.
First of all, we need a way to store our folds because I’d hate to lose them when I close the file. To this end, put the next two lines into your $(HOME)/.gvimrc file:

au BufWinLeave * mkview
au BufWinEnter * silent loadview

Then there is a cosmetic aspect. In this example I prefer not to see how many lines are folded. I just want to see the first line of the fold, as that is the line containing the subject. For this we create a custom display function and make the foldtext variable which normally points to the foldtext() function point to our newly created function:

function! CustomFoldDisplay()
return getline(v:foldstart)

setlocal foldtext=CustomFoldDisplay()

DONE. The result: a task list with two folds:

* Flurks demo
* website contents
* programming class preparation

Try it. I hope this was helpful for you.

Focus follows mouse

A graphical desktop environment that does not support “focus follows mouse” is crippled.

The OS-X UI is a good example of a flawed user interface. The fact that the application that has mouse focus is always on top is IMHO a design flaw which, together with the fact that applications can only get focus with a mouse click, renders the entire OS-X UI useless.

I’m so happy with unbloated unobtrusive Linux desktops that simply do what they need to do without limiting the user’s freedom .

Stubborn keyboard

As VI (or actually VIM) is my main editor, I rely on a properly functioning keyboard. After installing Ubuntu 11.10, no after installing Ubuntu 11.10, quickly disabling the dreaded and impossible-to-use Unity and booting into Gnome, I could no longer use several keys like tilde (~) and single and double quotes.

The solution I found is this:

setxkbmap -layout us

And put this in your .profile.

There’s another useful addition: disable the SHIFT LOCK. This key that just takes space on the keyboard and is IMHO utterly useless, causes unnecessary typos by accidentally setting the keyboard entry to uppercase. To disable it, use xmodmap. One way I found that works is as follows:

xmodmap -e "keycode 66 = "

Add that line literally (including the spaces) to your .profile.

Disappearing scrollbars –solved–

Finally I have my normal scrollbars back. After upgrading to Ubuntu 11.10 I was suddely left with scrollbars that disappear all the time. The only way to make them appear is guessing where the pointer is, then putting the mouse cursor precisely on that pointer to enable you to scroll. This was driving me insane!

To remove this rubbish:

sudo apt-get remove overlay-scrollbar
sudo apt-get autoremove --purge liboverlay-scrollbar-*

It seems that just a restart of X is not enough so I restarted my system and have normal scrollbars again that do what they need to do.

Ubuntu when do you stop packaging all these unpleasant surprises as default selections?

Here’s where I found the solution: scrollbar