Categories
Uncategorized

Centos 7 kickstart file

Do a clean Install of Centos 7, lets call this server hostname: base

Install apache on your base server, this will be the server hosting the kickstart file

yum install httpd -y
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --reload
firewall-cmd --list-all

On your Centos 7 base server, login as root

cd ~
ls -latr
anaconda-ks.cfg
cp anaconda-ks.cfg /var/www/html/ks.cfg
chown -R 755 /var/www/html/

Change the hostname=newhostname otherwise your new installation will have the same name as another server. In this case the new server hostname will be called production-svr

edit /var/www/html/ks.cfg 

network  --hostname=production-svr

Now, start your new server lets call this production-svr, boot from a usb disk, at boot menu press e

boot: linux ks=http://ipaddress/ks.cfg

Press enter and watch Centos 7 being installed without user interaction

Categories
Uncategorized

Install Python 3.9.5 from source

Run it as root

Install software requirements

yum install gcc openssl-devel bzip2-devel libffi-devel -y

Download Python 3.9.2 and extract files

mkdir downloads
cd downloads
wget https://www.python.org/ftp/python/3.9.5/Python-3.9.5.tgz
tar -xzf Python-3.9.5.tgz 
cd Python-3.9.5/

Compile and Install

Note: If you don’t have sudo permissions don’t use –enable-shared and change the –prefix to –prefix=/home/username/python3 (where python3 is the folder where you want the new Python to be installed.

./configure --prefix=/usr/local --enable-ipv6 --enable-loadable-sqlite-extensions --enable-optimizations --enable-shared
make altinstall

or this if you don't want enable-shared

./configure --prefix=/usr/local --enable-optimizations
make altinstall

With –eanabled-shared you will get the following eror

which python3
python3.9: error while loading shared libraries: libpython3.9.so.1.0: cannot open shared object file: No such file or directory

The fix

ldconfig /usr/local/lib

Or even better, create a python3.conf file and run ldconfig after that

cd /etc/ld.so.conf.d/
touch python3.conf
Add the following in python3.com
/usr/local/lib
Then run ldconfig

Create shortcut

ln -s /usr/local/bin/python3.9 /usr/bin/python3

Check again

which python3
/usr/bin/python3

Categories
Uncategorized

Remove GPG Keys: Centos 7

List Keys

rpm -qa gpg-pubkey

Find info about GPG Key. Check under Packager and verify if it’s the right key you want to remove

rpm -qi gpg-pubkey-460f3994-55f88609
Name        : gpg-pubkey
Version     : 460f3994
Release     : 55f88609
Architecture: (none)
Install Date: Thu 02 Apr 2020 06:12:34 AM EDT
Group       : Public Keys
Size        : 0
License     : pubkey
Signature   : (none)
Source RPM  : (none)
Build Date  : Tue 15 Sep 2015 04:56:41 PM EDT
Build Host  : localhost
Relocations : (not relocatable)
Packager    : Ceph.com (release key) <security@ceph.com>
Summary     : gpg(Ceph.com (release key) <security@ceph.com>)
Description :
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: rpm-4.11.3 (NSS-3)

Remove GPG Key

rpm -e --allmatches gpg-pubkey-460f3994-55f88609
Categories
Uncategorized

Remoove repos Centos 7

I had added a CEPH repo using the following command

rpm -Uhv http://download.ceph.com/rpm-octopus/el7/noarch/ceph-release-1-1.el7.noarch.rpm

Running yum update -y caused dependencies issues, so I had to remove the repo

First list which repos are installed

ls /etc/yum.repos.d/
rpm -qf /etc/yum.repos.d/ceph.repo

Remove the ceph repo

yum remove ceph-release-1-1.el7.noarch
yum clean all
yum update -y

All good now