Rocky
Introduction
Rocky Linux is an upcoming Linux distribution that is currently in development.
It is intended for subsequent, full binary compatible release using the source code of the Red Hat Enterprise Linux (RHEL) operating system.
The goal of the project is to provide a community-supported manufacturing enterprise operating system.
The Rocky Linux version was released on April 30, 2021.
Rocky installation
You can download the image on the site www.rockylinux.org
Step-by-step instructions
Rocky Linux installation
here
Installing Rocky Linux on VirtualBox
After installation
I recommend the following:
sudo yum -y update
sudo yum install -y redhat-lsb-core net-tools epel-release kernel-headers kernel-devel yum-utils
sudo yum groupinstall -y "Development Tools"
You probably will. enable network interfaces
Find out the story.
You can find the version of the installed rocky command
cat /etc/system-release
Rocky Linux release 8.4 (Green Obsidian)
Or
cat /etc/rocky-release
Rocky Linux release 8.4 (Green Obsidian)
Or
rpm -q rocky-release
rocky-release-8.4-26.el8.noarch
If you install a package redhat-lsb
lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch Distributor ID: Rocky Description: Rocky Linux release 8.4 (Green Obsidian) Release: 8.4 Codename: GreenObsidian
If only the main version is enough, you can use it.
rpm --eval %{rocky_ver}
8
Software Installation
It is a good idea to update the package manager. In Rocky, it's called yum.
yum update
For quiet installation use flag -y
yum install -y redhat-lsb-core net-tools epel-release kernel-headers kernel-devel
yum groupinstall -y "Development Tools"
For installation of graphical shell execute command
yum groupinstall -y "X Window System" "MATE Desktop"
Add a user to the sudo group
All users in the group wheel It is possible to carry out command sudo So you have to root.
su
And from root add the user to the wheel command group
usermod -aG wheel andrei
It is possible to become a user again.
su andrei
Network Configuration
Considered in a separate article - «Configure network connections in rocky»
Wget installation
sudo yum install wget
Installation Go
You can download Golang from the website. golang.org
wget https://golang.org/dl/go1.15.5.linux-386.tar.gz
After downloading, check that the checksum matches the amount recorded on the site.
sha256sum go1.15.5.linux-386.tar.gz
4c8179d406136979724c71732009c7e2e7c794dbeaaa2a043c00da34d4be0559 go1.15.5.linux-386.tar.gz
Coincides with the value on the site - look at the bottom line
Unpack the archive.
sudo tar -C /usr/local -xzf go1.15.5.linux-386.tar.gz
Add the way to go to PATH
vi ~/.bash_profile
export PATH=$PATH:/usr/local/go/bin
Create a working directory
mkdir ~/go
Check if Go's installed.
go version
If you got something like that.
go version go1.15.5 linux/386
It's okay.
You got a mistake.
-bash: /usr/local/go/bin/go: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
Try glibc. i686
sudo yum install glibc.i686
Installation X
Installation and configuration of the X server are discussed in a separate article - «X Window System in Rocky»
Useful commands
Moving between X and the real terminal (physical terminal) is done by pressing the right CTRL + F2 - to go to the console
Right CTRL + F1 - to go to X
To know the name of your console execute
tty
/dev/pts/0
Find out who is connected to the execution system
who
andrei tty1 2020-11-19 11:03 (:0) andrei pts/0 2020-11-19 11:45 (:0) andrei tty2 2020-11-19 11:42 andrei pts/1 2020-11-19 11:48 (192.168.56.1)
Tty1 and Tty2 are real terminals.
pts/0 is a pseudo terminal running in local machine lawsuits.
pts/1 is a pseudo terminal on a remote machine with IP 192.168.56.1 from which I connected via ssh
In
Linux
All are files and tty terminals are no exception.
Do it.
ls -l $(tty)
Or similar command.
ls -l /dev/pts/1
crw--w----. 1 andrei tty 136, 1 Nov 19 12:43 /dev/pts/1
The first character is the file type.
Seven file types are available: ordinary, directories, character, blocks, sockets, named channels, symbolism
- : regular file
d : directory
c : character device file
b : block device file
s : local socket file
p : named pipe
l : symbolic link
The c signifier means character. So this file can
accept and display characters
If
ls -ld /etc
drwxr-xr-x. 118 root root 8192 Nov 19 11:02 /etc
You can see that the file type d. I mean, directory
To view disks/blocks, execute
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 8G 0 disk ├─sda1 8:1 0 1G 0 part /boot └─sda2 8:2 0 7G 0 part ├─rocky-root 253:0 0 6.2G 0 lvm / └─rocky-swap 253:1 0 820M 0 lvm [SWAP] sr0 11:0 1 57.7M 0 rom /run/media/andrei/VBox_GAs_6.1.10
If
ls -l /dev/sda*
brw-rw----. 1 root disk 8, 0 Nov 19 11:02 /dev/sda brw-rw----. 1 root disk 8, 1 Nov 19 11:02 /dev/sda1 brw-rw----. 1 root disk 8, 2 Nov 19 11:02 /dev/sda2
You can make sure that the file type b. I mean, block
It means that there must be one symbol.
ls -l /dev/sda?
brw-rw----. 1 root disk 8, 1 Nov 19 11:02 /dev/sda1 brw-rw----. 1 root disk 8, 2 Nov 19 11:02 /dev/sda2
[12] means either symbol 1 or symbol 2.
ls -l /dev/sda[12]
brw-rw----. 1 root disk 8, 1 Nov 19 11:02 /dev/sda1 brw-rw----. 1 root disk 8, 2 Nov 19 11:02 /dev/sda2
When you want to know the version of the system, you can
ls -l /etc/system-release
lrwxrwxrwx. 1 root root 13 Jun 19 10:22 /etc/system-release -> rocky-release
File type l signifier link This is not a real file, but a link.
Do it.
ls -l /etc/system-release /etc/rocky-release /etc/redhat-release
lrwxrwxrwx. 1 root root 13 Jun 19 10:22 /etc/redhat-release -> rocky-release -rw-r--r--. 1 root root 41 Jun 19 10:22 /etc/rocky-release lrwxrwxrwx. 1 root root 13 Jun 19 10:22 /etc/system-release -> rocky-release
/etc/rocky-release is a real file and the rest are links to it.
If you used redhat, the real thing would be redhat-release.
Another way to get version information is to execute lsb release-d where -d stands for description.
lsb_release -d
Description: Rocky Linux release 8.4 (Green Obsidian)
You can find out where the lsb release file is located command which lsb release. To get straight to Additional information to execute
ls -lF $(which lsb_release)
-rwxr-xr-x. 1 root root 15929 Apr 18 19:47 /usr/bin/lsb_release*
The -F option indicates the file type. So we were able to see * after lsb release. * means that the file executable.
To find out where the file came from, you can use command rpm with options q (query) and f (file)
rpm -qf $(which lsb_release)
redhat-lsb-core-4.1-47.el8.x86_64
To copy the file in interactive mode use command cp optionally i (interactive)
interactive means that if a file with such a name exists, you will be asked before erasing it.
cp -i /etc/hosts .
cp -i /etc/hosts .
cp: overwrite ‘./hosts’?
To create a directory immediately with a subdirectory inside use commandoi mkdir optionally p (parent)
mkdir -p sites/heiheiru
ls -l sites
total 0
drwxrwxr-x. 2 andrei andrei 6 Nov 19 13:40 heiheiru
To create multiple files with names in order execute touch
touch files/file{1..5}
ls -l files
-rw-rw-r--. 1 andrei andrei 0 Nov 19 13:46 file1 -rw-rw-r--. 1 andrei andrei 0 Nov 19 13:46 file2 -rw-rw-r--. 1 andrei andrei 0 Nov 19 13:46 file3 -rw-rw-r--. 1 andrei andrei 0 Nov 19 13:46 file4 -rw-rw-r--. 1 andrei andrei 0 Nov 19 13:46 file5
To copy the files directory to the sites directory with all the content executed
cp -R files sites
ls -l sites/files/
total 0 -rw-rw-r--. 1 andrei andrei 0 Nov 19 13:49 file1 -rw-rw-r--. 1 andrei andrei 0 Nov 19 13:49 file2 -rw-rw-r--. 1 andrei andrei 0 Nov 19 13:49 file3 -rw-rw-r--. 1 andrei andrei 0 Nov 19 13:49 file4 -rw-rw-r--. 1 andrei andrei 0 Nov 19 13:49 file5
The files directory has been copied to the sites directory, so now sites have
file subdirectory.
If you have a tree module installed, you can visually examine the nesting.
If not, execute first sudo yum install tree
tree sites
sites └── files ├── file1 ├── file2 ├── file3 ├── file4 └── file5 1 directory, 5 files
You can create a link command ln, a symbolic link ln -s
You can clear the terminal by pressing CTRL + l
Learn the details of your SSH connection can be commanded
echo $SSH_CONNECTION
192.168.56.1 52350 192.168.56.101 22
First comes IP and client port, then IP and server port.
To study the contents of a long test file execute
less filename
To search ahead, click / to search back?
Search
Just find
find /usr/share/doc -name '*.pdf'
Find and immediately copy to the current directory
find /usr/share/doc -name '*.pdf' -exec cp {} . \;
Find in the current directory
find -name '*.pdf'
Remove from the current directory
find -name '*.pdf' -delete
Find all the links
find /etc -type l
Find all links only at the top level of nesting
find /etc -maxdepth 1 -type l
df -h /boot
Filesystem Size Used Avail Use% Mounted on /dev/sda1 1014M 194M 821M 20% /boot
Find regular files of a certain size
find /boot -size +20000k -type f
find: ‘/boot/efi/EFI/rocky’: Permission denied find: ‘/boot/grub2’: Permission denied /boot/initramfs-0-rescue-389ee10be1b38d4281b9720fabd80a37.img /boot/initramfs-3.10.0-1160.el7.x86_64.img /boot/initramfs-3.10.0-1160.2.2.el7.x86_64.img
find /boot -size +10000k -type f
find: ‘/boot/efi/EFI/rocky’: Permission denied find: ‘/boot/grub2’: Permission denied /boot/initramfs-0-rescue-389ee10be1b38d4281b9720fabd80a37.img /boot/initramfs-3.10.0-1160.el7.x86_64.img /boot/initramfs-3.10.0-1160.el7.x86_64kdump.img /boot/initramfs-3.10.0-1160.2.2.el7.x86_64.img /boot/initramfs-3.10.0-1160.2.2.el7.x86_64kdump.img
The same plus showing the file size
find /boot -size +10000k -type f -exec du -h {} \;
find: ‘/boot/efi/EFI/rocky’: Permission denied find: ‘/boot/grub2’: Permission denied 60M /boot/initramfs-0-rescue-389ee10be1b38d4281b9720fabd80a37.img 21M /boot/initramfs-3.10.0-1160.el7.x86_64.img 13M /boot/initramfs-3.10.0-1160.el7.x86_64kdump.img 21M /boot/initramfs-3.10.0-1160.2.2.el7.x86_64.img 14M /boot/initramfs-3.10.0-1160.2.2.el7.x86_64kdump.img
Change the user password
To in rocky change the password of the user execute command passwd
[andrei@localhost ~]$ sudo passwd andrei
[sudo] password for andrei:
Changing password for user andrei.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
locale
To rocky find out the current locale
cat /etc/locale.conf
LANG="en_US.UTF-8"
or
localectl status
System Locale: LANG=en_US.UTF-8 VC Keymap: us X11 Layout: us
List of available localities
localectl list-locales
aa_DJ aa_DJ.iso88591 aa_DJ.utf8 aa_ER aa_ER.utf8 aa_ER.utf8@saaho aa_ER@saaho aa_ET aa_ET.utf8 af_ZA af_ZA.iso88591 af_ZA.utf8 am_ET am_ET.utf8 an_ES an_ES.iso885915 an_ES.utf8 ar_AE ar_AE.iso88596 ar_AE.utf8 ar_BH ar_BH.iso88596 ar_BH.utf8 ar_DZ ar_DZ.iso88596 ar_DZ.utf8 ar_EG ar_EG.iso88596 ar_EG.utf8 ar_IN ar_IN.utf8 ar_IQ
Choose only English
localectl list-locales | grep en_US
en_US en_US.iso88591 en_US.iso885915 en_US.utf8
The list of system variables associated with the locale is available by command
locale
LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC=en_US.UTF-8 LC_TIME=en_US.UTF-8 LC_COLLATE="en_US.UTF-8" LC_MONETARY=en_US.UTF-8 LC_MESSAGES="en_US.UTF-8" LC_PAPER=en_US.UTF-8 LC_NAME=en_US.UTF-8 LC_ADDRESS=en_US.UTF-8 LC_TELEPHONE=en_US.UTF-8 LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=en_US.UTF-8 LC_ALL=
Detailed information on each variable can be obtained using -c -k flags.
locale -c -k LC_TIME
LC_TIME abday="Sun;Mon;Tue;Wed;Thu;Fri;Sat" day="Sunday;Monday;Tuesday;Wednesday;Thursday;Friday;Saturday" abmon="Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec" mon="January;February;March;April;May;June;July;August;September;October;November;December" am_pm="AM;PM" d_t_fmt="%a %d %b %Y %r %Z" d_fmt="%m/%d/%Y" t_fmt="%r" t_fmt_ampm="%I:%M:%S %p" era= era_year="" era_d_fmt="" alt_digits= era_d_t_fmt="" era_t_fmt="" time-era-num-entries=0 time-era-entries="S" week-ndays=7 week-1stday=19971130 week-1stweek=7 first_weekday=1 first_workday=2 cal_direction=1 timezone="" date_fmt="%a %b %e %H:%M:%S %Z %Y" time-codeset="UTF-8"
locale -c -k LC_CTYPE
LC_CTYPE ctype-class-names="upper";"lower";"alpha";"digit";"xdigit";"space";"print";"graph";"blank";"cntrl";"punct";"alnum";"combining";"combining_level3" ctype-map-names="toupper";"tolower";"totitle" ctype-width=16 ctype-mb-cur-max=6 charmap="UTF-8" ctype-class-offset=72 ctype-map-offset=86 ctype-indigits_mb-len=1 ctype-indigits0_mb="0" ctype-indigits1_mb="1" ctype-indigits2_mb="2" ctype-indigits3_mb="3" ctype-indigits4_mb="4" ctype-indigits5_mb="5" ctype-indigits6_mb="6" ctype-indigits7_mb="7" ctype-indigits8_mb="8" ctype-indigits9_mb="9" ctype-indigits_wc-len=1 ctype-outdigit0_mb="0" ctype-outdigit1_mb="1" ctype-outdigit2_mb="2" ctype-outdigit3_mb="3" ctype-outdigit4_mb="4" ctype-outdigit5_mb="5" ctype-outdigit6_mb="6" ctype-outdigit7_mb="7" ctype-outdigit8_mb="8" ctype-outdigit9_mb="9" ctype-outdigit0_wc=48 ctype-outdigit1_wc=49 ctype-outdigit2_wc=50 ctype-outdigit3_wc=51 ctype-outdigit4_wc=52 ctype-outdigit5_wc=53 ctype-outdigit6_wc=54 ctype-outdigit7_wc=55 ctype-outdigit8_wc=56 ctype-outdigit9_wc=57 ctype-translit-tab-size=4554 ctype-translit-default-missing-len=1 ctype-translit-ignore-len=0 ctype-translit-ignore="" map-to-nonascii=0
List of available localities
locale -a
Change locale
To rocky, you can change locale or edit the file. locale.conf c /etc/ apply command localect (starting with rocky 7)
Let’s say you have to change the locale to en_us.iso88591
Open up.
locale.conf
and find the line LANG
sudo vi /etc/locale.conf
LANG="en_US.UTF-8"
Replace UTF-8 with iso88591
LANG="en_US.iso88591"
Alternative method of using n sed - Execute command.
sudo sed -i s/LANG=\"en_US\.UTF-8\"/LANG=\"en_US\.iso88591\"/ /etc/locale.conf
To check for changes to execute
localectl status
System Locale: LANG=en_US.iso88591 VC Keymap: us X11 Layout: us
To change a system variable, such as LC CTYPE execute
sudo vi ~/.bashrc
Put the following code at the end of the file
LC_CTYPE="en_US.iso88591"
export LC_CTYPE
locale -c -k LC_CTYPE
LC_CTYPE ctype-class-names="upper";"lower";"alpha";"digit";"xdigit";"space";"print";"graph";"blank";"cntrl";"punct";"alnum";"combining";"combining_level3" ctype-map-names="toupper";"tolower";"totitle" ctype-width=16 ctype-mb-cur-max=1 charmap="ISO-8859-1"
Find out yours. machine-id
cat /etc/machine-id
4af06fd2a0bc4a759da55cb099e1f0f4
Change. machine-id
Remove the old machine-id
sudo rm /etc/machine-id
Create a new machine-id
sudo systemd-machine-id-setup
Check the result.
cat /etc/machine-id
Now it is advisable to restart and check if everything is working correctly.
If the same id is generated all the time, it's probably coming from somewhere else.
You can create it yourself by using dbus--uuidgen
rm -f /etc/machine-id
dbus-uuidgen --ensure=/etc/machine-id
dbus-uuidge --ensure
cat /etc/machine-id
Article author: Andrei Olegovich