Loading...
 

How to upgrade a fresh install of CentOS to ClearOS

Determine if CentOS and ClearOS are at the same version

About CentOS vs ClearOS version mismatch: When a new version of CentOS is released, it takes a few weeks for ClearOS to review all the apps, and to release an update. During this period, you need to use an alternate script, which activates some testing repositories.

If they are at the same version

1.1.1. Open up a new file

Login via SSH as root user and do the following:

nano cos7.sh

1.1.2. Copy-paste code below depending on your ClearOS version

taken from http://static.clearsdn.com/1.0/ovh/cos7.sh
#!/bin/bash -x

(
ARCH=`arch`

# Prep release and repos
rpm -Uvh http://download2.clearsdn.com/marketplace/cloud/7/noarch/clearos-release-7-current.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-ClearOS-7

# Install and upgrade
yum --enablerepo=* clean all
yum --enablerepo=clearos-centos -y install app-base
yum --enablerepo=* clean all
service webconfig stop
yum --enablerepo=clearos-centos,clearos-centos-updates -y install app-accounts app-configuration-backup app-date app-dns app-edition app-events app-incoming-firewall app-groups app-language app-log-viewer app-mail app-marketplace app-process-viewer app-software-updates app-ssh-server app-support app-user-profile app-users

# Default networking
yum -y remove NetworkManager
echo "DEVICE=eth0" > /etc/sysconfig/network-scripts/ifcfg-eth0
echo "TYPE=\"Ethernet\"" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "ONBOOT=\"yes\"" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "USERCTL=\"no\"" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "BOOTPROTO=\"dhcp\"" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "PEERDNS=\"no\"" >> /etc/sysconfig/network-scripts/ifcfg-eth0

echo "nameserver 8.8.8.8" > /etc/resolv-peerdns.conf
echo "nameserver 8.8.4.4" >> /etc/resolv-peerdns.conf

sed -i -e 's/^GATEWAYDEV=.*/GATEWAYDEV="eth0"/' /etc/sysconfig/network
sed -i -e 's/^EXTIF=.*/EXTIF="eth0"/' /etc/clearos/network.conf

service syswatch restart

# Enable firewall
allow-port -p TCP -d 22 -n SSH
allow-port -p TCP -d 81 -n Webconfig
sed -i -e 's/^MODE=.*/MODE="standalone"/' /etc/clearos/network.conf

# Start webconfig
service webconfig start

) 2>&1 | tee /var/log/clearos-installer.log

# Reboot
reboot

1.1.3. Run the script

chmod 755 cos7.sh 
./cos7.sh

If CentOS is more recent than ClearOS

1.1.1. Open up a new file

Login via SSH as root user and do the following:

nano cos7.sh


1.1.2. Copy-paste code below

taken from http://static.clearsdn.com/1.0/ovh/cos7.sh and slightly modified
#!/bin/bash -x

(
ARCH=`arch`

# Prep release and repos
rpm -Uvh http://download2.clearsdn.com/marketplace/cloud/7/noarch/clearos-release-7-current.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-ClearOS-7

# Install and upgrade
yum --enablerepo=* clean all
yum --enablerepo=clearos-centos,clearos-updates,clearos-updates-testing -y install app-base
yum --enablerepo=* clean all
service webconfig stop
yum --enablerepo=clearos-centos,clearos-updates,clearos-updates-testing -y install app-accounts app-configuration-backup app-date app-dns app-edition app-events app-incoming-firewall app-groups app-language app-log-viewer app-mail app-marketplace app-process-viewer app-software-updates app-ssh-server app-support app-user-profile app-users

# Default networking
yum -y remove NetworkManager
echo "DEVICE=eth0" > /etc/sysconfig/network-scripts/ifcfg-eth0
echo "TYPE=\"Ethernet\"" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "ONBOOT=\"yes\"" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "USERCTL=\"no\"" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "BOOTPROTO=\"dhcp\"" >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo "PEERDNS=\"no\"" >> /etc/sysconfig/network-scripts/ifcfg-eth0

echo "nameserver 8.8.8.8" > /etc/resolv-peerdns.conf
echo "nameserver 8.8.4.4" >> /etc/resolv-peerdns.conf

sed -i -e 's/^GATEWAYDEV=.*/GATEWAYDEV="eth0"/' /etc/sysconfig/network
sed -i -e 's/^EXTIF=.*/EXTIF="eth0"/' /etc/clearos/network.conf

service syswatch restart

# Enable firewall
allow-port -p TCP -d 22 -n SSH
allow-port -p TCP -d 81 -n Webconfig
sed -i -e 's/^MODE=.*/MODE="standalone"/' /etc/clearos/network.conf

# Start webconfig
service webconfig start

) 2>&1 | tee /var/log/clearos-installer.log

# Reboot
reboot

1.1.3. Run the script

chmod 755 cos7.sh 
./cos7.sh

1.1.4. Periodically check if ClearOS has caught up

https://example.org:81/app/software_repository will report "Consider disabling "clearos-updates-testing" repository. It is intended for developers, beta testers and advanced users only." So once ClearOS has caught up, you should disable this repository.

Note: the 'software repository' needs to be installed via the marketplace first.

Also if some apps in the marketplace doesnt install properly it may be due to some repositories being disabled. Make sure that, in the software repository screen, the clearos-centos and clearos-updates are enabled. After installing the apps you can safely disable the repos.