How to Install Spacewalk on Oracle Linux

Spacewalk is an open source Linux systems management solution. Spacewalk manages software content updates for Red Hat derived distributions such as Fedora, CentOS, and Scientific Linux, within your firewall. You can stage software content through different environments, managing the deployment of updates to systems and allowing you to view at which update level any given system is at across your deployment. A central web interface allows viewing of systems, their associated software update status, and initiating update actions.

Spacewalk also provides provisioning capabilities, allowing you to manage your systems throughout their lifecycle. Via Provisioning, Spacewalk enables you to kickstart provision systems and manage and deploy configuration files. Spacewalk also has virtualization capabilities to enable you to provision, control, manage, and monitor virtual KVM and Xen guests.

Spacewalk is an open community project. Anyone can contribute to the project, including lending a hand with ideas, feedback, contributing a patch, helping draft documentation, sharing your systems management use cases, or even testing.

This article explains how to install Spacewalk on Oracle Linux. You do not need a support contract for Oracle Linux to use this method.

  • Server Prerequisites
  • Repositories
  • Install Spacewalk
  • Spacewalk Console


Server Prerequisites

Start with a minimum installation of Oracle Linux 6 or 7. You can add the desktop packages if you want, but they are not necessary. Once the OS installation is complete, perform the following tasks as the "root" user.
Make sure the Spacewalk server has a fully qualified domain name, with an entry in the "/etc/hosts" file.     ol7-sw.localdomain ol7-sw

Make the necessary firewall changes.
# OL7
firewall-cmd --add-service=https --permanent
firewall-cmd --add-service=http --permanent
firewall-cmd --reload

# OL6
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
service iptables save



You will need to install a few repositories before you get started.

Enable the Oracle Linux optional packages repository. For example, on Oracle Linux 7 set "enabled=1" in the following entry of the "/etc/yum.repos.d/public-yum-ol7.repo" file.

name=Oracle Linux $releasever Optional Latest ($basearch)

Install the EPEL repository for your version.
# OL7
rpm -Uvh

# OL6
rpm -Uvh

Add the JPackage repository.
cat > /etc/yum.repos.d/jpackage-generic.repo << EOF
name=JPackage generic
subscription-manager repos –enable=rhel-7-server-optional-rpms

Add the Spacewalk repository for your version.
# OL7
rpm -Uvh

# OL6
rpm -Uvh


Install Spacewalk

To keep things simple, we'll do a default installation using postgreSQL as the Spacewalk database.
# Configure the Spacewalk database.
yum install spacewalk-setup-postgresql -y

# Install Spacewalk
yum install spacewalk-postgresql -y

Create an answer file for the configuration of Spacewalk, adjusting the values as required.
cat > /tmp/answer-file.txt <

Configure Spacewalk using the answer file created previously.
spacewalk-setup --answer-file=/tmp/answer-file.txt
You can restart the Spacewalk service using the following commands.
/usr/sbin/spacewalk-service stop
/usr/sbin/spacewalk-service start

/usr/sbin/spacewalk-service restart
You can now access the Spacewalk console using the following URL on the server.
If you want the console to be accessible externally, amend the
"/etc/tomcat/server.xml" file as follows.
# From
# To
Restart Spacewalk.
/usr/sbin/spacewalk-service restart


Spacewalk Console

The first time you go to the Spacewalk URL you will be prompted to create a new organization with administrator login credentials. Enter the required information and click the "Create Organization" button.

You are now able to start using Spacewalk. 



Basic Usage (Repositories, Channels and Clients)


Create a Channel with a Repository

Create a new channel by navigating to the "Create Channel" page.
  • Channels (tab)
  • Manage Software Channels (left menu)
  • + Create Channel (link)
Enter the following details and click the "Create Channel" button.
Channel Name*: ol7_x86_64 Channel Label*: ol7_x86_64 Parent Channel: None Architecture: x86_64 Yum Repository Checksum Type: sha1 Channel Summary*: Oracle linux 7 x86_64 Create a new repository by navigating to the "Create Repository" page.
  • Channels (tab)
  • Manage Software Channels (left menu)
  • Manage Repositories (left Menu)
  • Create Repository (link)
Enter the following details and click the "Create Repository" button.

Repository Label*: ol7_x86_64 Repository URL*:
You can create multiple repositories like this and associate them to a single channel.
Create an activation key for the channel by navigating to the "Create Activation Key" page.
  • Systems (tab)
  • Activation Keys (left menu)
  • + Create Keys (link)
Enter the following details and click the "Create Activation Key" button.
Description: ol7_x86_64 Base Channels: ol7_x86_64
Link the required repositories to the channel by navigating to the "Repositories" tab for the channel "Channel Repositories" page.
  • Channels (tab)
  • Manage Software Channels (left menu)
  • Channel Name (ol7_x86_64)
  • Repositories (tab)
Check the required repositories and click the "Update Repositories" button.
Sync the "ol7_x86_64" repository by navigating to the "Channel Repositories" page.
  • Channels (tab)
  • Manage Software Channels (left menu)
  • Channel Name (ol7_x86_64)
  • Repositories (tab)
  • Sync (sub-tab)
Check any required options and click the "Sync Now" button. This will download all the packages in the repository, so it could take a long time to complete.

Once it's complete, test the channel. If everything is OK, you should probably set a scheduled sync of the repository using the same page where you clicked the "Sync Now" button.


Register a Client

Install the EPEL repository for your version.
# OL7 rpm -Uvh # OL6 rpm -Uvh
Add the Spacewalk client repository for your version.
# OL7 rpm -Uvh # OL6 rpm -Uvh
Install the client tool packages.
yum install rhn-client-tools rhn-check rhn-setup rhnsd m2crypto yum-rhn-plugin Install the trusted SSL certificate from the Spacewalk server.
rpm -Uvh http://ol7-sw.localdomain/pub/rhn-org-trusted-ssl-cert-1.0-1.noarch.rpm
Get the activation key associated with the Spacewalk channel "Systems (tab) > Activation keys (left menu)". Register the client machine with the spacewalk server, adjusting the serverUrl and activationkey parameter to your settings.

rhnreg_ks --serverUrl=https://ol7-sw.localdomain/XMLRPC --sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT --activationkey=1-7ec972226fd80652dbd58ce4ce11a59e Click on the "Systems" tab in the Spacewalk console and the client machine will be listed in the "System Overview" page.


Update Client Packages

Navigate to the "Upgradable Packages" page.
  • Systems (tab)
  • System Name (ol7-sw-client.localdomain)
  • Software (tab)
  • Packages (sub-tab)
  • Upgrade Packages (link)
  • Sync (sub-tab)
Click on the "Select All" button and click the "Upgrade Packages" button.

At the bottom of the resulting page, accept the "Schedule no sooner than:" setting and click the "Confirm" button.

The update will happen the next time the client polls the Spacewalk server. You can force the client to poll the server by logging into the client and issuing the following command as the "root" user.
Like This Article ? :

We encourage healthy criticism, so do not hesitate to leave your thoughts in comment box.