Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Setup procedure for a new Fedora workstation
#!/bin/bash
##########################################################
# Updated 3 July 2015 to use dnf and tweaks for Fedora 22
##########################################################
# Change below to whichever host is running apt cacher
# setup apt-cacher - do this after lxc docker as ssl sources are not configured for cacher by me
dnf install -y apt-cacher-ng
systemctl start apt-cacher-ng.service
systemctl enable apt-cacher-ng.service
# Fixme - not working
#echo 'proxy=http://localhost:3142' >> /etc/dnf.conf
# Enable ssh by default
systemctl start sshd
systemctl enable sshd
# Install syncthing for user timlinux from copr repos
dnf copr enable wormsik/syncthing
dnf -y install syncthing
systemctl enable syncthing@timlinux
systemctl start syncthing@timlinux
# Install mumble from copr repos
dnf copr enable jamielennox/Mumble
dnf -y install mumble
dnf update -y
# Support for exfat - its currently the only FS that you can mount on win/lin/mac that supports large files
dnf install exfat-utils.x86_64 fuse-exfat.x86_64
# To install the gitter chat client, see these instructions (the second answer worked for me):
# https://ask.fedoraproject.org/en/question/65767/how-to-install-gitter-on-fedora-21/
# Setup latest docker - note that in fed 22 I had a lot of problems withthe shipped 1.6 docker - I ended up
# uninstalling and replacing with the upstream docker package from http://docker.com
dnf -y install docker-io.x86_64
# Start manually
systemctl start docker
# Run at boot
systemctl enable docker
pip install docker-compose
pip install websocket
usermod -a -G docker timlinux
# Only needed if you get selinux cannot start container permission error
dnf upgrade selinux-policy
# Get some base images
docker pull debian
docker pull ubuntu
docker pull python
docker pull kartoza/postgis
docker pull kartoza/qgis-desktop
docker pull kartoza/qgis-server
docker pull kartoza/geoserver
# Not sure if this works - docker autocomplete in bash
#sed -i '$acomplete -F _docker docker' /etc/bash_completion.d/docker.io
# Gnome tweaks, themes and eye-candy
dnf install -y gnome-shell-extension-user-theme.noarch \
gnome-shell-theme-selene.noarch \
gnome-shell-theme-zukitwo.noarch \
gnome-shell-theme-zukiwi.noarch
dnf install -y gnome-tweak-tool.noarch
# Elegance gnome theme
wget http://download.opensuse.org/repositories/home:/satya164:/elegance-colors/Fedora_20/x86_64/gnome-shell-theme-elegance-colors-2.9-3.2.x86_64.rpm
rpm -i gnome-shell-theme-elegance-colors-2.9-3.2.x86_64.rpm
# Codecs and VLC
dnf localinstall –nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
dnf -y install gstreamer1-libav gstreamer1-plugins-bad-free-extras gstreamer1-plugins-bad-freeworld gstreamer1-plugsins-base-tools gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-good gstreamer1-plugins-base
dnf install -y vlc
# These will be all deps needed to compile QGIS
dnf builddep -y qgis
dnf install -y grass
dnf install -y \
qca.x86_64 \
qca-devel.x86_64 \
qca-gnupg.x86_64 \
qca-ossl.x86_64 \
gdal.x86_64 \
gdal-python.x86_64 \
python-psycopg2.x86_64 \
grass-devel.x86_64 \
qscintilla-python.x86_64 \
qscintilla-devel.x86_64 \
qscintilla.x86_64 PyQt4-qsci-api.x86_64 \
qt5-qtx11extras.x86_64 qt-creator-doc.noarch qt-creator.x86_64 \
git \
gitg \
gcc \
gcc-c++ \
make \
automake \
meld \
txt2tags
# Above is enough to build QGIS with
# chmod -R a+w /usr/lib/x86_64-linux-gnu/qt4/plugins/designer/
# chmod -R a+w /usr/lib/python2.7/dist-packages/PyQt4/uic/widget-plugins/
# ccmake .. -DQWT_INCLUDE_DIR=/usr/include/qwt -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local/qgis-master -DPYTHON_LIBRARY=/usr/lib64/libpython2.7.so -DQSCINTILLA_INCLUDE_DIR=/usr/include/qt4 -DQWT_LIBRARY=/usr/lib/libqwt.so -DGRASS_INCLUDE_DIR=/usr/include -DGRASS_PREFIX=/usr/lib64/grass -DWITH_GRASS7=OFF -DWITH_INTERNAL_QWTPOLAR=OFF -DQSCINTILLA_INCLUDE_DIR=/usr/include/ -DQWT_LIBRARY=/usr/lib64/libqwt.so
# Also install Qt5 libs for building QGIS against Qt5
dnf install -y `dnf search Qt5 | grep devel | grep x86_64 | grep '^qt5'`
dnf install -y qt5-qttools.x86_64 qt5-qttools-devel.x86_64 qt5-qttools-libs-designer.x86_64 qt5-qttools-libs-clucene.x86_64 qt5-qttools-libs-help.x86_64 qt5-qttools-static.x86_64
# Install other key apps
dnf install -y gnome-shell-extension-user-theme.noarch \
byobu \
vim \
cmake-curses-gui \
shutter \
gnome-themes* \
gnome-clocks \
gnome-weather \
gnome-maps \
corebird \
fritzing \
gimp \
inkscape \
keepassx \
python-virtualenv \
qt4-designer \
qt-config \
recordmydesktop \
gtk-recordmydesktop \
pylint \
python-paramiko \
mc \
rpl \
python-beautifulsoup \
texinfo \
tree \
gettext \
texlive \
transifex-client \
audacity \
pgadmin3 \
redshift-gtk.x86_64 \
jq # jq is a command line json parser
# texlive-latex-extra \
# texlive-fonts-recommended \
# Get rid of those irritating kernel error popups from apport
rpl "enabled=1" "enabled=0" /etc/default/apport
# Set up git pulls for PR management
gem install git-pulls
# Prevent git pushing to anything but the current branch in remote
git config --global push.default simple
# Install Chrome
wget https://dl-ssl.google.com/linux/linux_signing_key.pub
rpm --import linux_signing_key.pub
sh -c 'echo "[google-chrome]
name=Google Chrome 64-bit
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64" >> /etc/dnf.repos.d/google-chrome.repo'
dnf install google-chrome-stable
# Handbrake for backing up your dvd's
dnf-config-manager --add-repo=http://negativo17.org/repos/fedora-handbrake.repo
dnf-config-manager --add-repo=http://negativo17.org/repos/fedora-handbrake.repo
sudo dnf -y install HandBrake-gui HandBrake-cli
# Java JDK for PyCharm
dnf -y install java-1.8.0-openjdk.x86_64
# Setup hipchat
echo "[atlassian-hipchat]
name=Atlassian Hipchat
baseurl=http://downloads.hipchat.com/linux/dnf
enabled=1
gpgcheck=1
gpgkey=https://www.hipchat.com/keys/hipchat-linux.key
" > /etc/dnf.repos.d/atlassian-hipchat.repo
dnf install -y hipchat
# Sync time daily with ntp
su -c 'echo "ntpdate ntp.ubuntu.com" > /etc/cron.daily/ntpdate'
chmod 755 /etc/cron.daily/ntpdate
# Install harvestapp.com gtk client
yum install libgee
cd /usr/local/src
git clone git://github.com/tkowalewski/harvest-gtk.git
cd harvest-gtk
make install
# Flash
dnf -y install http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux
dnf -y install flash-plugin
# Fedy - makes it easy to add oracle jdk, ssd tuning etc
wget http://satya164.github.io/fedy/fedy-installer
chmod +x fedy-installer
./fedy-installer
# Then run fedy from the menu to configure various system tweaks.
# Support for Logitech Trackman trackball - lets you click minor button to scroll
# You need to restart X after for the settings to take
echo "
Section \"InputClass\"
Identifier \"Marble Mouse\"
MatchProduct \"Logitech USB Trackball\"
Option \"EmulateWheel\" \"true\"
Option \"EmulateWheelButton\" \"8\"
Option \"XAxisMapping\" \"6 7\"
Option \"Emulate3Buttons\" \"true\"
EndSection" > /etc/X11/xorg.conf.d/10-evdev.conf
# Macbook specific stuff:
# For macbook to disable touchpad while typing
# Add this line to your rc.local
#echo "syndaemon -k -i 2 -d" > /etc/rc.local
dnf install kernel-devel akmod-wl
akmods
# For command - as - ctrl key mappings, see this article:
# http://askubuntu.com/questions/131900/how-do-i-switch-the-command-key-and-control-key-on-a-macbook-pro
# I got really pissed off when packagekit chewed through 2gb of data on my phones
# wifi hotspot (==very expensive) so I disable packagekit on my laptops:
sudo systemctl disable packagekit
# Broadcom wireless driver:
# You need the fusion repos enabled (done already above)
dnf install -y broadcom-wl kmod-wl
insmod wl
# Additional notes for MacBook 15" Retina
# How to get nvidia graphics working nicely
# Install EasyLife
# Run easylife and install the current nvidia driver
# *Before rebooting* add this to your /etc/X11.xorg.conf:
echo '
# Enable these sections to use nvidia driver
# You need to reboot after
# It will support multi-monitor setups
# but use more battery
Section "Device"
Identifier "Configured Video Device"
Driver "nvidia"
Option "UseDPLib" "off"
EndSection
Section "Module"
Load "glx"
EndSection
# Enable this sections to use intel driver
# Comment out the above section if this is enabled
# Reboot to activate
#Section "Device"
# Identifier "Configured Video Device"
# Driver "fbdev"
#EndSection
Section "Screen"
Identifier "Default Screen"
Device "Configured Video Device"
EndSection
' > /etc/X11/xorg.conf
# The fonts on a TTY when using retina display are ridiculously small
# you can use setupcon to fix this
dnf install -y setupcon
echo "
# CONFIGURATION FILE FOR SETUPCON
# Consult the console-setup(5) manual page.
ACTIVE_CONSOLES=guess
CHARMAP=guess
CODESET=guess
# See /usr/share/consolefonts/ for available fonts
FONTFACE=TerminusBold
# Changed from install default by Tim
FONTSIZE=32x16
" > /etc/defaults/console-setup
# ensure that setupcon gets run at boot
echo "
#!/bin/bash
# Setup console fonts on startup to nice large font
setupcon
# This command will make the hardware brightness control
# keys work under fedora for 15" MacBook Pro Retina
setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0
" > /etc/rc.d/rc.local
chmod +x /etc/rc.d/rc.local
# Disable wireless N with broadcom driver - it seems to cause the
# connection to disconnect all the time
# See https://ask.fedoraproject.org/en/question/58173/how-to-make-wifi-bcm43142-work-on-fedora-21/
modprobe iwlwifi 11ndisable=1
echo options iwlwifi 11ndisable=1 > /etc/modprobe.d/iwlwifi.conf
# Webcam doesn't yet work
# Font scaling is still a PITA in many places
@EmanuelMSan
Copy link

EmanuelMSan commented Jan 21, 2020

/etc/dnf/dnf.conf proxy syntax

proxy=http://url.com:8080

proxy auth method = { 'basic', 'digest', 'negotiate', 'ntlm', 'digest_ie', 'ntlm_wb', 'none' and 'any' }

proxy_auth_method=ntlm

user and password for proxy

proxy_username=UserName
proxy_password=UserPass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment