You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.3 KiB
39 lines
1.3 KiB
4 years ago
|
#!/bin/bash -eux
|
||
|
echo "Remove development and kernel source packages"
|
||
|
dnf -y remove gcc cpp gc kernel-devel kernel-headers glibc-devel elfutils-libelf-devel glibc-headers kernel-devel kernel-headers
|
||
|
|
||
|
echo "remove orphaned packages"
|
||
|
dnf -y autoremove
|
||
|
|
||
|
echo "Remove previous kernels that preserved for rollbacks"
|
||
|
dnf -y remove -y $(dnf repoquery --installonly --latest-limit=-1 -q)
|
||
|
|
||
|
# Avoid ~200 meg firmware package we don't need
|
||
|
# this cannot be done in the KS file so we do it here
|
||
|
echo "Removing extra firmware packages"
|
||
|
dnf -y remove linux-firmware
|
||
|
|
||
|
echo "clean all package cache information"
|
||
|
dnf -y clean all --enablerepo=\*
|
||
|
|
||
|
echo "truncate any logs that have built up during the install"
|
||
|
find /var/log -type f -exec truncate --size=0 {} \;
|
||
|
|
||
|
echo "Remove any non-loopback network configs"
|
||
|
find /etc/sysconfig/network-scripts -name "ifcfg-*" -not -name "ifcfg-lo" -exec rm -f {} \;
|
||
|
|
||
|
echo "remove the install log"
|
||
|
rm -f /root/anaconda-ks.cfg /root/original-ks.cfg
|
||
|
|
||
|
echo "remove the contents of /tmp and /var/tmp"
|
||
|
rm -rf /tmp/* /var/tmp/*
|
||
|
|
||
|
echo "Force a new random seed to be generated"
|
||
|
rm -f /var/lib/systemd/random-seed
|
||
|
|
||
|
echo "Wipe netplan machine-id (DUID) so machines get unique ID generated on boot"
|
||
|
truncate -s 0 /etc/machine-id
|
||
|
|
||
|
echo "Clear the history so our install commands aren't there"
|
||
|
rm -f /root/.wget-hsts
|
||
|
export HISTSIZE=0
|