Post-Installation RPM and Script



 

 


Over the years I have found that many tasks need to be performed on my Fedora Linux systems after installation. In the spirit of the Philosophy of Linux, I believe that one should automate everything, I began writing a little script to perform all those tasks that I would have otherwise had to do by hand every time I installed Fedora Linux on a computer. And I do that a lot!

That script has turned out to be not so little. It performs a large number of tasks, many of which are selectable using a number of provided options.

As the result of a few folks who read about this script in my review of Fedora 18, I have decided to make a generalized version available for download. The RPM to install this and a few other small scripts can be downloaded lower on this page. Please read the following description of the RPM and postinstallpub.sh script before you install it to be sure you understand what it does.

postinstallpub RPM

This RPM is the package that contains the postinstallpub.sh script as well as some others.

What the RPM does

Installing this RPM performs the following tasks.

  • Installs sysdata – A BASH script that can collect a very large amount of data about your Linux computer.
  • Installs nist.pl – Sets the time on your computer by the atomic clock at the National Institute of Standards and Technology.
  • Installs die -  Kills processes by name. Be VERY CAREFUL with this one!!!
  • Installs createMOTDLinux – Creates an MOTD with current data about your computer.
  • Installs create_motd – with a link in cron.daily, runs createMOTDLinux each day with the correct options.
  • Installs postinstallpub.sh – A script to perform all of the usual configuration tasks that I perform on newly installed systems. This script takes up to 3 hours to complete if everything is installed but it saves me much time and typing. It includes installing all available updates. It copies some favorite default configurations for Midnight Commander, NTP, and makes some changes to GRUB configuration. It installs a large number of compatibility and other useful fonts.  It can also install many of the servers I use on a server host.
  • Adds a symlink to /etc/cron.daily to point to /usr/local/bin/create_motd.

Downloading the RPM

The current version of the RPM can be downloaded here.

http://www.databook.bz/downloads/postinstallpub-2.0-0.1.noarch.rpm

Installing the RPM

After downloading the RPM, as root, copy the RPM from the download location to root’s home directory, /root from where you will install it.

Then install the RPM with the command:

rpm -ivh postinstallpub-2.0-0.1.noarch.rpm

After installing the RPM, you can run the postinstallpub.sh script with the -h option to determine which options you want to use.

./postinstallpub.sh -h

 

The postinstallpub.sh Script

The postinstallpub.sh script is designed to make my life as a system administrator easier. It allows me to choose from among several options that perform certain configuration tasks or install various software packages.

What the Script Does

Depending upon which options you select, this script performs many different tasks. It also performs several basic tasks even when no options are selected. The script checks to see if most actions to be performed have already been, and will not perform them again.

No Options

When run with no options, this script performs the following actions. This script performs these actions in addition to any other options that are specified when it is run, except for the -hgV options, either together or separately.

  • Installs wget
  • Installs the RPMFusion repositories. These repositories are used by YUM and contain packages that are not provided by the Fedora repositories.
  • Installs the compat-libstdc++-33 package which may be used by some older programs.
  • Sets the installonly_limit variable for YUM to 9 instead of the default 3. This variable defines how many older versions of the kernel and certain other packages to keep before deleting them. Keeping older kernels is a good idea in case a new kernel breaks older programs or has other bugs.
  • Installs all currently available updates.
  • Disables SELinux. If you want SELinux enabled, you will have to reenable it manually after the script has finished.
  • Appends a new alias (lsn) to /etc/bashrc to specifically use the color=no option with ls.
  • Sets BASH command line editing to vi mode.
  • Installs some useful text mode administrative tools packages: mc screen vim-common vim-enhanced vim-filesystem vim-minimal logwatch powertop ntop atop htop iptraf-ng iotop iftop sysstat rpmorphan lshw hddtemp lm_sensors clamav chkrootkit apcupsd
  • Creates an entry in /etc/cron.daily that recreates the motd (message of the day) each morning.
  • Creates the motd using the createMOTDLinux installed by the RPM. The motd is displayed whenever someone logs into the system using a terminal program such as SSH.
  • Creates a /etc/LogBanner file that is displayed prior to a terminal login.
  • Modifies the GRUB configuration file so that the startup details are displayed during boot instead of a graphical animation. It also sets the GRUB menu timeout to 10 seconds.
  • Installs the ntp and ntpdate packages and restarts the ntp service.
  • Disables the firstboot service.

Main Options

The following options may be used when running the postinstallpub.sh script. They install various applications and administrative tools as listed below.

  • -A Installs all other options. Equivalent to ./postinstallpub.sh -adfmsCGKLMSX
  • -a Installs a number of desktop applications including: tellico gramps gnucash stellarium stellarium-doc kstars celestia gkrellm AdobeReader_enu flash-plugin thunderbird xscreensaver yumex
  • -d Installs some development tools needed if you are dong compiled program development or using VirtualBox. This includes: kernel-devel kernel-PAE-devel gcc dkms rpm-build
  • -f Installs a number of desktop fonts.
  • -m Installs some multimedia applications including: amarok gstreamer-ffmpeg mplayer mplayer-gui kaffeine vlc xine-ui* xine-lib-extras xine-lib-extras-freeworld xine-lib-pulseaudio xine-plugin

Two new options have been added to version 2.0-0.1 of the RPM. This is version 3.2.1-p of the postinstallpub.sh script.

  •  -T     If you are in a training environment, this installs a few tools but leaves most for the students to install. It also creates a student ID, student, with a password of lockout.   This is for the Millennium Technology Consulting LLC  Theory and practice of Linux System Administration course.
  • -t     If you are in a training environment, this installs a complete set of tools for beginning students. It also creates a student ID, student, with a password of lockout. This is for the Millennium Technology Consulting LLC Introduction to Linux course.

These additional options cause the postinstallpub.sh script to install various desktops. Linux is fortunate to have multiple desktops from which to choose. You can install any or all of them and switch between them as you desire.

  • -D Install all desktops listed below. This is a new option with version 3.2.1-p of the script.
  • -C Install the Cinnamon desktop. This is a fork of GNOME 3, which a lot of people prefer.
  • -G Install the GNOME desktop. A good, basic desktop with only a few choices for customization built in.
  • -K Install the KDE desktop. This is a complex desktop with a very rich set of features. It is highly configurable and offers many choices.
  • -L Install the LXDE desktop. A lightweight desktop designed for systems with limited resources. Even more lightweight than Xfce, below.
  • -M Install the MATE desktop. This is another fork of a previous version of GNOME. Apparently a lot of people have different ideas about how GNOME should look and work.
  • -S Install the Sugar desktop. This desktop is designed for children.
  • -X Install the Xfce desktop. This is a lightweight desktop designed for systems with limited resources.

Miscellaneous Options

These options do not install anything but display some relevant help and License information and modify the actions of the program.

  • -h Display the help information and exit without performing any other tasks.
  • -g Display the GPL license header and exit without performing any other tasks.
  • -v Verbose mode displays more information about what the script is doing.
  • -V Prints the version of the program to STDOUT (the screen) and exits.

Running the postinstallpub.sh Script

The RPM installs the postinstallpub.sh in /root – root’s home directory. So login as root and ensure that the present working directory is /root. Run the command as shown below with a sample set of options.

./postinstallpub.sh -vafCKS

The above command runs in verbose mode to display more information about what it is doing. In addition to the tasks that this script always performs, see above, it installs some desktop applications, and desktop fonts. It then installs the Cinnamon, KDE and Sugar desktops.

After Running The Script

After running the postinstall.sh  script you should reboot your computer. The only reason you might need to do this is that an updated kernel was most likely installed and you should always use the latest kernel unless there is a good reason not to.

The License for postinstallpub.sh

The program is distributed under the GPL2 license.

################################################################################
#  Copyright (C) 2007, 2013  David Both                                        #
#  Millennium Technology Consulting LLC                                        #
#  http://www.millennium-technology.com                                        #
#                                                                              #
#  This program is free software; you can redistribute it and/or modify        #
#  it under the terms of the GNU General Public License as published by        #
#  the Free Software Foundation; either version 2 of the License, or           #
#  (at your option) any later version.                                         #
#                                                                              #
#  This program is distributed in the hope that it will be useful,             #
#  but WITHOUT ANY WARRANTY; without even the implied warranty of              #
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
#  GNU General Public License for more details.                                #
#                                                                              #
#  You should have received a copy of the GNU General Public License           #
#  along with this program; if not, write to the Free Software                 #
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   #
################################################################################