How to install Python 3 on Oracle Linux

You can install Python 3 on your Oracle Linux 7 environment with three simple steps:

  1. sudo yum install -y yum-utils
  2. sudo yum-config-manager --enable *EPEL
  3. sudo yum install -y python36

As a first step, in case you don’t have it yet on your system, is to install the yum-utils package. This package includes the yum-config-manager which allows you to easily enable and disable yum repositories, amongst other tasks.

[gerald@localhost ~]$ sudo yum install -y yum-utils
Loaded plugins: langpacks, ulninfo
Resolving Dependencies
--> Running transaction check
---> Package yum-utils.noarch 0:1.1.31-46.0.1.el7_5 will be updated
---> Package yum-utils.noarch 0:1.1.31-50.0.1.el7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================
Updating:
yum-utils noarch 1.1.31-50.0.1.el7 ol7_latest 121 k

Transaction Summary
=====================================================================================================================================
Upgrade 1 Package

Total download size: 121 k
Downloading packages:
No Presto metadata available for ol7_latest
yum-utils-1.1.31-50.0.1.el7.noarch.rpm | 121 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : yum-utils-1.1.31-50.0.1.el7.noarch 1/2
Cleanup : yum-utils-1.1.31-46.0.1.el7_5.noarch 2/2
Verifying : yum-utils-1.1.31-50.0.1.el7.noarch 1/2
Verifying : yum-utils-1.1.31-46.0.1.el7_5.noarch 2/2

Updated:
yum-utils.noarch 0:1.1.31-50.0.1.el7

Complete!
[gerald@localhost ~]$

Python 3 ships as part of the EPEL (Extra Packages for Enterprise Linux) repository but that repository is not enabled by default. With yum-config-manager enabling that repository is easy:



[gerald@localhost ~]$ sudo yum-config-manager --enable *EPEL
Loaded plugins: langpacks
===================================================== repo: ol7_developer_EPEL ======================================================
[ol7_developer_EPEL]
async = True
bandwidth = 0
base_persistdir = /var/lib/yum/repos/x86_64/7Server
baseurl = https://yum.oracle.com/repo/OracleLinux/OL7/developer_EPEL/x86_64/
cache = 0
cachedir = /var/cache/yum/x86_64/7Server/ol7_developer_EPEL
check_config_file_age = True
compare_providers_priority = 80
cost = 1000
deltarpm_metadata_percentage = 100
deltarpm_percentage =
enabled = 1
enablegroups = True
exclude =
failovermethod = priority
ftp_disable_epsv = False
gpgcadir = /var/lib/yum/repos/x86_64/7Server/ol7_developer_EPEL/gpgcadir
gpgcakey =
gpgcheck = True
gpgdir = /var/lib/yum/repos/x86_64/7Server/ol7_developer_EPEL/gpgdir
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
hdrdir = /var/cache/yum/x86_64/7Server/ol7_developer_EPEL/headers
http_caching = all
includepkgs =
ip_resolve =
keepalive = True
keepcache = False
mddownloadpolicy = sqlite
mdpolicy = group:small
mediaid =
metadata_expire = 21600
metadata_expire_filter = read-only:present
metalink =
minrate = 0
mirrorlist =
mirrorlist_expire = 86400
name = Oracle Linux 7Server Development Packages (x86_64)
old_base_cache_dir =
password =
persistdir = /var/lib/yum/repos/x86_64/7Server/ol7_developer_EPEL
pkgdir = /var/cache/yum/x86_64/7Server/ol7_developer_EPEL/packages
proxy = False
proxy_dict =
proxy_password =
proxy_username =
repo_gpgcheck = False
retries = 10
skip_if_unavailable = False
ssl_check_cert_permissions = True
sslcacert =
sslclientcert =
sslclientkey =
sslverify = True
throttle = 0
timeout = 30.0
ui_id = ol7_developer_EPEL/x86_64
ui_repoid_vars = releasever,
basearch
username =

[gerald@localhost ~]$

Now you are ready to install Python 3, version 3.6 in this case:


