Christopher Juckins

SysAdmin Tips, Tricks and other Software Tools

User Tools

Site Tools


dnf_installer_bash_script_rocky_linux_9

dnf installer bash script (Rocky Linux 9)

When you run the code below, ensure to redirect output and errors to a log file.

This may not be needed, but if slow downloading of packages occurs, modify /etc/dnf/dnf.conf to use the fastest mirror. A fix is noted in Virtual Box running CentOS8 Stream

<color #ed1c24>Errors with the script:<color>

Perl RPM modules not installing:

  • Perl-Array-Diff
  • Perl-IO-All

Install them using cpanm (see CPAN Tips)




#!/bin/bash
#
# install-my-dnf-packages.bash
# Rocky Linux 9 version
#
# NOTES:
# Installed groups can be found with:
# dnf group list
#
# Contents of groups can be found with:
# dnf group info "Group Name"
#
# TO RUN:
# ./install-my-dnf-packages.bash > /tmp/install-my-dnf-packages.log 2>&1
#

echo ""
echo "*****************************************************************"
echo "*                     Beginning all Updates                     *"
echo "*****************************************************************"


echo "*****************************************************************"
echo "*                         PowerTools                            *"
# https://www.how2shout.com/linux/how-to-enable-powertools-repository-on-rocky-linux-8/
echo "*****************************************************************"
dnf install dnf-plugins-core
dnf config-manager --set-enabled powertools


echo ""
echo "dnf -y install wget"
dnf -y install wget


echo ""
echo "dnf -y install epel-release"
dnf -y install epel-release


echo "*****************************************************************"
echo "***************** UPDATING CURRENT PACKAGES  ********************"
echo "*****************************************************************"
dnf -y update


echo ""
echo "******************** FOR VBox Guest Additions *******************"
dnf -y install kernel-headers kernel-devel gcc make perl 
dnf -y install elfutils elfutils-devel elfutils-libelf elfutils-libelf-devel


echo ""
echo "********************* NOW INSTALLING GROUP ********************"
echo "Basic Web Server"
echo "*****************************************************************"
dnf -y groupinstall --with-optional "Basic Web Server"


echo ""
echo "********************* NOW INSTALLING GROUP ********************"
echo "Graphical Administration Tools"
echo "*****************************************************************"
dnf -y groupinstall --with-optional "Graphical Administration Tools"


echo ""
echo "********************* NOW INSTALLING GROUP ********************"
echo "Development Tools"
echo "*****************************************************************"
dnf -y groupinstall --with-optional "Development Tools"


echo ""
echo "********************* NOW INSTALLING GROUP ********************"
echo "Scientific Support"
echo "*****************************************************************"
dnf -y groupinstall --with-optional "Scientific Support"


echo ""
echo "********************* NOW INSTALLING GROUP ********************"
echo "Smart Card Support"
echo "*****************************************************************"
dnf -y groupinstall --with-optional "Smart Card Support"


echo ""
echo "********************* NOW INSTALLING GROUP ********************"
echo "System Tools"
echo "*****************************************************************"
dnf -y groupinstall --with-optional "System Tools"


echo ""
echo "********************* NOW INSTALLING EXTRAS  ********************"
echo ""
echo "About to install: xorg-x11-fonts*"
dnf -y install xorg-x11-fonts*

echo ""
echo "About to install: libreoffice*"
dnf -y install libreoffice*

echo ""
echo "About to install: mariadb*"
dnf -y install mariadb*

echo ""
echo "About to install: cups"
dnf -y install cups

echo ""
echo "About to install: alpine"
dnf -y install alpine

echo ""
echo "About to install: ImageMagick*"
dnf -y install ImageMagick*

echo ""
echo "About to install: gedit"
dnf -y install gedit

echo ""
echo "About to install: lftp"
dnf -y install lftp*

echo ""
echo "About to install: traceroute"
dnf -y install traceroute

echo ""
echo "About to install: ftp"
dnf -y install ftp

echo ""
echo "About to install: mutt"
dnf -y install mutt

echo ""
echo "About to install: NetworkManager*"
dnf -y install NetworkManager*

echo ""
echo "About to install: openconnect*"
echo "NOTE: Check for openconnect-devel errors"
dnf -y install openconnect*

echo ""
echo "About to install: postfix"
dnf -y install postfix

echo ""
echo "About to install: s-nail since mailx is not available in Rocky Linux 9"
dnf -y install s-nail

echo ""
echo "About to install: evince"
dnf -y install evince

echo ""
echo "About to install: ncftp"
dnf -y install ncftp

echo ""
echo "About to install: dkms"
dnf -y install dkms

echo ""
echo "About to install: gstreamer1* gstreamer1-*"
dnf -y install gstreamer1* gstreamer1-*

echo ""
echo "About to install: PackageKit-gstreamer-plugin"
dnf -y install PackageKit-gstreamer-plugin

echo ""
echo "About to install: gimp"
dnf -y install gimp

#echo ""
#echo "About to install: php php-mbstring php-mcrypt php-mysql"
#dnf -y install php php-mbstring php-mcrypt php-mysql

echo ""
echo "About to install: php-xml"
dnf -y install php-xml                         # phpMyAdmin

echo ""
echo "About to install: fail2ban.noarch"
dnf -y install fail2ban.noarch

echo ""
echo "TODO: About to install: perl-Array-Diff.noarch"
# This is in the dnf list but won't install, use cpanm
# find_missing_asm_files.pl
dnf -y install perl-Array-Diff.noarch

echo ""
echo "About to install: perl-Array-Unique.noarch"
dnf -y install perl-Array-Unique.noarch

echo ""
echo "About to install: perl-CPAN"
dnf -y install perl-CPAN

echo ""
echo "About to install: perl-File-Slurp.noarch"
dnf -y install perl-File-Slurp.noarch     

echo ""
echo "About to install: perl-IPC-System-Simple.noarch"
dnf -y install perl-IPC-System-Simple.noarch

echo ""
echo "TODO About to install: perl-IO-All.noarch"
# check_stations.pl
# Can't find an EPEL 9 version, use cpanm
dnf -y install perl-IO-All.noarch 

echo ""
echo "About to install: perl-List-MoreUtils"
dnf -y install perl-List-MoreUtils

echo ""
echo "About to install: perl-LWP*"
dnf -y install perl-LWP*

#echo ""
#echo "Skipping install: perl-Tie-IxHash"
#echo "TODO About to install: perl-Tie-IxHash"
# Is this used in any of my scripts?
#dnf -y install perl-Tie-IxHash

echo ""
echo "About to install: bind-utils"
dnf -y install bind-utils

echo ""
echo "About to install: qt5-qtx11extras"
dnf -y install "qt5-qtx11extras"               # VirtualBox

echo ""
echo "About to install: vsftpd"
dnf -y install vsftpd

echo ""
echo "About to install: jq"                    # TAT
dnf -y install jq

echo ""
echo "About to install: tidy"
dnf -y install tidy

echo ""
echo "About to install: pv"
dnf -y install pv

echo ""
echo "About to install: vim"
dnf -y install vim

echo ""
echo "About to install: gnome-tweaks"
dnf -y install gnome-tweaks

echo ""
echo "TODO About to install: keepass"
# dnf -y install keepass
# This works: keepass-2.48.1-3.fc35.x86_64.rpm
# https://www.rpmfind.net/linux/fedora/linux/releases/35/Everything/x86_64/os/Packages/k/keepass-2.48.1-3.fc35.x86_64.rpm
wget https://www.rpmfind.net/linux/fedora/linux/releases/35/Everything/x86_64/os/Packages/k/keepass-2.48.1-3.fc35.x86_64.rpm
dnf -y localinstall keepass-2.48.1-3.fc35.x86_64.rpm

echo ""
echo "About to install: firefox"
dnf -y install firefox

echo ""
echo "About to install: libcurl-devel"
dnf -y install libcurl-devel

echo ""
echo "About to install: samba-*"
dnf -y install samba-*

echo ""
echo "About to install: totem"
dnf -y install totem

echo ""
echo "About to install: Google Chrome"
if [[ ! -e /root/downloads ]]; then
    mkdir /root/downloads
fi
cd /root/downloads
if [[ -f google-chrome-stable_current_x86_64.rpm ]]; then
    rm google-chrome-stable_current_x86_64.rpm
fi
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
dnf -y localinstall google-chrome-stable_current_x86_64.rpm

echo ""
echo "About to install: vlc"
dnf -y install https://download1.rpmfusion.org/free/el/rpmfusion-free-release-9.noarch.rpm
dnf -y install vlc

#echo ""
#echo "Skipping install: pidgin"
#echo "TODO About to install: pidgin"
# Maybe not needed since new NWSChat will be Slack?
#dnf -y install pidgin

echo ""
echo "About to install: qt5-qtx11extras"
dnf -y install qt5-qtx11extras

#echo ""
#echo "**************** Skipping GIMP HEIF/HEIC Support *****************"
#echo "**************** Install GIMP HEIF/HEIC Support *****************"
#echo "TODO gimp-heif-plugin"
#dnf -y install gimp-heif-plugin.x86_64
# May not be needed in latest version of GIMP


echo ""
echo "*********************** ENABLE SERVICES  ************************"
systemctl start httpd.service
systemctl enable httpd.service
systemctl start chronyd.service
systemctl enable chronyd.service
systemctl start postfix
systemctl enable postfix


echo ""
echo "******************** ENABLE GRAPHICAL LOGIN  ********************"
systemctl isolate graphical.target
systemctl set-default graphical.target


echo ""
echo "*****************************************************************"
echo "Installing XFCE for Rocky Linux 9...                             *"
echo "See https://docs.rockylinux.org/guides/desktop/xfce_installation/"
echo "for more information.                                            "
echo "*****************************************************************"
dnf -y copr enable stenstorp/lightdm
dnf -y groupinstall "xfce"
dnf -y install lightdm
systemctl disable gdm
systemctl enable lightdm


echo ""
echo "*****************************************************************"
echo "*                       AUTO install DONE                       *"
echo "*****************************************************************"


echo ""
echo "*****************************************************************"
echo "You probably want to reboot your machine, then finish next      *"
echo "steps.                                                          *"
echo "*****************************************************************"
echo ""


echo ""
echo "*****************************************************************"
echo "Test, then fix VPN if needed                                    *"
echo "See: https://bugzilla.redhat.com/show_bug.cgi?id=1549242         "
echo "As root: update-crypto-policies --set LEGACY                     "
echo "*****************************************************************"


echo ""
echo "*****************************************************************"
echo "MATE not yet available for Rocky Linux 9                         *"
echo "See https://forums.rockylinux.org/t/mate-being-added-to-epel-8-and-9/6479/4"
echo "*****************************************************************"
echo ""


echo "*****************************************************************"
echo "*                       END OF INSTALL                           *"
echo "*****************************************************************"
echo ""
dnf_installer_bash_script_rocky_linux_9.txt · Last modified: 2022/09/29 16:37 by juckins