Migrate from Rocky Linux to CentOS Stream

There is no official guide to migrate from Rocky Linux to CentOS Stream, however, it can be achieved by using official CentOS to CentOS Stream migration guide

  1. Install centos-release-stream package
dnf install https://vault.centos.org/centos/8/extras/x86_64/os/Packages/centos-release-stream-8.1-1.1911.0.7.el8.x86_64.rpm
  1. The next step is to swap Rocky Linux repositories to CentOS Stream ones. This is done with dnf swap centos-{linux,stream}-repos -y command. However, this command will cause multiple conflicts in Rocky Linux. To solve them:
  • copy /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial file from any Centos Stream system into Rocky Linux
  • remove conflicting packages:
    rpm -e --nodeps rocky-repos
    rpm -e --nodeps rocky-release
    
  • complete installing CentOS Stream repositories
    dnf swap centos-{linux,stream}-repos -y
    
  1. Switch to CentOS Stream
dnf distro-sync -y
  1. Verify installation and reboot the server:
cat /etc/centos-release
reboot
| 13 Jul 2022

Block IP address in firewalld

sudo firewall-cmd --add-rich-rule="rule family='ipv4' source address='89.20.160.77' reject" --timeout=1h

Valid values for timeout - numbers followed by s, m or h

Documentation

| 23 May 2022

Monitor IO disk utilization

Install sysstat package:

sudo dnf install sysstat -y

Install ttyplot to plot data and kazy to extract data with grm

grm install jsnjack/kazy-go
grm install tenox7/ttyplot==1.6.1 -n ttyplot -l

Check available disk partitions with df command. nvme0n1 is used in example:

iostat -dx 1 | kazy -i nvme0n1 | kazy -r -x "[\d.]*$" | ttyplot -s 100
| 10 May 2022

Remove unused runtimes in flatpak

flatpak uninstall --unused

Maintenance commands for flatpak:

flatpak update && flatpak uninstall --unused
| 30 Apr 2022

Find out the filesystem type

df -Th
| 28 Apr 2022

lxd: Manually remove lvm storage pool

lvremove /dev/default/LXDThinPool

To list all lvm pools:

lvdisplay
| 22 Apr 2022

Do I need to restart after dnf update?

Reboot is needed if one of the following packages was updated:

kernel
glibc
linux-firmware
systemd
dbus

There is an application to easily check it:

sudo dnf install yum-utils
needs-restarting -r
| 22 Apr 2022

Establish SSL connection with openssl using custom CA bundle

openssl s_client -verify_return_error -CAfile ats_certs.pem -showcerts -connect www.zilverenkruis.nl:443 -servername www.zilverenkruis.nl
| 21 Apr 2022

curl: Request URL via proxy

It is possible to request a URL in curl via proxy server using -x flag:

curl -x http://127.0.0.1:8080 https://google.com

This will send CONNECT request to your proxy server 127.0.0.1:8080. CONNECT request will ask proxy server to tunnel TCP connection to the destination. This means that, for example, proxy server won’t verify SSL certificate.

To force curl to send regular GET request, use the following command:

curl --request-target https://google.com -x 127.0.0.1:8080 127.0.0.1:8080
| 21 Apr 2022

No sound in Fedora after sleep

If you have no sound after the system comes back from sleep, try to run this command:

sudo systemctl start systemd-suspend
| 28 Mar 2022