[gerald@localhost ~]$ sudo yum install -y python36
Loaded plugins: langpacks, ulninfo
ol7_UEKR4 | 1.2 kB 00:00:00
ol7_developer_EPEL | 1.2 kB 00:00:00
ol7_latest | 1.4 kB 00:00:00
(1/2): ol7_developer_EPEL/x86_64/updateinfo | 2.4 kB 00:00:00
(2/2): ol7_developer_EPEL/x86_64/primary | 8.0 MB 00:00:05
ol7_developer_EPEL 24145/24145
Resolving Dependencies
--> Running transaction check
---> Package python36.x86_64 0:3.6.6-1.el7 will be installed
--> Processing Dependency: python36-libs(x86-64) = 3.6.6-1.el7 for package: python36-3.6.6-1.el7.x86_64
--> Processing Dependency: libpython3.6m.so.1.0()(64bit) for package: python36-3.6.6-1.el7.x86_64
--> Running transaction check
---> Package python36-libs.x86_64 0:3.6.6-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================
Installing:
python36 x86_64 3.6.6-1.el7 ol7_developer_EPEL 65 k
Installing for dependencies:
python36-libs x86_64 3.6.6-1.el7 ol7_developer_EPEL 8.6 M

Transaction Summary
=====================================================================================================================================
Install 1 Package (+1 Dependent package)

Total download size: 8.6 M
Installed size: 36 M
Downloading packages:
(1/2): python36-3.6.6-1.el7.x86_64.rpm | 65 kB 00:00:00
(2/2): python36-libs-3.6.6-1.el7.x86_64.rpm | 8.6 MB 00:00:08
-------------------------------------------------------------------------------------------------------------------------------------
Total 1.0 MB/s | 8.6 MB 00:00:08
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : python36-3.6.6-1.el7.x86_64 1/2
Installing : python36-libs-3.6.6-1.el7.x86_64 2/2
Verifying : python36-libs-3.6.6-1.el7.x86_64 1/2
Verifying : python36-3.6.6-1.el7.x86_64 2/2

Installed:
python36.x86_64 0:3.6.6-1.el7

Dependency Installed:
python36-libs.x86_64 0:3.6.6-1.el7

Complete!
[gerald@localhost ~]$

You can verify the installation via python36 --version:

[gerald@localhost ~]$ python36 --version
Python 3.6.6
[gerald@localhost ~]$

Setting up Docker on Oracle Linux 7

Docker has become widely popular in the last couple of years. I use it on a regular basis these days for running Oracle databases on my laptop. Docker is available on all popular Linux distributions, as well as Mac and Windows, and of course Oracle Linux is no exception. Since a long time Docker ships with the Oracle Linux 7 addons yum repository. Having setup Docker on Oracle Linux numerous times, I thought it would be good for me to document my steps for others to follow.

tl;dr

  1. Update Oracle Linux and UEK to the latest version (OL 7 and UEK5): yum upgrade
  2. Install yum-config-manager, if not already installed: yum install yum-utils
  3. Enable the addons yum repo: yum-config-manager --enable *addons
  4. Install docker-engine: yum install docker-engine

Continue reading “Setting up Docker on Oracle Linux 7”

Upgrading UEK kernel on Oracle Linux 7

linux_penguin_with_logoIn general I work almost exclusively on Macs these days. However, for work and various other reasons I always tend to have a VM with Linux on my Mac to test, run, script things. My VM runs Oracle Linux (OL) on VirtualBox. Oracle Linux just makes a lot of sense for me as we run everything on Oracle Linux internally and in general it is a solid Linux distribution. Of course, once in a while I have to update my Linux version as well to make sure that my Linux environment remains on the latest and greatest. Right now is such a time again as Oracle Linux 7 Unbreakable Enterprise Kernel 5 just released. In the past I was always a bit scared about upgrading kernels because I had little clue of what I was doing. 🙂 Turns out that it is a lot easier than one might think, and here is how you do it:

tl;dr

  1. Download new repo list: wget http://yum.oracle.com/public-yum-ol7.repo
  2. Enable the new repo: yum-config-manager --enable ol7_UEKR5
  3. Upgrade the environment: yum upgrade
  4. Reboot the environment: reboot

Continue reading “Upgrading UEK kernel on Oracle Linux 7”