-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_fedora.sh
executable file
·163 lines (137 loc) · 5.02 KB
/
setup_fedora.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#!/bin/bash
#==============================================================================
#
# FILE: fedora-ultimate-install-script.sh
# USAGE: sudo fedora-ultimate-install-script.sh
#
# DESCRIPTION: Post-installation install script for Fedora 29/30/31 Workstation
# WEBSITE: https://github.com/David-Else/fedora-ultimate-setup-script
#
# REQUIREMENTS: Fresh copy of Fedora 29/30/31 installed on your computer
# https://dl.fedoraproject.org/pub/fedora/linux/releases/31/Workstation/x86_64/iso/
# AUTHOR: David Else
# COMPANY: https://www.elsewebdevelopment.com/
# VERSION: 3.0
#==============================================================================
#==============================================================================
# script settings and checks
#==============================================================================
set -euo pipefail
exec 2> >(tee "error_log_$(date -Iseconds).txt")
GREEN=$(tput setaf 2)
BOLD=$(tput bold)
RESET=$(tput sgr0)
USR_HOME=$(grep ${SUDO_USER} /etc/passwd | cut -d ":" -f6)
if [ "$(id -u)" != 0 ]; then
echo "You're not root! Use sudo ./setup_fedora.sh" && exit 1
fi
if [[ $(rpm -E %fedora) -lt 29 ]]; then
echo >&2 "You must install at least ${GREEN}Fedora 29${RESET} to use this script" && exit 1
fi
# >>>>>> start of user settings <<<<<<
#==============================================================================
# packages to remove
#==============================================================================
packages_to_remove=()
#==============================================================================
# common packages to install *arrays can be left empty, but don't delete them
#==============================================================================
dnf_packages_to_install=(
awscli
bat
bluez
bluez-obexd
bluez-tools
bzip2
cargo
curl
dkms
dnf-plugins-core
docker-compose
fzf
gcc
gcc-c++
git
google-chrome
htop
kernel-headers
kernel-devel
kubernetes-client
kitty
libstdc++-static
lsd
make
mesa-va-drivers-freeworld
mesa-vdpau-drivers-freeworld
neovim
nodejs
podman
podman-docker
ripgrep
rust
steam
stow
wget
tmux
toolbox
unzip
util-linux-user
zsh)
flathub_packages_to_install=(
com.bitwarden.desktop
com.getpostman.Postman
com.github.wwmm.easyeffects
com.github.xournalpp.xournalpp
org.darktable.Darktable
org.fedoraproject.MediaWriter
org.filezillaproject.Filezilla
org.gimp.GIMP
org.gnome.SoundRecorder
org.inkscape.Inkscape
org.qgis.qgis
us.zoom.Zoom)
# >>>>>> end of user settings <<<<<<
#==============================================================================
# display user settings
#==============================================================================
cat <<EOL
${BOLD}Packages to install${RESET}
${BOLD}-------------------${RESET}
DNF packages: ${GREEN}${dnf_packages_to_install[*]}${RESET}
Flathub packages: ${GREEN}${flathub_packages_to_install[*]}${RESET}
${BOLD}Packages to remove${RESET}
${BOLD}------------------${RESET}
DNF packages: ${GREEN}${packages_to_remove[*]}${RESET}
EOL
read -rp "Press enter to install, or ctrl+c to quit"
#==============================================================================
# add repositories
#==============================================================================
echo "${BOLD}Adding repositories...${RESET}"
dnf -y install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
#==============================================================================
# install packages
#==============================================================================
echo "${BOLD}Removing unwanted programs...${RESET}"
dnf -y remove "${packages_to_remove[@]}"
echo "${BOLD}Updating Fedora, enabling module streams...${RESET}"
dnf -y --refresh upgrade
echo "${BOLD}Installing packages...${RESET}"
dnf -y install "${dnf_packages_to_install[@]}"
# Codecs
dnf install gstreamer1-plugins-{bad-\*,good-\*,base} gstreamer1-plugin-openh264 gstreamer1-libav --exclude=gstreamer1-plugins-bad-free-devel
dnf group upgrade --with-optional Multimedia
echo "${BOLD}Installing flathub packages...${RESET}"
flatpak install -y flathub "${flathub_packages_to_install[@]}"
echo "${BOLD}Installing Hashicorp products...${RESET}"
dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo
dnf install -y terraform packer
echo "${BOLD}Installing Starship prompt...${RESET}"
sh -c "$(curl -fsSL https://starship.rs/install.sh)"
cat <<EOL
=================================================================
Congratulations, everything is installed!
Now use the setup script...
=================================================================
EOL