Adding a new repository to Oracle Linux

When I first install Oracle Linux 8 a lot of software I want to use isn’t available. But we can fix this by adding another repository.

First of all, create a new file in /etc/yum.repos.d:

sudo nano /etc/yum.repos.d/ol8-epel.repo

Then add the following to the file:

[ol8_developer_EPEL]
name= Oracle Linux $releasever EPEL ($basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL8/developer/EPEL/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

Issue the following command to start using the new repository:

sudo dnf makecache

Then try and install some software that wasn’t previously available:

sudo dnf install -y byobu neofetch

This gives me access to a lot of software that makes computers feel like my computers.

Building a private cloud with LXD

I’ve been doing some experiments with LXD on Ubuntu and I thought it was worth publishing some of the notes I made myself so that when I come back to this at a later date I can remember what I did.

LXD is described as:

LXD (pronounced lex-dee) is the lightervisor, or lightweight container hypervisor. LXC (lex-see) is a program which creates and administers “containers” on a local system. It also provides an API to allow higher level managers, such as LXD, to administer containers. In a sense, one could compare LXC to QEMU, while comparing LXD to libvirt.

(from https://ubuntu.com/server/docs/containers-lxd)

To install:

sudo snap install lxd
sudo lxd init

Then answer some questions about where you want to store things and what file system to use.

Finding images

For Ubuntu, the syntax is:

lxc image list ubuntu:focal

(replace focal with the name of the version you are interested in)

For non-Ubuntu images, you’ll need to search https://uk.images.linuxcontainers.org/. This shortens to images So for an Oracle Linux 8 image we would type:

lxc image list images:oracle/8

Creating containers

To do this we need to tell LXC which image to build the container from and what to call it. For an Oracle Linux 8 container with the name oracle-01 we would type:

lxc launch images:oracle/8 oracle-01

Once it’s built (it shouldn’t take long) we can connect to it by using the following command:

lxc exec oracle-01 -- bash

The containers are very minimal, and I found myself having to install aditional software before I could set them up to work in the way I like (nano and wget were both missing for example).

Stopping and starting containers

I’m very used to working with Multipass, so the commands for LXD are very similar.

Start a container:

lxc start <container_name>

Stop a container:

lxd stop <container_name>

Delete a container:

lxd delete <container_name>

Viewing your current containers

The command to issue is:

lxc list

You will get to see which containers are running (with their IP address) and which containers you have that have been built but are not running.

That’s about as far as I’ve got with building the latest part of my private cloud. I’ve also been working on using Oracle’s cloud as a location for my backups, but I’ll write about that another day.

Notes on my experiments with Oracle Cloud

This Christmas I set up two small VMs in Oracle’s cloud; one running Oracle Linux 8 (which I’m trying to learn at the moment), and one running Ubuntu (with my standard VM/container build). I’ve written these notes largely for me, but maybe someone else might find them useful too.

Registering for Oracle Cloud

To sign up for Oracle Cloud go to https://www.oracle.com/cloud/free/.

You’ll need a credit card, but it won’t be charged providing you only use things marked as always free. This gets you two VMs, with 1 GB of RAM each and 100 GB of storage. That’s more than enough for what I need to do here so it’s all good. You also get signed up for a trial which allows you to build much bigger machines and access more services. I’ve not tried this out yet, but it’s possible to go all the way up to VMs with 64 GB of RAM or bare metal machines with a lot more (which is basically what I want to build at home at some point soon).

See here for exactly what the free tier gets you.

Using Oracle Cloud

To build VMs and generally interact with the service log in at Oracle Cloud. The first time you create a VM you’ll be asked to generate an SSH key (or provide one). Download the private key and save it somewhere, and then chmod it to 500 (otherwise it won’t let you log in). The key can be used for more than one VM, so you should only need to go through this process once.

You can see all your instances at https://console.uk-london-1.oraclecloud.com/compute/instances – This works for anything in the London data centre but would need to be amended for other data centres.

Logging in to a VM

To log in open up a terminal and SSH to the VM. The syntax is:

ssh -i /path/to/key/ username@ip_address

Where /path/to/key/ is the location you saved your private key. Username and IP address will be in the Instance Access section of the Instance Details for the specific VM.

Full instructions are available on the Oracle Cloud website.

First thoughts

The Ubuntu VM was indistinguishable from what I’m used to, and all my usual software and scripts worked fine. I’m less familiar with Oracle Linux, but installing and updating software works as expected so I have no reason to believe that the experience will be that different from a locally installed server. I still don’t find Oracle Linux anywhere near as easy to use as Ubuntu, but I suspect that’s as much down to 15 years less experience as anything else.