From the Firehose

Шпаргалка встановлення Arhc Linux

Шпаргалка встановлення Arhc Linux

1. Підключення інтернет wi-fi

    iwctl
    device list
    station wlan0 scan
    station wlan0 get-networks
    station wlan0 connect UPCCE2B671E
    station wlan0 show
    exit //or CTRL + C

2. cfdisk

lsblk
cfdisk /dev/nvme0n1 //створення розділів
    efi
    swap
    root
    home

3. Форматування та монтування розділів

  mkfs.vfat /dev/nvme0n1p2
  mkfs.ext4 /dev/nvme0n1p3
  (mk.swap /dev/...)
  
  mount /dev/nvme0n1p3 /mnt
  
  mkdir -p /mnt/boot/efi
  mount /dev/nvme0n1p2 /mnt/boot/efi
  
  mkdir /mnt/home
  mount /dev/nvme0n1p1 /mnt/home
  (swapon /dev/...)

4. Встановлення пакетів

pacstrap -K /mnt base base-devel linux linux-firmware 
linux-headers dhcpcd vim bash-completion grub efibootmgr xorg plasma 
ttf-jetbrains-mono-nerd ttf-ubuntu-font-family ttf-hack ttf-dejavu
ttf-opensans kate konsole dolphin chromium 

5.

genfstab -U /mnt >> /mnt/etc/fstab
vim /mnt/etc/fstab 

6. Перехід у встановлену систему

arch-chroot /mnt

7.Користувачі

passwd (пароль для root)
vim /etc/sudoers  (розкоментувати %wheel ALL=(ALL) ALL)
useradd -mg users -G wheel peturik
passwd peturik

8. Назва комп'ютреа

vim /etc/hostname (напр. precision_5540)
vim /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 precision_5540.localdomain precision_5540

9. Час

Налаштування часу ВАЖЛИВО! Перед налаштуванням часу потрібно вийти з arch-chroot командою exit. Для початку робимо синхронізацію із сервером NTP:

timedatectl set-ntp true 
timedatectl set-timezone Europe/Kiev
timedatectl status 
ln -sf /usr/share/zoneinfo/Europe/Kiev /etc/localtime 
ls /usr/share/zoneinfo 
hwclock --systohc

9. Мова

vim /etc/locale.gen (uk_UA.UTF-8 UTF-8, en_US.UTF-8 UTF-8)
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf (мова системи)
systemctl enable NetworkManager dhcpcd sddm

10. Bootloader install

grub-install --target=x86_64-efi --bootloader-id=grub_uefi --recheck /dev/nvme0... grub-mkconfig -o /boot/grub/grub.cfg
exit
umount -R /mnt
reboot

https://habr.com/ru/articles/805671/ https://habr.com/ru/articles/819729/

Category: Linux | Comments: 0

p7zip

Installation

Install the p7zip package.

The command to run the program is the following:

$ 7z

Examples

Warning: Do not use 7z format for backup purposes, because it does not save owner/group of files. See 7z(1) § Backup and limitations for more details.

Add file/directory to the archive (or create a new one):

$ 7z a archive_name file_name

Also it is possible to set password with flag -p and hide structure of the archive with flag -mhe=on:

$ 7z a archive_name file_name -p -mhe=on

Update existing files in the archive or add new ones:

$ 7z u archive_name file_name

List the content of an archive:

$ 7z l archive_name

Extract all files from an archive to the current directory without using directory names:

$ 7z e archive_name

Extract with full paths:

$ 7z x archive_name

Extract into a new directory:

$ 7z x -ofolder_name archive_name

Check integrity of the archive:

$ 7z t archive_name

https://wiki.archlinux.org/title/P7zip

Category: Linux | Comments: 0

Fixing update-grub command not found Error in Arch Linux

Why do you see 'update-grub' command not found error?

You see the error because update-grub is not a standard command like ls, cd etc. It's not even a standard command that is installed with grub.

In Ubuntu, the command is just an alias and when you run the update-grub command, it runs the following command instead:

sudo grub-mkconfig -o /boot/grub/grub.cfg

The grub-mkconfig is the command for managing grub. But the above command is difficult to remember so the aliased shortcut update-grub was created.

📋
You can either run the above grub-mkconfig command or create a custom update-grub command to run the same.

How to fix the update-grub command not found error

You can put some effort and create a custom update-grub command the same way it is implemented on Ubuntu and Debian.

It is a four-step process and I will assist you with every step.

Step 1: Create a new file

To create the update-grub command, the first step is to create a new file.

So open your terminal and use the following command:

sudo nano /usr/sbin/update-grub

What the above command will do is create a new file named update-grub in the /usr/sbin/ directory.

If you notice, there's a nano command used which is a text editor which is responsible for creating an opening the file just after executing the command.

It will open an empty file looking like this:

create new file to solve update-grub command not found error

Step 2: Write new lines to the file

(secret: you don't have to write but paste those lines 😉)

Once you execute the previous command, it will open the file where you have to add lines.

Simply select the following lines and paste them into the terminal using Ctrl + Shift + V:

#!/bin/sh 
set -e 
exec grub-mkconfig -o /boot/grub/grub.cfg "$@"
file contents to create a new file

Now, save changes and exit from the nano editor using Ctrl + O, press the Enter key and then Ctrl + X.

Step 3: Change ownership of the file

Once you are done creating the file, you have to assign the ownership to the root user of that file.

For that purpose, you'd have to use the chown command in the following manner:

sudo chown root:root /usr/sbin/update-grub
change file ownership in linux

Step 4: Change file permissions

In the last step, you have to change the read-write permissions using the chmod command as shown here:

sudo chmod 755 /usr/sbin/update-grub
change the read write permissions of the file

What the above command will do is only the file owner can read, write, and execute the file whereas others can only read and execute.

Once done, use the update-grub command it should work like you expect:

sudo update-grub
solved: sudo: update-grub: command not found error

What's next? How about customizing GRUB?

Well, there's a perception that everything related to GRUB is difficult but it is not and customize the GRUB bootloader as per your liking without any complex steps.

For that purpose, you'd have to install grub customizer, a GUI utility to customize grub easily.

Sounds interesting? Here's a detailed guide on how to install and use grub customizer on Linux:

Customize Grub to Get a Better Experience With Linux
Couple of Grub configuration tweaks to get better experience with multi-boot Linux system using Grub Customizer GUI tool.

I hope you will find this guide helpful.

Category: Linux | Comments: 0

Автоматичний вхід в Arch Linux (SDDM)

Налаштування автоматичного входу до системи SDDM

1. Перевірка наявності SDDM

Перед налаштуванням автоматичного входу SDDM необхідно переконатися, що він встановлений на комп'ютері. Для цього можна використати команду:

systemctl status sddm

Якщо SDDM не встановлений, його можна встановити командою:

sudo pacman -S sddm

2. Редагування конфігураційного файлу SDDM

В Arch Linux конфігураційний файл для SDDM розташований за замовчуванням /usr/lib/sddm/sddm.conf.d/default.conf. Цей файл можна відредагувати для налаштування SDDM, включаючи автоматичний вхід.

Відкрийте файл /usr/lib/sddm/sddm.conf.d/default.conf через термінал з правами адміністратора:

sudo vim /usr/lib/sddm/sddm.conf.d/default.conf

Додайте або відредагуйте наступні рядки, щоб увімкнути автоматичний вхід:

[Autologin]
User=username
Session=session_name.desktop

Замініть username на ім'я користувача та session_name.desktop на ім'я вашого графічного сеансу (наприклад, "plasma.desktop" або "i3").

Приклад:

[Autologin]
User=username
Session=i3

Category: Linux | Comments: 0

Install ArchLinux

Підключення до мережі

Ви можете підключити кабелем інтернет або підключитись до WiFi. Щоб підключитись до бездротової мережі використайте iwd.

Використання iwd

Для початку пропишіть команду iwctl після вже команди iwctl:

  • Подивитись список девайсів
    device list
  • Подивитись список станцій
    station list
  • Увімкнути/Вимкнути адаптер
    adapter адаптер set-property Powered on/off:
  • Увімкнути сканування
    station станція scan
  • Отримати список доступних мереж
    station станція get-networks
  • Підключитись до мережі
    station станція connect назваWiFi
  • Подивитись статус станції
    station станція show



Після підключення до мережі можна переходити до наступної частини.

Розбивання диску

Для початку введіть команду fdisk -l знайшовши ваш пристрій введіть fdisk /dev/диск. В моєму випадку це

Введіть p, щоб вивести розбиття диску. Видаляйте за допомогою d усі розділи за винятком Linux home, якщо він є.

Нам треба 4 розділи:

  • EFI System потрібно для запуску системи. 512Мб вистачить
  • Linux swap фізичне розширення оперативної пам’яті. Розмір за бажанням
  • Linux root для системи. Як мінімум 8 Гб
  • Linux home для особистих даних. Увесь залишок

Тепер треба розтавити мітки. Для цього треба ввести t та код мітки:

  • EFI System — 1
  • Linux swap — 19
  • Linux root(x86_64) — 23
  • Linux home — 42

Тепер пишемо w, для запису змін.

Форматування розділів

EFI system потребує саме FAT32
Linux swap треба відформатувати та активувати, як swap
Linux root/home можуть використовувати майже будь-яку файлову систему. Але ми будемо використовувати саме btrfs.

Для цього треба ввести ці команди:
mkfs.fat -F 32 /dev/efi_розділ
mkswap /dev/swap_розділ
swapon /dev/swap_розділ
mkfs.btrfs /dev/root_розділ
mkfs.btrfs /dev/home_розділ

Монтування розділів

Зараз треба усе вже змонтувати
mkdir /mnt
mount /dev/root_розділ /mnt
mkdir /mnt/EFI

mount /dev/EFI_розділ /mnt/EFI
mkdir /mnt/home
mount /dev/home_розділ /mnt/home

Встановлення пакетів

Базові пакети base linux linux-firmware
Базові програми coreutils util-linux vim sudo
Мікрокод процесора залежно від виробника встановіть amd-ucode або intel-ucode
Пакети для grub grub efibootmgr os-prober
Пакети для інтернету networkmanager dhcpcd
Драйвери для відеокарт mesa та залежно від виробника xf86-video-amdgpu xf86-video-ati xf86-video-intel nvidia nvidia-utils
Пакети KDE plasma sddm kate dolphin konsole
Звук pipewire pipewire-media-session pipewire-audio pipewire-alsa pipewire-jack pipewire-pulse
Браузер firefox
Можна додавати інші за бажанням

Команда
pacstrap -K /mnt пакети

Тепер треба почекати встановлення пакетів

Конфігурування

Введіть команду genfstab -U /mnt >> /mnt/etc/fstab

В этот файл должны записаться все разделы, что мы делали. Но нужно проверить,
всё ли записалось. Для этого вводим следующее:


vim /mnt/etc/fstab


gggg

Category: Linux | Comments: 0

fdisk

У дистрибутивах Linux на KVM і OpenVZ VPS fdisk є найкращим інструментом для керування розділами диска. Fdisk є текстовою утилітою, яка досить проста в роботі і найчастіше знаходиться в пакеті разом із самим дистрибутивом. Використовуючи fdisk, можна створити новий розділ, видалити або змінити існуючий розділ.

https://vps.ua/wiki/ukr/fdisk-linux/

Category: Linux | Comments: 0

Pacman dependencies

sudo pacman -Rs назва_пакета 
&& sudo pacman -Scc 
&& sudo pacman -Rsn $(pacman -Qtdq)
  1. Видалити пакет з усіма необхідними залежностями (якщо вони не потрібні іншим встановленим пакетам).

    2. Очищаємо локальний кеш Pacman (/var/cache/pacman/pkg).

    3. Проглядаємо осиротілі пакети, які були налаштовані в якості залежностей, але тепер уже не потрібні іншим пакетам. Видаляємо знайдене разом з конфігураційними файлами.

Category: Linux | Comments: 0

Ventoy

Installation

Install the ventoy-binAUR or ventoyAUR package.

Usage

Warning: The drive used will be erased and all its existing data will be lost after setup.

There are three utilities for setting up the media:

  1. /opt/ventoy/Ventoy2Disk.sh, which is a shell script to be run from the command line.
  2. /opt/ventoy/VentoyGUI.x86_64, which is a graphical application. xauth or a similar application is needed to escalate to root if the application is not started with root permissions.
  3. Opening file:///opt/ventoy/WebUI/index.html with a web browser.

The same utilities can be used for upgrading the Ventoy installation on the drive.

Ventoy creates two partitions on the drive. Their default names are Ventoy and VTOYEFI. The Ventoy partition is to store the bootable images (iso files), and any other data. VTOYEFI is for the Ventoy binaries.

To add images from which you can boot, mount the first partition and copy the images over.

 

 ~  sudo /opt/ventoy/Ventoy2Disk.sh             
[sudo] пароль до peturik:  

**********************************************
     Ventoy: 1.0.99  x86_64
     longpanda admin@ventoy.net
     https://www.ventoy.net
**********************************************

Usage:  Ventoy2Disk.sh CMD [ OPTION ] /dev/sdX
 CMD:
  -i  install Ventoy to sdX (fails if disk already installed with Ventoy)
  -I  force install Ventoy to sdX (no matter if installed or not)
  -u  update Ventoy in sdX
  -l  list Ventoy information in sdX

 OPTION: (optional)
  -r SIZE_MB  preserve some space at the bottom of the disk (only for install)
  -s/-S       enable/disable secure boot support (default is enabled)
  -g          use GPT partition style, default is MBR (only for install)
  -L          Label of the 1st exfat partition (default is Ventoy)
  -n          try non-destructive installation (only for install)

 ~  

 ~  sudo /opt/ventoy/Ventoy2Disk.sh -i /dev/sda

**********************************************
     Ventoy: 1.0.99  x86_64
     longpanda admin@ventoy.net
     https://www.ventoy.net
**********************************************

Disk : /dev/sda
Size : 58 GB
Style: MBR


Attention:
You will install Ventoy to /dev/sda.
All the data on the disk /dev/sda will be lost!!!

Continue? (y/n) y

All the data on the disk /dev/sda will be lost!!!
Double-check. Continue? (y/n) y

Category: Linux | Comments: 0

rm утиліта

Матеріал з Вікіпедії — вільної енциклопедії.

Перейти до навігаціїПерейти до пошуку

rm (від англ. remove) — утиліта у UNIX та UNIX-подібних системах, що використовується для видалення файлів з файлової системи. Деякі ключі, що використовуються з rm:

  • -r , -R— обробляти всі вкладені підкаталоги. Цей ключ необхідний, якщо файл, що видаляється, є каталогом, нехай навіть порожнім. Якщо файл, що видаляється, не є каталогом, то ключ -r не впливає на команду rm.
  • -i — виводити запит на підтвердження кожної операції видалення.
  • -f — не повертати код помилкового завершення, якщо помилки були викликані файлами, що не існують; не запрошувати підтвердження операцій.

rm може бути синонімом (alias) команди rm -i, тобто команда за умовчанням запрошує підтвердження перед видаленням файлів, що дозволяє запобігти їх випадковому видаленню. Якщо користувачеві потрібно видалити велику кількість файлів без підтвердження операції, можна скасувати дію ключа -i за допомогою додавання ключа -f.

Приклад використання:
rm -rf mydir — рекурсивно видалити без підтвердження та коду помилкового завершення файл (або каталог) mydir.

Category: Linux | Comments: 0

ZSH terminal

Install zsh

  1. Install zsh in Arch Linux
sudo pacman -S zsh
  1. Set Zsh as default shell
chsh -s /usr/bin/zsh
# or
sudo chsh -s $(which zsh)
  1. Log out and then login again to your terminal to use the new Zsh shell.
echo $SHELL
/usr/bin/zsh
  1. Install oh-my-zsh using curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  1. Use agnoster zsh theme

Edit the ~/.zshrc file, edit this following line

ZSH_THEME="robbyrussell"

Into

ZSH_THEME="agnoster" # (this is one of the fancy ones)
# see https://github.com/ohmyzsh/ohmyzsh/wiki/Themes#agnoster

Save the file, and then open a new terminal to see the changes that we did

  1. Install powerlevel10k for Oh my zsh

Run this following command :

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

Now, edit the ZSH_THEME in ~/.zshrc file into :

ZSH_THEME="powerlevel10k/powerlevel10k"

Open a new terminal, and you should see the powerlevel10k theme has applied. If the p10k configuration wizard does not start automatically, you can run the configuration wizard the powerlevel10k theme with this command :

p10k configure

After you run the command above, p10k will prompt some questions, and you can choose the answer based on your personal preferences.

  1. Install plugins (zsh-autosuggestions and zsh-syntax-highlighting)

Download zsh-autosuggestions :

git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions 

Download zsh-syntax-higlighting :

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting

Install eza ulility:

sudo pacman -S eza

Edit ~/.zshrc file, find plugins=(git) replace plugins=(git) with :

plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

alias ls="eza --level=1 --icons=always --group-directories-first --color=always --sort=extension"

Reopen your terminal, now you should be able to use the auto suggestions and syntax highlighting.

Category: Linux | Comments: 0

About

Customize this section to tell your visitors a little bit about your publication, writers, content, or something else entirely. Totally up to you.