ckrzen

Fedora Workstation: Post-Install script

Apr 20th, 2020
5,134
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. #
  3. # Fedora post-install script#!/bin/bash
  4. #
  5. # Fedora post-install script
  6. #
  7. # Author: Chris Rainey <ckrzen at tuta dot io>
  8. #
  9. # Version: 2020/04/23
  10.  
  11.  
  12. UPGRADE()
  13. {
  14. # Upgrade system
  15.         sudo dnf \
  16.                 -b \
  17.                 --allowerasing
  18.                 --refresh \
  19.                 upgrade && \
  20. # Remove unneeded packages
  21.                 sudo dnf autoremove && \
  22. # Is a ``reboot`` required
  23.                 sudo dnf needs-restarting && \
  24. # Checks the local packagedb
  25.                 sudo dnf check all && \
  26. # Refresh firmware metadata from remote server
  27.                 sudo fwupdmgr refresh ; \
  28. # Updates all firmware to latest versions available
  29.                 sudo fwupdmgr update
  30. }
  31.  
  32. SERVER()
  33. {
  34. # Install Server related packages
  35.         sudo dnf install \
  36.                 cryptsetup \
  37.                 fail2ban \
  38.                 fwupd \
  39.                 lshw \
  40.                 ssh \
  41.                 rfkill \
  42.                 unzip && \
  43. # Is a ``reboot`` required
  44.                 sudo dnf needs-restarting
  45. }
  46.  
  47. DESKTOP()
  48. {
  49. # Install Desktop related repository packages
  50.         sudo dnf install \
  51.                 https://download1.rpmfusion.org/free/fedora/\
  52.                 rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
  53.                 https://download1.rpmfusion.org/nonfree/fedora/\
  54.                 rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm && \
  55. # Install tainted rpmfusion repos
  56.                 sudo dnf install \
  57.                 rpmfusion-free-release-tainted \
  58.                 rpmfusion-nonfree-release-tainted && \
  59. # Install group package updates
  60.                 sudo dnf groupupdate \
  61.                 core \
  62.                 multimedia \
  63.                 sound-and-video && \
  64. # Install individual packages
  65.                 sudo dnf install \
  66.                 aisleriot \
  67.                 chkrootkit \
  68.                 drawing \
  69.                 ffmpeg \
  70.                 gnome-tweaks \
  71.                 intel-media-driver \
  72.                 iperf3 \
  73.                 libdvdcss \
  74.                 libreoffice \
  75.                 libva-intel-driver \
  76.                 libva-intel-hybrid-driver \
  77.                 libva-utils \
  78.                 libva-vdpau-driver \
  79.                 lshw \
  80.                 mediainfo \
  81.                 neofetch \
  82.                 nmap \
  83.                 remmina \
  84.                 seahorse \
  85.                 smartmontools \
  86.                 unrar \
  87.                 vim \
  88.                 vlc \
  89.                 wavemon \
  90.                 whois && \
  91. # Is a ``reboot`` required
  92.                 sudo dnf needs-restarting
  93. }
  94.  
  95. MACBOOKS()
  96. {
  97. # Install Macbook hardware utilities and drivers
  98.         sudo dnf install \
  99.                 mbpfan \
  100.                 kmod-wl && \
  101. # Ebable cooling fan service
  102.                 sudo systemctl enable mbpfan.service && \
  103. # Is a ``reboot`` required
  104.                 sudo dnf needs-restarting
  105. }
  106.  
  107. LOW-RAM()
  108. {
  109. # Remove unnecessary packages on all low ram systems
  110.         sudo dnf remove \
  111.                 firewalld \
  112.                 gnome-calendar \
  113.                 libvirt-daemon \
  114.                 sssd-* && \
  115. # Install early out-of-memory utility
  116.                 sudo dnf install earlyoom && \
  117. # Enable earlyoom service
  118.                 sudo systemctl enable earlyoom.service && \
  119. # Is a ``reboot`` required
  120.                 sudo dnf needs-restarting
  121. }
  122.  
  123. CKR()
  124. {
  125. # Install packages of interest only to me
  126.         sudo dnf install \
  127.                 conky \
  128.                 dtach \
  129.                 geteltorito \
  130.                 jwm \
  131.                 light \
  132.                 lxappearance \
  133.                 mpv \
  134.                 oathtool \
  135.                 pavucontrol \
  136.                 rtorrent \
  137.                 sshfs && \
  138. # Install latest version of youtube-dl
  139.                 sudo curl \
  140.                 -L https://yt-dl.org/downloads/latest/youtube-dl \
  141.                 -o /usr/local/bin/youtube-dl && \
  142. # Edit conf files
  143.                 sudo sed -i.orig \
  144.                 's/# user/user/' \
  145.                 /etc/fuse.conf && \
  146. # Disable WiFi connection at home
  147.                 nmcli connection \
  148.                 down \
  149.                 Chez_M-M-R_5G && \
  150. # Disable IPv4 auto-dns
  151.                 nmcli connection \
  152.                 modify \
  153.                 Chez_M-M-R_5G \
  154.                 ipv4.ignore-auto-dns \
  155.                 yes && \
  156. # Modify IPv4 DNS
  157.                 nmcli connection \
  158.                 modify \
  159.                 Chez_M-M-R_5G \
  160.                 ipv4.dns \
  161.                 "8.8.8.8 8.8.4.4" && \
  162. # Disable IPv6 auto-dns
  163.                 nmcli connection \
  164.                 modify \
  165.                 Chez_M-M-R_5G \
  166.                 ipv6.ignore-auto-dns \
  167.                 yes && \
  168. # Modify IPv6 DNS
  169.                 nmcli connection \
  170.                 modify \
  171.                 Chez_M-M-R_5G \
  172.                 ipv6.dns \
  173.                 "2001:4860:4860::8888 2001:4860:4860::8844" && \
  174. # Enable WiFi connection at home
  175.                 nmcli connection \
  176.                 up \
  177.                 Chez_M-M-R_5G && \
  178. # Add custom DNS to resolved
  179.                 sudo sed -i.orig \
  180.                 's/#DNS=/DNS=8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844/' \
  181.                 /etc/systemd/resolved.conf && \
  182. # Reload systemd daemon
  183.                 sudo systemctl daemon-reload && \
  184. # Restart resolved service
  185.                 sudo systemctl restart systemd-resolved.service && \
  186. # Check custom DNS resolver
  187.                 resolvectl dns && \
  188. # Is a ``reboot`` required
  189.                 sudo dnf needs-restarting
  190. }
  191.  
  192. CKR_LOW-RAM()
  193. {
  194. # Mark fwupd as manually installed to prevent auto removal
  195.         sudo dnf mark \
  196.                 install \
  197.                 fwupd && \
  198. # Remove unneeded packages on my low ram systems
  199.                 sudo dnf remove \
  200.                 abrt* \
  201.                 gdm \
  202.                 gnome-software \
  203.                 PackageKit \
  204.                 plymouth && \
  205. # Rebuild initramfs for text only boot
  206.                 sudo dracut -f
  207. }
  208.  
  209. # RECOMMEND: backup devices / fire safes
  210. # BACKUP: ALL LOCAL MAILBOXES / ADDRESS BOOKS / ACCOUNTS / BOOKMARKS !!!
  211. # UPGRADE: Firmware / SSD’s / HDD’s / batteries / routers
  212. # SET: 8.8.8.8 | 8.8.4.4 | 2001:4860:4860::8888 | 2001:4860:4860::8844 in routers DNS
  213. #sudo passwd # if != LUKS encryption
  214. # CHECK: encrypted-swap
  215. # ENABLE: Third Party Repositories(google-chrome & openh264)
  216. #UPGRADE
  217. #SERVER
  218. #DESKTOP
  219. #LOW-RAM
  220. #CKR    #ADD ssh-keygen/copy-id
  221. #CKR_LOW-RAM
  222. # SSD: sudo systemctl enable fstrim.timer
  223. # EDIT: fail2ban filters/jails
  224. # SSHD: sudo systemctl enable fail2ban
  225. # REBOOT
  226. #sudo systemctl status && sudo systemctl --failed
  227. # CONFIGURE: Settings / Tweaks
  228. #simple-scan # hp-plugin needed?
  229. # *** REPEAT FOR ALL USERS ***
  230. # RESTORE: data
  231. # INSTALL: software
  232. # SET: 2-Step Verification for all cloud services
  233. # ADJUST: LibreOffice theme
  234. # ENABLE: Firefox OpenH264 Video Codec
  235. # INSTALL: VPN(surfshark, PIA, Nord, etc.)
  236. # *** REPEAT FOR ALL USERS ***
  237. # TEST: all launchers
  238. # TEST: all ‘Fn’ keys
  239. # SET: screen lock / power management
  240. # TEST: laptop lid-close suspend
  241. #UPGRADE
  242. # TEST: all UPS's
  243. # COPY: recovery codes to laptops
  244. # LABEL: computers
  245. # SET: hard drive to first / only boot device
  246. # SET: passwd for Firmware / BOOT
  247. # ERASE: previous backup drives & test
  248. # DESKTOP: sudo dnf install deja-dup && sudo dnf needs-restarting
  249. # CONFIGURE: .HD-BKUP.sh || Deja-Dup(Google Drive, etc.)
  250. # ENABLE: Vino + router ports or install DWService for remote assistance
  251. # UPDATE: “[???] Passwords & Tasks List”
  252. # CREATE: invoice
  253. # DELIVER: invoice + receipt
RAW Paste Data