Tag: BlackArch

Errors “Incorrect definition of table mysql.event: expected column ‘definer’ at position 3 to have type varchar(, found type char(141)” and “Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler” (SOLVED)

When upgrading mariadb to version 10.8.3, the following messages were shown:

warning: directory permissions differ on /usr/lib/mysql/plugin/auth_pam_tool_dir/
filesystem: 700  package: 755
:: MariaDB was updated to a new feature release. To update the data run:
   systemctl restart mariadb.service && mariadb-upgrade -u root -p

They contain information about two events that require the action of a system administrator or user.

The second one is more important, it says that to update the data, you need to run the specified commands.

An error occurred when initializing system tables. Disabling the Event Scheduler (SOLVED)

First, restart the DBMS service and check its status:

sudo systemctl restart mariadb.service
systemctl status mariadb.service

Sample output:

● mariadb.service - MariaDB 10.8.3 database server
     Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
     Active: active (running) since Wed 2022-06-01 03:40:27 MSK; 34s ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 1271213 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 1271214 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
    Process: 1271261 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
   Main PID: 1271247 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 14 (limit: 4690)
     Memory: 187.7M
        CPU: 788ms
     CGroup: /system.slice/mariadb.service
             └─1271247 /usr/bin/mariadbd

Jun 01 03:40:26 suip.biz mariadbd[1271247]: 2022-06-01  3:40:26 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
Jun 01 03:40:26 suip.biz mariadbd[1271247]: 2022-06-01  3:40:26 0 [Note] InnoDB: log sequence number 38052502275; transaction id 74463190
Jun 01 03:40:26 suip.biz mariadbd[1271247]: 2022-06-01  3:40:26 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
Jun 01 03:40:26 suip.biz mariadbd[1271247]: 2022-06-01  3:40:26 0 [Note] Server socket created on IP: '127.0.0.1'.
Jun 01 03:40:26 suip.biz mariadbd[1271247]: 2022-06-01  3:40:26 0 [ERROR] Incorrect definition of table mysql.event: expected column 'definer' at position 3 to have type varchar(, found type char(141).
Jun 01 03:40:26 suip.biz mariadbd[1271247]: 2022-06-01  3:40:26 0 [ERROR] mariadbd: Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
Jun 01 03:40:26 suip.biz mariadbd[1271247]: 2022-06-01  3:40:26 0 [Note] /usr/bin/mariadbd: ready for connections.
Jun 01 03:40:26 suip.biz mariadbd[1271247]: Version: '10.8.3-MariaDB'  socket: '/run/mysqld/mysqld.sock'  port: 3306  Arch Linux
Jun 01 03:40:27 suip.biz systemd[1]: Started MariaDB 10.8.3 database server.
Jun 01 03:40:27 suip.biz mariadbd[1271247]: 2022-06-01  3:40:27 0 [Note] InnoDB: Buffer pool(s) load completed at 220601  3:40:27

On the one hand, the service is up and running. However, there are a few error messages as well as a few warnings. Most important messages:

[ERROR] Incorrect definition of table mysql.event: expected column 'definer' at position 3 to have type varchar(, found type char(141).
[ERROR] mariadbd: Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.

Action must be taken to fix errors.

To do this, run a database update:

sudo mariadb-upgrade -u root -p

You will need to enter the password of the DBMS root user and wait for the command to complete.

Then restart the service again and check its status:

sudo systemctl restart mariadb.service
systemctl status mariadb.service

As you can see, there are no errors.

directory permissions differ on /usr/lib/mysql/plugin/auth_pam_tool_dir/ filesystem: 700 package: 755 (SOLVED)

Now let's look at the second message:

warning: directory permissions differ on /usr/lib/mysql/plugin/auth_pam_tool_dir/
filesystem: 700 package: 755

This is not an error, but a warning. The bottom line is that the permission on the /usr/lib/mysql/plugin/auth_pam_tool_dir/ directory differs between the actual value in the file system and the one specified in the installation package.

The most likely reasons for this are:

  • in the previous version of the package, different permissions were specified for the directory, and then the package maintainers decided to change them for one reason or another
  • you yourself changed the permissions to the specified directory

To bring the value of permissions to those recommended in the installation package, start by checking the current value:

sudo ls -dl /usr/lib/mysql/plugin/auth_pam_tool_dir/

Then run the chmod command with the desired permissions:

sudo chmod 755 /usr/lib/mysql/plugin/auth_pam_tool_dir/

Check your permissions again:

sudo ls -dl /usr/lib/mysql/plugin/auth_pam_tool_dir/

As you can see in the following screenshot, the permissions to the specified directory have been changed:

“Error: failed to commit transaction (invalid or corrupted package)” (SOLVED)

When updating or installing packages in Arch Linux, Manjaro and their derivatives, you may encounter the “error: failed to commit transaction (invalid or corrupted package). Errors occurred, no packages were upgraded.” issue.

Full error log:

:: Retrieving packages...
 libinih-55-2-x86_64                                15.4 KiB   385 KiB/s 00:00 [############################################] 100%
(40/40) checking keys in keyring                                               [############################################] 100%
(40/40) checking package integrity                                             [############################################] 100%
error: libinih: signature from "Maxime Gauduin <alucryd@gmail.com>" is marginal trust
:: File /var/cache/pacman/pkg/libinih-55-2-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: failed to commit transaction (invalid or corrupted package)
Errors occurred, no packages were upgraded.

In this case, the error occurs when trying to update the libinih package, but it can occur for other packages as well.

First, try delete the package, as recommended, and run the update again to download the installation package file. This will resolve the issue if the error is caused by a corrupted package, such as a network outage.

If this does not help, then instead of a complete update of the system, run the update of the archlinux-keyring package:

sudo pacman -Sy archlinux-keyring

This should fix the PGP signature verification issue.

This error and the problem with incorrect PGP signature can occur on systems that are rarely updated (updated with long breaks). The error lies in the fact that packages with “invalid” PGP signatures are signed with keys that are contained in the updated version of the archlinux-keyring package. Therefore, by starting with updating archlinux-keyring you get new versions of the keys, which then successfully verify the PGP signatures of the package files.

Changes in the linux-firmware package: kernel requirements, separating large files into separate packages

In Arch Linux, the linux-firmware package, which contains the firmware files, got important changes. In addition to the usual file updates and adding support for new devices, this package has a requirement for a minimum kernel version, and the package itself is divided into several packages.

Recall that device firmware are files that are necessary for the normal operation of the hardware in addition to kernel modules (drivers).

The linux-firmware package now implements kernel firmware compression and also requires Linux kernel version 5.3 or later with support for booting from compressed xz firmware. The CONFIG_FW_LOADER_COMPRESS kernel option must be enabled. All official Arch Linux kernels have supported this for a long time.

The linux-firmware package has been split into smaller packages to further reduce disk space requirements. Some large firmware files for rarely used hardware have been split into separate packages. This affects firmware for Mellanox Spectrum switches, Marvell devices, Qualcomm SoCs, Cavium LiquidIO server adapters, QLogic devices, Broadcom NetXtreme II 10Gb Ethernet adapters. Be sure to install additional firmware packages if needed.

The following packages are now in the official Arch Linux repository:

  • linux-firmware and linux-firmware-whence – the main firmware packages for a wide variety of hardware
  • linux-firmware-bnx2x – firmware for NetXtreme II 10Gb Ethernet adapters
  • linux-firmware-liquidio – Cavium LiquidIO server adapters
  • linux-firmware-marvell – firmware for Marvell devices
  • linux-firmware-mellanox – firmware for Mellanox Spectrum switches
  • linux-firmware-nfp – firmware for Netronome Flow Processors (nfp)
  • linux-firmware-qcom – firmware for Qualcomm SoCs (qcom)
  • linux-firmware-qlogic – firmware for Qlogic devices (qlogic)

Error “cannot resolve dependency lib32 (32-bit library)” (SOLVED)

When installing a package on Arch Linux or a distro derived from it, for example, by running the following command:

sudo pacman -S trid

an error may occur stating that dependencies could not be resolved. The name of this dependency can contain the number “32” or the string “lib32”, that is, it is a 32-bit package, for example:

resolving dependencies...
warning: cannot resolve "lib32-ncurses", a dependency of "trid"
:: The following package cannot be upgraded due to unresolvable dependencies:
      trid

:: Do you want to skip the above package for this upgrade? [y/N]

To fix this error, multilib must be enabled.

The multilib repository is the official repository that allows the user to run and build 32-bit applications on 64-bit Arch Linux.

To enable multilib, open the text file /etc/pacman.conf:

sudo gedit /etc/pacman.conf

Find and uncomment the lines in it (make sure to uncomment both lines, otherwise the changes will not take effect):

[multilib]
Include = /etc/pacman.d/mirrorlist

Update package information:

sudo pacman -Sy

And re-run the package installer – this time all dependencies should be resolved.

How to install PowerShell on Arch Linux, Manjaro, BlackArch

PowerShell on Linux

PowerShell is a cross-platform automation and configuration tool/platform. PowerShell has a large number of system administration-oriented commands. But at the same time, PowerShell is a full-fledged programming language that allows you to write functional programs (scripts).

Note that PowerShell 5 is currently preinstalled on Windows by default, but this manual shows the installation of the latest version of PowerShell 7. On Windows, you can also install PowerShell 7.

Due to the differences between Windows and Linux operating systems, not all PowerShell functions work on Linux.

Installing PowerShell 7 on Arch Linux, Manjaro, BlackArch

It is recommended to install the pikaur utility according to the article “Automatic installation and update of AUR packages” and then just run the command:

pikaur -S powershell-bin

If you don't want to install pikaur, then run the following command sequence to install PowerShell:

git clone https://aur.archlinux.org/powershell-bin.git
cd powershell-bin
makepkg -si

How to run PowerShell on Arch Linux, Manjaro, BlackArch

To start an interactive PowerShell session, run the command:

pwsh

Linux PowerShell Examples

To list all PS commands on your computer, open PowerShell (pwsh command), and enter there:

Get-Command

It is possible to filter the information displayed by the Get-Command command. Let's say you want to see PowerShell commands containing the word “Alias”, for this you need to run the following command:

Get-Command -Name *Alias

To display help about a command (cmdlet) use the following:

Get-Help COMMANDLET

For example, to display help about the Get-Alias cmdlet:

Get-Help Get-Alias

To get the most complete help on Get-Command, do the following:

Get-Help Get-Command -Full

To display the contents of a folder (in this case the root of the file system), run:

Get-ChildItem /

To list processes run:

Get-Process

To stop the process with ID 10500 use the command as shown below:

Get-Process -Id 10500 | Stop-Process

See also “Linux PowerShell Basics (Beginner's Guide)”.

Loading...
X