Skip to content

Instantly share code, notes, and snippets.

@shmidt
Forked from zobayer1/fedora_post_install.md
Last active May 27, 2023 22:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save shmidt/5fd57a5c9fd303dd48aabc1bb047473d to your computer and use it in GitHub Desktop.
Save shmidt/5fd57a5c9fd303dd48aabc1bb047473d to your computer and use it in GitHub Desktop.
Fedora 34 Post Installation (For Developers). Things you should do after installing your new Fedora workstation.

Fedora 34 Post Installation (For Developers)

Things you should do after installing your new Fedora workstation.

Fix kernel panic when computer turns off

sudo nano -w /etc/default/grub
Append blacklist string GRUB_CMDLINE_LINUX="rhgb quiet initcall_blacklist=dw_i2c_init_driver"
Ctrl + O Save the file.
sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

Install fish

sudo dnf install fish -y
sudo dnf install util-linux-user -y
chsh -s /usr/bin/fish

Turn computer off by pressing power button

Settings -> Power -> Power button behaviour

Settings

Change Hostname

  • Method (a): from Settings -> About, change Device Name.
  • Method (b): from terminal, run (change <newhostname> to your liking):
    sudo hostnamectl set-hostname <newhostname>

Mouse, Touchpad and Keyboard

  • Go to Settings -> Devices -> Mouse & Touchpad to enable touchpad scrolling and taps.
  • Go to Settings -> Devices -> Keyboard Shortcuts to add shortcut for Terminal (Command: gnome-terminal), Switch windows, Switch applications, Hide all normal windows, etc.

Desktop and Display

  • Go to Settings -> Displays to adjust your monitors and resolution settings.

DNF Plugins

Enable dnf fastest mirror

  • Edit /etc/dnf/dnf.conf and append the following lines
    fastestmirror=true
    deltarpm=true
  • Run
    sudo dnf update
    sudo dnf upgrade

Software Sources

Enable third party repositories:

  • Software -> Software Repositories -> Third Party Repositories -> Enable All
  • From the list below, enable required repositories such as google-chrome, nvidia-drivers, steam, etc.

Enable rpm-fusion

  • Free
    sudo rpm -Uvh https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
  • Non-free
    sudo rpm -Uvh https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
  • Source

Microsoft core fonts

  • Add repository and install additional fonts
    sudo dnf install curl cabextract xorg-x11-font-utils fontconfig
    sudo rpm -i https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm
  • Source

Software updates

  • Open Software, Go to Updates tab and hit the refresh button.
  • Install all updates (if any). This may take a few minutes to several hours.
  • Reboot your system once the process is finished.

Drivers

GPU Drivers

  • Note: Driver installation is a tricky process and many things can go wrong, proceed with caution.
  • Nvidia driver installation guide.
  • For AMD GPUs: Open source amdgpu driver is already included.

Multimedia

Install Google Chrome

  • After enabling google-chrome package from Third Party Repositories, search and install from Software
  • Start Chrome from Application Dashboard to update settings, connect google account, enable syncing etc.

Install VLC and Codecs

  • Install VLC Player: sudo dnf install vlc
  • VLC comes in with most common codecs you will need. For additional codecs, open Software and search codecs. Install various GStreamer codecs from search results.

Install Spotify

  • Spotify for Linux is still experimental. Visit official linux distribution page.
  • Install using snap:
sudo snap install spotify
  • Hide the annoying snap directory from your ~ home:
echo "snap" >> .hidden

SSH Keys and VPN

Enable ssh

  • Install: sudo dnf install -y openssh-server
  • Start service at boot: sudo systemctl enable sshd.service
  • Start service: sudo systemctl start sshd.service
  • To test, run: ssh localhost -l <username>
  • Change default port:
    • Open sshd_config: sudo vi /etc/ssh/sshd_config
    • Find a line: Port 22 (or #Port 22)
    • Change it to some other port number (choose port number between 1024 and 65535): Port 2222 (make sure to remove commenting #).
    • Save the file.
    • Update iptables and firewall to allow traffic:
      sudo /sbin/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 2222 -j ACCEPT
      sudo firewall-cmd --permanent --zone=public --add-port=2222/tcp
      sudo firewall-cmd --reload
    • Restart sshd service: sudo systemctl restart sshd.service
    • Verify that your new port is open: netstat -tulpn | grep 2222

Generate SSH public-private keys

  • Run ssh-keygen and answer the prompts.
  • Verify you have the files: ls ~/.ssh
  • Start ssh-agent: eval `ssh-agent`
  • Add private key to ssh-agent: ssh-add ~/.ssh/id_rsa
  • You can now use the content of ~/.ssh/id_rsa.pub as your public key.
  • For example, add the content of ~/.ssh/id_rsa.pub as your bitbucket.org or github.com ssh key.
  • To verify: ssh -T git@bitbucket.org or, ssh -T git@github.com

Enable L2TP VPN

  • Install packages for L2TP
    sudo dnf -y install \
    xl2tpd openvpn libreswan \
    NetworkManager-l2tp \
    NetworkManager-l2tp-gnome \
    NetworkManager-openvpn \
    NetworkManager-openvpn-gnome \
    NetworkManager-pptp \
    NetworkManager-pptp-gnome \
    NetworkManager-strongswan \
    NetworkManager-strongswan-gnome
  • Restart NetworkManager: sudo systemctl restart NetworkManager.service
  • Use nm-connection-editor to add connections
  • To create a vpn connection from a .ovpn file, select Import a saved VPN configuration... from drop-down.

Development Tools

Vim

  • Install vim: sudo dnf install vim
  • Create file ~/.vimrc and add following content
    syntax on
    set shiftwidth=4 softtabstop=4 expandtab
    set autoindent

Visual Studio Code

  • Run following commands
    sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
    sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
    sudo dnf check-update
    sudo dnf install code
  • Source

JetBrains Toolbox

  • Download tar.gz archive from Toolbox App page.
  • Extract and run JetBrains Toolbox binary executable file by double clicking.
  • This should install and run the toolbox. You can install your favorite JetBrains IDEs (PyCharm Community, IntelliJ IDEA Community, Android Studio, etc) from the toolbox, it will keep them updated too.
  • You can remove downloaded and extracted files after installation.

Docker

  • Install DNF plugins core:
    sudo dnf -y install dnf-plugins-core
  • Add repository configuration:
    sudo tee /etc/yum.repos.d/docker-ce.repo<<EOF
    [docker-ce-stable]
    name=Docker CE Stable - \$basearch
    baseurl=https://download.docker.com/linux/fedora/31/\$basearch/stable
    enabled=1
    gpgcheck=1
    gpgkey=https://download.docker.com/linux/fedora/gpg
    EOF
  • Install docker
    sudo dnf makecache
    sudo dnf install docker-ce docker-ce-cli containerd.io
  • Start docker service and check status
    sudo systemctl start docker
    sudo systemctl status docker
  • Add yourself to docker usergroup to access without sudo
    sudo usermod -aG docker $(whoami) && newgrp docker
  • Update firewall
    sudo firewall-cmd --permanent --zone=trusted --add-interface=docker0 && sudo firewall-cmd --reload
  • Change to cgroup v1 and reboot system (required to run docker since Fedora 31):
    sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0"
    sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
  • To revert back to cgroup v2, run following commands and reboot:
    sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy"
    sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

Development Tools

Git

  • Comes with Git 2.26+
  • Download git-prompts script for command prompt information
    wget https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh -O .gitprompt
    chmod 755 .gitprompt
  • Download git-completion to autocomplete git commands
    wget https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -O .gitcompletion
    chmod 755 .gitcompletion
  • Add the following to your ~/.bashrc file:
    # git plugins
    . ~/.gitcompletion
    . ~/.gitprompt
    export GIT_PS1_SHOWDIRTYSTATE=1
    export PS1='[\u@\h \W]$(__git_ps1 " (%s)")\$ '
  • Source your ~/.bashrcfile:
    source ~/.bashrc
  • Source

Python

  • Fedora 34 comes with Python 3.9, follow this for older versions of Python 3.
  • Install python headers and static libraries: sudo dnf install python3-devel
  • Update pip: python -m --user pip install --upgrade pip
  • Install python libraries like cookiecutter, tox, pytest, etc using pip.

Java

  • OpenJDK 11 comes preinstalled with Fedora. Visit Oracle's site to download and install Oracle's Java SDKs. Be careful about licensing if you are using a later version than Java 8.

Go

  • Download linux archive and run tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz
  • Upate $PATH variable at the end of your ~/.bashrc file:
    export PATH=$PATH:/usr/local/go/bin
  • Source bashrc file: source ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment