Skip to content

Instantly share code, notes, and snippets.

@alkavan
Last active March 4, 2025 20:10
Show Gist options
  • Save alkavan/aa50b7529ae73a145073f51fc0a81f85 to your computer and use it in GitHub Desktop.
Save alkavan/aa50b7529ae73a145073f51fc0a81f85 to your computer and use it in GitHub Desktop.
A cheat-sheet for fresh Fedora Linux installations

Fedora Linux Cheat-Sheet

Compilers and Development Tools

Rust

Using rustup installer (recommended for development)

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

[or] Install default system version

sudo dnf install rust rust-src cargo rustfmt clippy

GCC for ARM

sudo dnf install binutils-arm-linux-gnu gcc-arm-linux-gnu gcc-c++-arm-linux-gnu

GCC for RISC-V

sudo dnf install binutils-riscv64-linux-gnu gcc-riscv64-linux-gnu gcc-c++-riscv64-linux-gnu

Go

sudo dnf install golang

Configure GOPATH in user environment

mkdir -p $HOME/go
echo 'export GOPATH=$HOME/go' >> $HOME/.bashrc
source $HOME/.bashrc
go env GOPATH

PHP (system version)

sudo dnf install php-common php-cli php-devel
sudo dnf install php-bcmath php-mbstring php-gd php-opcache php-intl php-process php-tidy php-xml php-xmlrpc php-json
sudo dnf install php-pdo php-pdo-dblib php-dba php-mysqlnd php-pgsql php-pecl-memcache 

JavaScript (Node)

sudo dnf install nodejs npm

Python (alternative version)

You need to have general development tools on the system

sudo dnf groupinstall "Development tools"
sudo su
dnf install bzip2-devel openssl-devel readline-devel ncurses-devel libffi-devel libcurl-devel
cd /usr/src/
wget https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tgz
tar xzf Python-3.7.9.tgz
rm Python-3.7.9.tgz
cd /usr/src/Python-3.7.9
./configure --enable-optimizations
make altinstall

User commands

GPG, Security and Encryption

Generate new key

gpg --gen-key

File Synchronization (with remote machine)

Synchronize local directory with remote

rsync -a ~/dir1 username@remote_host:~/dir2

Synchronize remote directory with local

rsync -a username@remote_host:/home/username/dir1 ~/dir2

Use compression, show progress, and handle partial files

rsync -azP username@remote_host:/home/username/dir1 ~/dir2

More command options:

-a, --archive               archive mode; equals -rlptgoD (no -H,-A,-X)
    --delete                removes files in destination if not in source
-u, --update                skip files that are newer on the receiver
-h, --human-readable        output numbers in a human-readable format
-c, --checksum              skip based on checksum, not mod-time & size

File Integrity

md5sum * > files.md5  # generates a list of checksums for all files in directory
md5sum -c files.md5   # checks files in directory using list

Root commands

OpenCV

sudo dnf install opencv opencv-contrib opencv-devel opencv-doc

Docker

sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0"

sudo dnf install moby-engine docker-compose
sudo systemctl enable docker

sudo firewall-cmd --permanent --zone=FedoraWorkstation --add-masquerade
sudo firewall-cmd --reload

sudo reboot

Allow user to use docker

sudo usermod -aG docker $USER

On Fedora 33 there is an issue with firewall:

sudo firewall-cmd --zone=trusted --remove-interface=docker0
sudo firewall-cmd --zone=trusted --remove-interface=docker0 --permanent

Install RPM Fusion repositories

sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

Disk check and health tools

Scan for bad sectors and log into file

sudo badblocks -v /dev/sdc1 > badsectors.txt

If bad sectors found, instruct system not to write to bad blocks

sudo e2fsck -l badsectors.txt /dev/sdc1

SMART Monitoring Tool

sudo yum install smartmontools
sudo smartctl -H /dev/sdc1

Install the Brave browser

sudo dnf config-manager --add-repo https://brave-browser-rpm-release.s3.brave.com/x86_64/
sudo rpm --import https://brave-browser-rpm-release.s3.brave.com/brave-core.asc
sudo dnf install brave-browser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment