Dizwell Informatics

News from Nowhere

Atlas – Installing Oracle on Ubuntu 16+

1.0 Introduction

There was a time, back in the early and mid-2000s, when Ubuntu seemed unstoppably the distro of choice. It regularly topped the rankings at DistroWatch by large margins, for example. It had typographical elegance; it was built on Debian, so was highly stable and had a huge application library behind it; but it laid a thick veneer of usability and user-friendliness on top of that illustrious heritage.

These days, not so much: Ubuntu decided to get experimental -and, frankly, a bit weird– around the late 2000s. Instead of using vanilla Gnome, it decided to invent its own GUI interface (called ‘Unity’, which is ironic). Instead of using the same replacement for the X graphical server that everyone else had signed up to using (“Wayland”), it decided to roll its own replacement (“Mir”). It then thought that sending your desktop searches to Amazon was a good idea, to the point that the founder of GNU (Richard Stallman) called Ubuntu ‘spyware’. As a consequence of all such shenanigans, Ubuntu began a slow and steady decline in popularity, swiftly slipping behind Linux Mint in the DistroWatch ratings. At the time of writing, it is currently third on DistroWatch’s rankings, behind even (irony of ironies) Debian.

Still, it’s not a bad distro, to the point that I made it my desktop of choice for a while -and the website you’re reading right now is still running on an Ubuntu server. Whatever the future holds for Ubuntu, therefore, it’s still nice to report that Atlas runs on all Ubuntu versions since 15.10 to make an Oracle 12c installation mostly straightforward.

As is the case with all Atlas/Oracle installs, of course, your Ubuntu server needs to be built with at least 5GB RAM and at least a 40GB hard disk.

Please watch the generic Atlas videos here, here and here to get an idea of how Atlas works in general. The generic documentation (including those videos) are available from this page. Below are Ubuntu-specific notes.

2.0 What’s been tested?

  • Ubuntu 16.04 (initial, .1 and .2 updates)
  • Ubuntu 16.10
  • Ubuntu 17.04

Both Oracle 12c Release 1 and Release 2 work successfully on these distros.

Note that I don’t test the various ‘flavours’ of Ubuntu that exist -such as Lubuntu, Xubuntu, Kubuntu and probably any other letter-of-the-alphabet-buntu you can think of. But I did a quick run-through with Xubuntu 16.04.1 (just for laughs), and it worked. So I expect that if it works on Ubuntu proper, it ought to work on any other equivalent variant, but I haven’t tested it rigorously to find out if that is true in all cases.

3.0 Operating System media

Bear in mind that Ubuntu comes in two ‘types’ when you visit the distro’s download pages: Desktop and Server. The Server type is command-line only (to which you can manually add a GUI, of course, if you felt like it). The Desktop type comes with the Unity-based desktop environment out-of-the-box. It is the Desktop version that Atlas expects you to be using.

I got my Ubuntu installation ISO from here (it’s much faster than the mirror offered by the official site, for me at least). My Xubuntu ISO was downloaded from here.

4.0 Operating System installation issues

There are no surprises with the OS installation. You can accept all the defaults and just click your way through to completion.

The default option at this point, for example:

…is not to download updates -and that is fine. If you choose to change the default and switch updates on during the installation itself, the install process will take a lot longer than normal… but Atlas (and Oracle) will still work. It’s therefore up to you, but the default option works just fine.

For disk partitioning:

The default option here is simply to ‘erase the disk’. That can safely be accepted: you will get a simple ‘everything in one root volume’ partitioning scheme which Atlas will find entirely acceptable. If you decide to go the ‘something else’ path and cook up your own partitioning scheme, remember that Atlas wants a ‘big root’ to work with (at least 25GB of free space on the ‘/’ mount point, basically).

No wmctrl or xdotool utilities are installed by default, so you need to add that to Ubuntu after the O/S installation is complete and before you try running Atlas:

sudo apt-get install wmctrl

…will do the job.

I found I was able to scale the display on my Ubuntu VirtualBox VMs without needing to install any Guest Additions, so getting a screen resolution high enough for Atlas (at least 1200 x 750) was not an issue.

Note that with Xubuntu, I could not scale the display without installing the guest additions first. And in turn, I couldn’t install the guest additions until I had done a
                 sudo apt install build-essential module-assistant
followed by a
                 sudo m-a prepare
and finally (with the guest additions cd ‘inserted’ into the VM) a
                 sudo /media/hjr/VBOXADDITIONS_5.1.10_112026/VBoxLinuxAdditions.run
Exact paths will, of course, vary depending on your user name and VirtualBox version. But I expect similar workarounds may be necessary to get appropriately-high screen resolutions on other non-Unity flavours of Ubuntu.

5.0 Running Atlas

Assuming you’ve installed wmctrl (or xdotool) and have a big enough screen resolution, therefore, acquiring and running Atlas is straightfoward:

wget https://bit.do/dizatlas -O atlas.sh
chmod +x atlas.sh

…after which, I simply followed the prompts.

Note that as part of its work, Atlas installs gcc-4.9 and g++-4.9:

A complex series of switcheroo-games is then played to make sure that gcc-4.9 becomes the default gcc version in use. This is needed to get the Oracle binaries to link (or compile) correctly. After Oracle has been installed correctly, you may want to issue these commands to switch the version back to the version that the distro ships with:

sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 100
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 100
sudo update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-6 100

sudo update-alternatives --set g++ /usr/bin/g++-6
sudo update-alternatives --set gcc /usr/bin/gcc-6
sudo update-alternatives --set cpp-bin /usr/bin/cpp-6

But don’t go issuing those commands until AFTER Oracle 12c has been installed and is working correctly.

Additionally, be aware that if you switch back to the default versions after Oracle has been installed, you won’t be able to patch Oracle 12c (because the wrong compiler version will be in use once again). Of course, given that you’re running on an unsupported distro, it’s unlikely you’ll be patching Oracle 12c any time soon (since obtaining patches requires a support contract!), but if you were thinking of it, just be aware that patching requires the 4.9 version of gcc, g++ and cpp to be the system-wide defaults.

6.0 Installing Oracle 12c

Oracle installation on Ubuntu usually starts by warning you that your system is not adequate for the task:

The warning is a red herring, however, and it is perfectly OK to click [Yes] at this point to continue the installation regardless. You mostly just keep clicking [Next] after that!

Sadly, however, it remains the case that Ubuntu is one of the few distros these days to throw errors during the installer’s ‘linking phase’:

As you can see, you get a pop-up at around the 59% mark, claiming that there’s a problem with compiling the ins_rdbms.mk makefile. As you can also see, however: your response to this error is to open a new terminal window and change directory to the oracle user’s Documents directory. There, you’ll find an ‘atlas-fixup.sh’ shell script, previously created by Atlas.

Note that the file is already executable: Atlas created it that way. You can therefore run that script now, as yourself, using the following command:


The script takes practically no time at all to run, but indicates it has completed by putting a big pop-up dialog box in the middle of your screen:

So now you do what the pop-up tells you to do: click [OK] to dismiss this new pop-up itself, switch back to the error message dialog generated by the original Oracle installer …and there click the [Retry] button.

Do all of that, and you’ll see that the linking phase resumes… and completes without further incident:

After that, the Oracle installation follows its usual path: you are asked to run two scripts as root, so you can just prefix the script path/names the Oracle dialog gives you with “sudo” to achieve that.

Note that if you elected to create a new, dedicated oracle user when first running Atlas (instead of using the default option of making yourself the oracle user), using sudo in this way will not be possible, because Atlas doesn’t make new users members of the sudo-capable group by default.

If that happens to you, the trick is to use “su – <username>” to become the original non-root user (the user account specified when you first installed the operating system), and only then to prefix the path/filenames with the sudo command. That is, make the oracle user become someone who can sudo things, and run the root scripts as that other user with sudo prefixes.

You could alternatively just make the oracle user a sudo-capable user (by issuing the sudo adduser <username> sudo command), but that would not be a particularly secure way to do things: I don’t like my oracle users having more powers than they need strictly to run a database!

Once the database has been created for you, you should be able to immediately log on and see visually-pleasing results:

The key point here is that, since there were linking errors that required you to run a fixup script, there is no Atlas-created post-install script to be run, as there would be with many other distros. Therefore, SQL*Plus is already configured to display line lengths and page sizes sensibly.

Incidentally: the command you see me typing in that last screenshot (“sql“) is the alias of the full command (“sqlplus / as sysdba“). It is aliased with a reference to the rlwrap utility, so that if you get into SQL*Plus using it, you can press the up and down cursor keys to retrieve and scroll through any previous SQL commands you’ve typed. If you ever need the vanilla, un-rlwrapped version of SQL*Plus, however, then just type the full-blown sqlplus  command and you’ll be running the exact same program as before but without a command line history.

Here are is the screenshot showing that Atlas works with at least one other flavour of Ubuntu to achieve similar successful Oracle outcomes (this one is Xubuntu 16.04.1):

And this one’s Lubuntu 16.10: