Arch linux update grub

How to Update Grub on Arch Linux

For Ubuntu and other Linux systems, GRUB (GRand Unified Bootloader) is a bootloader tool. The Linux kernel, as well as the initial RAM disc (initrd), are loaded by it at system startup. If more than one operating system or kernel is available, the user may choose which one to start. Additionally, it offers the sophisticated users with a command-line interface to directly configure the boot procedure. In this guide, we will discuss the methods of updating Grub on the Arch Linux system.

Update the Arch Linux

Start from the following listed command that is used to update the package databases and upgrade all packages on a system that is running on Arch Linux. The -S flag tells Pacman to sync (install or update) the packages. The -y flag tells Pacman to assume yes as an answer to any question that it may ask. And the -u flag tells Pacman to also upgrade the packages that are already installed on the system. In the output, you can see that the package databases for the core, extra, and community package repositories are already up to date.

Install Grub

Now, if grub is not yet installed, we install it using the “grub” package within a Pacman command. The -S flag tells Pacman to sync (install) the package. In the output, you can see that the “grub” package is already up-to-date and the command reinstalls the package. It then proceeds with the installation of the “grub” package. It checks for file conflicts and available disk space.

Update Grub Using Grub Customizer

The “/etc/default/grub” file is a configuration file for the GRUB boot loader which is used to manage the boot procedure of the system. It contains various options and settings that determine how GRUB behaves and what options are presented to the user at boot time. It is important to be cautious when editing this file since making mistakes or using incorrect settings can lead to the system being unable to boot. After making changes to it, save it using Ctrl+S.

Grub-customizer is a graphical interface tool to configure the grub2/burg settings and appearance. It allows the users to edit the menu entries, update the GRUB configuration file, change the background image, and more which provide an easy-to-use interface to manage the boot process. The following command is used to install the “grub-customizer” package on a system that runs on Arch Linux. In the output, you can see that Pacman installs the “grub-customizer” package. Pacman then checks the available disk space and processes the package changes.

Читайте также:  Linux etc environment file

Now, search for the Grub Customizer application in your system activity area as shown in the following image. Then, open it.

It might require authentication. Therefore, add your system password to continue.

You can see the configuration settings if you want to make any changes in the first place.

Within its “Appearance settings” tab, you can find the settings regarding the appearance of your Linux system. After making changes, save and close the Grub Customizer.

The GRUB2 “grub.cfg” bootloader file is generated by the grub-mkconfig command based on the settings in the /etc/default/grub file and the files in the /etc/grub.d directory. By generating the grub.cfg file, you can ensure that your system’s boot loader is configured correctly and that it includes the latest changes that you made to your system’s boot settings using Grub Customizer.

Using the Update-Grub Repository

If you find the previous method tricky and long, you can switch to the installation of the update-grub repository from Git. The following command is used to install the “git” and “base-devel” packages on Arch Linux. The “base-devel” is a group of packages that are commonly used to build and compile the software from the source on Arch Linux. The command asks the user to confirm the installation and shows the total size of packages to be installed and the net upgrade size. Once the user confirms with y, the command proceeds with the installation.

The following command is used to download a copy of a package called “update-grub” from the Git version control system. The package is downloaded to a new directory called “update-grub” in the current working directory. The process of downloading the package is called cloning. It includes several steps like enumerating the objects, counting the objects, compressing the objects, reusing the objects, and receiving the objects. After downloading the package, you can apply it by going to the update-grub directory.

The update-grub folder can be found in the current working directory of Arch Linux as per the ls command.

Читайте также:  Upgrade kernel alt linux

[ omar @ omar ~ ] $ ls
Desktop Downloads Pictures Templates docker-git update-grub
Documents Music Public Videos index.jpg yay

The next command, “cd update-grub”, changes the current working directory to the directory of the cloned repository.

The final command, “makepkg -sri”, is used to build and install the package from the cloned repository using the makepkg utility. The “-s” flag is to build the package with all dependencies. The “r” flag is to install the package after building it. And the “i” flag is to isntall the package without prompting for confirmation.

The following command uses the AUR “yay” helper program to install the “update-grub” package from the Arch User Repository (AUR). The command first checks for any package conflicts and inner conflicts. Then, it lists the package it finds (update-grub 0.0.1-7) and prompts the user to confirm the installation.

Here are the instructions to update the Grub bootloader configuration file on the system. The command is typically used after making changes to the system’s boot configuration such as installing a new operating system or modifying the boot order of the existing operating systems. The command generates the Grub configuration file by searching for the installed Linux kernels and initial ram disk images and then adding them as boot options in the configuration file.

Conclusion

The guide introduction lets you know about the uses of Grub in different Linux-like operating systems. It tells how important it is to use it for boot loading. After this, we installed Grub on Arch Linux and discussed two different ways to update it one by one using the grub customizer and the update-grub repository of Git. Using the grub configuration file shows how you can make changes and then save it for boot loading.

About the author

Omar Farooq

Hello Readers, I am Omar and I have been writing technical articles from last decade. You can check out my writing pieces.

Источник

Как обновить загрузчик GRUB в Arch Linux и производных дистрибутивах (Manjaro, BlackArch)

Загрузчик операционной системы GRUB устанавливается и обновляется в Linux как и любой другой пакет программного обеспечения. Но особенностью загрузчика является то, что даже после обновления пакета, фактически работающие файлы загрузчика, которые находятся в разделе, монтируемом по пути /boot/grub/, не обновляются автоматически.

То есть при выходе новых версий GRUB, пакет в вашей ОС обновляется автоматически.

Но сам загрузчик, который устанавливается на отдельном разделе диска и монтируется по пути /boot/grub/, не обновляется.

Чтобы начать использовать новые функции, которые добавлены в новые версии GRUB, вам нужно вручную обновить загрузчик.

Читайте также:  Восстановление линукс через терминал

Когда нужно обновлять загрузчик GRUB в /boot/grub/

Сигналом, что вышла новая версия GRUB, является примерно следующее сообщение:

(3/4) upgrading grub [######################] 100% :: To use the new features provided in this GRUB update, it is recommended to install it to the MBR or UEFI. Due to potential configuration incompatibilities, it is advised to run both, installation and generation of configuration: $ grub-install . $ grub-mkconfig -o /boot/grub/grub.cfg

В этом сообщении говориться, чтобы использовать новые функции, представленные в этом обновлении GRUB, рекомендуется установить его в MBR или UEFI. Из-за потенциальной несовместимости конфигурации рекомендуется выполнить как установку, так и создание конфигурации. А также даны примерные команды.

То есть если вы видите это сообщение, значит вам нужно обновить загрузчик в /boot/grub/.

Проверка, используется ли GRUB в операционной системе

В Arch Linux и производных дистрибутивах пакет GRUB может быть установлен, но при этом не используется, поскольку загрузчиком является systemd-boot.

Чтобы убедиться, что в качестве загрузчика используется именно GRUB, выполните следующую команду:

Если файл /boot/grub/grub.cfg найден, значит используется GRUB, если файл grub.cfg не найден, значит GRUB не используется и обновлять его не нужно. То есть не нужно выполнять действия, показанные в данной статье!

Как обновить загрузчик GRUB в /boot/grub/

Для обновления загрузчика нужно выполнить команду вида:

grub-install --recheck /dev/DISK

Где в качестве /dev/DISK нужно указать имя вашего диска.

Имена дисков можно проверить командой:

Disk /dev/vda: 30 GiB, 32212254720 bytes, 62914560 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x4b23ea92 Device Boot Start End Sectors Size Id Type /dev/vda1 * 2048 411647 409600 200M 83 Linux /dev/vda2 411648 62914559 62502912 29.8G 83 Linux

В данном случае именем диска является /dev/vda. Обратите внимание, что /dev/vda — это не загрузочный или какой-то другой раздел — это весь диск.

Итак, команда для обновления GRUB в /boot/grub/ в моём случае следующая:

grub-install --recheck /dev/vda

Также необходимо создать новый файл конфигурации следующей командой:

grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file . Found linux image: /boot/vmlinuz-linux Found initrd image: /boot/initramfs-linux.img Found fallback initrd image(s) in /boot: initramfs-linux-fallback.img Warning: os-prober will not be executed to detect other bootable partitions. Systems on them will not be added to the GRUB boot configuration. Check GRUB_DISABLE_OS_PROBER documentation entry. Adding boot menu entry for UEFI Firmware Settings . done

Обновление загрузчика GRUB и обновление конфигурации GRUB завершилось успешно. При следующей загрузке, ваша операционная система будет использовать новые функции, которые были добавлены обновлением GRUB.

Близкие статьи

Источник

Оцените статью
Adblock
detector