Tag: Kali Linux

How to disable “did you mean…” feature in Linux shell

How to disable offers to install a package with an incorrectly entered command

In case the command you entered into the Linux console is not found, some distributions show additional information suggesting which packages the entered command might be in and how it can be installed.

An example of such a message:

Command 'magick' not found, did you mean:
  command 'magic' from deb magic
  command 'magics' from deb magics++
Try: sudo apt install <deb name>

Distributions that use this are for example Kali Linux and Ubuntu.

If for some reason you do not like this behavior of the terminal, and you want the error output to be limited to the message “command not found”, then this article will tell you how to do it.

Since the “did you mean…” feature is provided by the “command-not-found” package, you can remove the package to disable it:

sudo apt remove command-not-found

After that, restart your computer for the changes to take effect.

Solution for no errors appear after removing command-not-found

In order for the “command not found” messages to start showing again after removing command-not-found, restart your computer.

Disabling “did you mean…” feature without removing “command-not-found” package

This method can be used by a non-root user, that is, without the ability to remove packages.

Open file

  • .bashrc (for Bash shell)
  • .zshrc (for Zsh shell)

See also: How to find out which shell is in use in Linux

And add the line there

unset command_not_found_handle

Before adding the specified line to one of the shell files, check for lines that enable command-not-found. For example, in Kali Linux, the following lines are present:

# enable command-not-found if installed
if [ -f /etc/zsh_command_not_found ]; then
    . /etc/zsh_command_not_found
fi

Delete or comment out these lines in the .zshrc file to get:

## enable command-not-found if installed
#if [ -f /etc/zsh_command_not_found ]; then
#    . /etc/zsh_command_not_found
#fi

As a result, the command-not-found feature will be disabled in all newly opened terminals.

Xfce boots without Taskbar and Start button (SOLVED)

From time to time my Kali Linux with Xfce desktop environment boots up without the taskbar and start button. Only desktop shortcuts and the desktop itself are visible, that is, the system looks like this (this is a full, uncropped screen).

It is almost impossible to work in such a system, although Linux works, it allows you to open a terminal window, launch desktop shortcuts.

Usually in this case, I right-clicked on the desktop, selected “Open Terminal Here” from the context menu, and entered the command to reboot the system:

reboot

After a reboot, the Taskbar might or might not appear, just as it did when the computer was turned on.

I don't know if this is a problem with my personal Kali Linux and Xfce installation, or a bug in the desktop environment or VirtualBox.

In addition to rebooting the entire system, there is another, faster way to reboot the desktop.

To do this, press the Win key.

This will open the Operating System Menu.

Click the “Log Out” button with the mouse.

Select “Log Out”.

You will be prompted to enter a username and password to log in.

Enter your username and password.

Now Xfce has booted up normally, with the Taskbar and other elements.

To quickly log out of Linux, you can use the keyboard shortcut Ctrl+Alt+Delete.

Alternatively, you can restart the Display Manager with the following command:

sudo systemctl restart lightdm

To enter it, open the terminal, this can be done by right-clicking on the desktop and selecting “Open Terminal Here”, or use the keyboard shortcut Ctrl+Alt+t

How to connect a TV to a computer in Linux in Xfce (Kali Linux, Xubuntu)

Is it possible to connect a TV or a second monitor to a computer in Linux

This post will show you how to connect a TV or a second monitor to a Linux computer with the Xfce desktop environment. It will also talk about the available settings and solutions to typical problems that arise when connecting a TV to a computer.

Xfce is used in distributions such as Kali Linux and Xubuntu, and the Xfce desktop environment can be installed on any other distribution.

If you have a different desktop environment, then see the articles:

If you are a Windows user, then see the article “How to connect a TV to a computer in Windows 11”.

What you need to connect a TV or an additional monitor to a computer

To connect a TV or a second monitor to a computer or laptop, you need:

  • TV with HDMI connector (all modern models) or monitor with HDMI connector (all monitors released in the last two decades)
  • a computer with an HDMI connector – almost all computers and laptops will fit
  • HDMI cable

Choosing an HDMI cable

I approached the choice of HDMI cable quite simply – I chose the cheapest with the right length, which I found in the store. In subsequent use, this cable fully satisfied my needs.

Despite its cheapness, this HDMI cable supports:

  • UHD 4K@2160P / 4K@60Hz / 4K HDR
  • High Speed HDMI 2.0
  • Gold plated contacts

Cable length 1.8 meters.

Apparently, these are already the minimum characteristics – perhaps more expensive models support higher resolutions and data transfer at higher speeds.

What TV can be connected to a computer

Using an HDMI cable, you can connect any TV with an HDMI connector. This connector is present on all TVs and monitors released in the last decade.

Older TVs without an HDMI connector can also be connected to a computer, but instead of an HDMI cable, you will need a wire with an adapter.

As for the technical characteristics of the TV (diagonal size, screen resolution, screen refresh rate, aspect ratio), this is not critical. That is, you do not have to select a TV model with the same characteristics as your monitor. Modern video cards support a variety of modes (screen resolutions and refresh rates), including the video card will work with a TV if the screen resolution is different from the monitor.

For example, the characteristics of my devices:

  • laptop monitor: 17", 1920×1080, 16:9, 120 Hz
  • TV (all specifications): 32", 1366x768p, 16:10, 60Hz

That is, these are two very different devices, but at the same time I had no problems when they worked together.

How to connect HDMI cable to TV

Plug the HDMI cable into the connectors of the computer (laptop) and TV.

Both on the computer and on the TV, there may be several HDMI connectors – remember the number of the selected connector.

Turn on your computer and TV.

Note: The HDMI cable can be connected when the computer and TV are already on.

Use the remote control to select “HDMI” as the input source on the TV.

If, after selecting HDMI as the signal source on the TV, you see the message “No Input Signal”, then:

  1. Select HDMI with a different number.
  2. Move the wire, it may not be firmly connected to the computer or TV socket.
  3. Make sure your computer is on.
  4. The monitor on the computer should not be turned off due to inactivity.

How to use a TV connected to a computer

There are two main modes:

  • join displays
  • mirror (duplication) of images on both displays

When displays are combined, the total space expands. That is, if you connected another 1920×1080 display to a computer with one 1920×1080 display, then now the resolution of your virtual screen becomes 3840×1080, if there are three such displays, the resolution will become 5760×1080. You can drag program windows from one display to another. Some apps and games support these wide virtual screens.

When the image is repeated (Mirror), the same image will be shown on both displays.

Among the displays, Primary stands out. This is the one connected first. A feature of the main display is that it shows desktop shortcuts, although this can be changed in the settings.

In the next video, the TV is connected to the computer. To play a YouTube video on a TV, the web browser window is dragged from the monitor to the TV. The video begins by selecting HDMI as the audio output source to play audio on a TV instead of playing it on a computer (laptop).

Where are the settings for the second display and TV

Open Settings (Setting Manager), go to the “Display” section.

Or immediately find the “Display” settings window in the Start menu.

Here you will see the display settings.

Select the display (or TV) you want to customize.

Each display will have its own set of settings.

How to install the Primary monitor

By default, desktop shortcuts are shown on the Primary monitor. You can change, i.e. choose a new primary monitor. For this:

1. Open the Settings Manager app, go to the “Display” section.

2. Select the monitor you want to make your primary

3. Activate the “Primary Display” slider next to the monitor name.

How to turn off the display or TV in the settings, without physically disconnecting

You can disconnect the HDMI cable from your TV or computer at any time, but this is not always convenient. In addition, you may want to turn off the computer monitor or the laptop's built-in monitor.

To turn off any monitor or TV in settings, open “Display” settings.

Select the monitor you want to turn off – this can be done by clicking on the schematic image of the monitor with a number or by selecting the name of the monitor from the drop-down list.

Then turn off the monitor using the slider marked 2 in the screenshot.

A disabled monitor will stop working (it will no longer receive an input signal), but the disabled monitor will still be available in the settings. You can turn it back on at any time.

How to make the TV show the same thing as the monitor

Go to Setting Manager → Display.

Select the “Mirror displays” option.

You may notice that the display sizes are not the same – this is due to the fact that they have different screen resolutions.

To ensure that the image is exactly the same on both displays, select the same screen resolution.

Please note that when “Mirror displays” is selected, the "Primary Display" option becomes unavailable because both monitors become equal.

As a result, the resulting settings for both monitors at once will be shown.

Now the image on the monitor and TV is the same:

How to make the TV become an extension of the monitor

Go to Setting Manager → Display.

Disable the “Mirror displays” option.

In this case, one of the monitors will be considered the main one. In this case, each of the monitors will show its own desktop, which, in fact, is one.

Why can't I drag the program window to the second screen

If you see two displays in the settings, but you can’t drag the program window to the TV or the second display, then try dragging the window to the other side. That is, if you, for example, are trying to drag a program window to the left side, then try dragging it to the right side instead.

The fact is that the physical location of the second monitor (TV) and its location in the settings can be different. To fix this, swap the monitors in the settings:

In addition to the location of the monitors to the left and right of each other, other options are possible.

You can place one of the monitors (or TVs) above the other.

In this case, the screen resolution and desktop area will change accordingly.

If you have many monitors, you can place them however you want, not all monitors need to be in a straight line horizontally. You can arrange them, for example, as 3×2, that is, two rows of 3 monitors.

After changing the relative position of monitors in the settings, shortcuts and the taskbar moved to another monitor

If you swapped them in the monitor settings, then the desktop shortcuts and the taskbar are most likely moved to the leftmost monitor (TV). This is due to the fact that by default it is set in the settings that the Desktop shortcuts and the Panel are placed automatically, without being tied to the Primary display. How to make the Desktop shortcuts and Panel show on the Primary monitor is shown below.

Customizing the Xfce Panel, Desktop shortcuts and Notifications on a computer with multiple monitors

Options related to advanced settings for your TV or second monitor are located in the following settings sections:

  • Panel
  • Desktop
  • Notifications

All of these settings can be quickly accessed at once by going to Setting Manager → Display and then clicking the letter “i” next to the “Primary Display” enable slider.

You will see the following window:

The primary display is currently configured to show

  • Xfce Panel
  • Desktop icons
  • Notifications

In this window, you can click the “Configure” buttons next to the setting you want to change.

How to make the taskbar show on the main monitor

Go to Setting Manager → Display, click the “i” next to the “Primary Display” slider.

Opposite “Xfce Panel” click the “Configure” button.

On the “Display” tab, find the “Output” setting.

Several options will be offered:

  • Automatic (that is, on the very first (left) monitor in the settings)
  • Primary (on the main monitor)
  • HDMI-1 (monitor connected via HDMI cable)
  • ePD-1 (laptop built-in monitor)

To show the taskbar on the main monitor, select the “Primary” option.

How to make the taskbar show on all monitors

If you want the taskbar to be shown on all connected monitors and TVs, then follow these steps.

Go to Setting Manager → Display, click the “i” next to the “Primary Display” slider.

Opposite “Xfce Panel” click the “Configure” button.

On the “Display” tab, find and activate the “Span monitors” setting.

After that, the Taskbar will be shown on all monitors. Open programs will be added to the taskbar from left to right. That is, at first the taskbar will be filled on the very first (left) monitor and then it will start to fill on the subsequent ones.

How to set different desktop wallpapers for monitor and TV

You can set a different desktop wallpaper for all connected monitors and TVs.

To do this, go to Setting Manager → Display, click the letter “i” next to the “Primary Display” enable slider.

Opposite “Desktop icons” click the “Configure” button.

You will see something like this:

Move this dialog to the display you want to edit the settings for

That is, in order to change the desktop wallpaper, you need to move the window that opens to the monitor (or TV) for which you want to set a new wallpaper.

For example, the inscription “Wallpaper for Monitor 0 (eDP-1)” means that the wallpaper will be set for the monitor built into the laptop.

And the inscription “Wallpaper for Monitor 1 (HDMI-1)” means that the wallpaper for the device connected via HDMI cable is currently being configured.

How to make Desktop icons show on Primary monitor

By default, desktop icons will be shown on the first (leftmost) monitor or TV. To change this, go to Setting Manager → Display, click on the letter “i” next to the “Primary Display” enable slider.

Opposite “Desktop icons” click the “Configure” button.

In the “Desktop” window that opens, go to the “Icons” tab.

Find and activate the “Show icons on primary display” setting.

How to make notifications appear on the Primary display

By default, notifications are shown on the display where the mouse cursor is when the notification is displayed. To change this, go to Setting Manager → Display, click on the letter “i” next to the “Primary Display” enable slider.

Opposite “Notifications”, click the “Configure” button.

In the window that opens, on the “General” tab, find the “Show notification on” setting and select “primary display” in the drop-down list.

How to make notifications appear on the display with the mouse pointer

Go to Setting Manager → Display, click the “i” next to the “Primary Display” slider.

Opposite “Notifications”, click the “Configure” button.

In the window that opens, on the “General” tab, find the “Show notification on” setting and select “display with mouse pointer” in the drop-down list.

Why are monitors of different sizes in the settings

If monitors have different screen resolutions, they will be shown in different sizes in the settings.

If you wish, you can choose the same screen resolutions for all monitors and TVs.

The same screen resolutions can be set both in the “Mirror displays” mode, and when using monitors to show different areas of the desktop.

Is it necessary to set the same resolution for the monitor and TV

No, it doesn’t need.

Moreover, the TV or monitor may not support the resolution or screen refresh rate that the second monitor supports.

For example, if you have selected a screen resolution of 1920×1080 in the TV settings, but the TV itself only supports 1366×768, then the picture will be displayed with a resolution of 1366×768 anyway.

How to make the monitor display popup windows to identify displays

If you have multiple monitors and you are confused about their settings, then you can enable the display of the name and number on the screen of each monitor.

Go to Setting Manager → Display, open the “Advanced” tab.

Activate the setting “Identifying Displays. Show popup windows to identify displays”.

How to remove pop-up windows with monitor names and numbers

Go to Setting Manager → Display, open the “Advanced” tab.

Disable the “Show popup windows to identify displays” setting.

How to enable automatic configuration of connected displays

Go to Setting Manager → Display, open the “Advanced” tab.

Activate the “Configure new displays when connected” setting.

How to turn off automatic configuration of connected displays

Go to Setting Manager → Display, open the “Advanced” tab.

Disable the “Configure new displays when connected” setting.

Why is the sound played through a computer (laptop) and not through a TV

An HDMI cable can carry both video and audio. But even after connecting the TV with an HDMI cable, sound is still output from the laptop speakers or computer speakers.

To change the sound output source, go to the sound settings (Volume Control). This can be done via Setting Manager → PulseAudio Volume Control.

Or find this settings window through the start menu.

Another quick way to get to the sound settings is to click on the speaker icon next to the clock and select “Audio mixer”.

The “Output Devices” tab will open, you can search there for a TV or HDMI device as an audio output source, but in my case there was no such device. Only “Speakers” were available as “Port”.

To switch the sound output to an HDMI device, go to the “Configuration” tab and in the drop-down list of the “Profile” setting, select the item with HDMI.

For example, to get the sound through the TV, I chose “Digital Stereo (HDMI) Output” instead of “Analog Stereo Output”.

Why did the sound disappear after turning off the TV on the laptop (computer)

To change the sound output source, go to the sound settings (Volume Control). This can be done through Setting Manager → PulseAudio Volume Control, or find this settings window through the start menu. Another quick way to get to the sound settings is to click on the speaker icon next to the clock and select “Audio mixer”.

Go to the “Configuration” tab and in the drop-down list of the “Profile” setting, select “Analog Stereo Output”.

Setting the action when closing the laptop lid when using a second monitor

If you are using a laptop, closing the laptop lid when additional monitors are connected to it may not be what you expect. For example, when you close the laptop lid, the computer goes into Suspend (Sleep) mode or shuts down, and you expect to be able to work on a second monitor or watch TV connected to the computer.

To control how the computer behaves when the laptop lid is closed, go to Settings Manager → Power Management.

You can also find this settings window through the Start menu.

Here in the “System” tab you can change the behavior performed when the laptop lid is closed.

Please note that the behavior of the computer in two modes is separately configured:

  • On battery – when the laptop is running on battery power
  • Plugged in – when the laptop is running on mains power

The “When laptop lid is closed” setting determines the action that the computer will perform when the laptop lid is closed, even if a second monitor or TV is connected to it.

The following options are available:

  • Switch off display – disable built-in laptop display
  • Suspend – Stops all applications and puts the computer into low power mode. When you turn on the computer, it returns to the same state that it was before Suspend. The difference from Hibernate is that the computer turns on faster, although it continues to consume energy.
  • Hibernate – hibernation mode, writing the current state of the computer and RAM to the hard disk and turning off the computer. When you turn on the computer, it returns to the same state that it was before Hibernate. The difference from Suspend is that the computer completely stops consuming power and cannot lose data due to the fact that the battery is dead. But it turns on a little longer than when exiting the Suspend state.
  • Lock screen – Show a screensaver that requires the user to enter a password.

If you do not want the laptop to turn off when the lid is closed, then select “Switch off display” or “Lock screen”.

How to install Kali Linux with encrypted user’s home folder (manual partitioning)

If the above automatic disk layout template with encryption of the home folder does not suit you, then you can configure disk layout manually, below is shown how to do it.

With manual marking, remember that for a normal installation you need at least two partitions:

  • EFI – 200 Megabytes is enough
  • / (root of the filesystem) – this is where the OS is installed. If there are no other partitions, then user files will be stored here.

In this example, in addition to the two necessary ones, we will create another partition and encrypt it, this partition will be mounted on the /home path.

Go to the page https://www.kali.org/get-kali/, in the Bare Metal section download the installation image.

Using a cross-platform program, Etcher writes an image to a USB flash drive.

Let's dwell directly on the disk layout, since the rest of the installation steps are identical.

When you come to the disk partitioning, then select “Manual”.

Select the drive where the system will be installed.

There is no partition table on the media, we agree to create it, that is, select “Yes”.

We select an unoccupied area (“FREE SPACE”).

Select “Create a new partition”.

The first partition will be EFI, 100-200 Megabytes are enough for it, allocate 200 Megabytes with a margin.

Choose “Beginning”.

In the “Use as” field, select “EFI System Partition”. Then click “Done setting up the partition”.

Select “FREE SPACE” again.

Choose “Create a new partition”.

Select the size of the partition. This partition will be the root one, OS files will be installed on it and programs will be installed here. It is not recommended to make this partition less than 20 Gigabytes.

We choose “Beginning”.

In the “Use as” field, select “Ext4 journaling file system”. Select “/” for “Mount point”. Then click “Done setting up the partition”.

Now let's move on to creating an encrypted partition. Select “Configure Encrypted Volumes”.

We are warned that in order to start creating an encrypted one, the current partition scheme (the two partitions that we have just created) must be written to the disk – these changes cannot be reversed. Select “Yes”.

Choose “Create encrypted volume”.

We choose where exactly this partition will be placed. Be especially careful if you have multiple drives. In the screenshot, the free space of the only disk is selected. But if you do not want to use all the free space, then first create a partition of the desired size and select it here. For this partition, in the “Use as” field, select “not use”.

We select “Done setting up the partition”.

Again, you need to save the current partitioning scheme to disk. Select “Yes”.

I only need one partition, so I choose “Finish”.

We are warned that the selected partition will be overwritten with random data and information from it will be lost. If everything is alright, then select “Yes”.

Enter the password to decrypt the partition.

So far we have only created an encrypted partition that has no volumes or mount points. This is all configurable in LVM.

Go to “Configure the Logical Volume Manager”.

Again, you need to write down the current partition scheme, again “Yes”.

Quite a bit of theory:

LVM manages three concepts:

  • Volume groups
  • Physical volumes
  • Logical volumes

A volume group is a named collection of physical and logical volumes. Typical systems only need one volume group to contain all the physical and logical volumes on the system, and I like to call my group by the name of the machine. Physical volumes correspond to disks; they are block devices that provide storage space for logical volumes. Logical volumes correspond to partitions: they contain the file system. However, unlike partitions, logical volumes are named, not numbers, they can span multiple disks, and do not have to be physically contiguous.

In this step we are creating a volume group, select “Create volume group”.

Come up with a name – you can use the name of your system, but I named it in accordance with the purpose.

Select the device for the new volume group. This device is the encrypted partition created in the previous step.

You need to write down the current partition scheme (“Yes”).

Now choose “Create logical volume”.

Choose a group – it is one.

Name the volume – the name can be arbitrary, but it is in your best interest to use meaningful name.

Specify the size of the volume.

One volume is enough for me, so I choose “Finish”.

Now you can observe the created volume, but it is not used in any way and no file system is selected for it. Click on the volume record.

In the “Use as” field, select “Ext4 journaling file system”.

Select “/home” for “Mount point”. Then click “Done setting up the partition”.

Finish partitioning the disk, select “Finish partitioning and write changes to disk” → “Continue”.

I am warned that I have not created a swap partition – I have 32 GB of RAM, I do not need a wap partition, so I choose “No”.

We are once again warned that the data will be written to the disk and the information on it will be lost, select “Yes”.

Further installation steps are identical to the first example.

If everything is done correctly, you will be prompted for a password when you turn on the computer.

You can make sure that the list of block devices is exactly as we intended it.

How to install Kali Linux with encrypted user’s home folder (auto-partitioning)

The installer has a template for encrypting the user's home folder and it is perfect for novice users – the default settings are quite acceptable, the setup is very simple.

The markup template has the following parameters:

  • EFI partition – 500 MB
  • /boot partition – 500 MB
  • / (root) partition – 30 GB
  • swap (swap partition) – 1 GB
  • /home partition – all remaining space

Go to the page https://www.kali.org/get-kali/, in the Bare Metal section download the installation image.

Using a cross-platform program, Etcher writes an image to a USB flash drive.

Let's dwell directly on the disk layout, since the rest of the installation steps are identical.

When you come to the partitioning of the disks, then select “Guided - use entire disk and set up encrypted LVM”.

Select the drive where the system will be installed.

Select “Separate /home partition”.

We are warned that in order to start creating an encrypted one, the current partition scheme (the two partitions that we have just created) must be written to the disk – these changes cannot be reversed. Select “Yes”.

The partition to be encrypted is filled with random data – this process takes time.

Enter the password twice that will encrypt the partition.

For automatic partitioning, you can use all or part of the volume group size. If you have little idea about the possibilities of LVM, then just use the entire available size.

An overview of the configured partitions. In this example, the root partition is 30 GB and the /home directory is 224.6 GB.

Click “Finish partitioning and write changes to disk” → “Continue”.

Agree to write data to disk by selecting “Yes”.

How to install Kali Linux with full disk encryption

This is the easiest option to set up and use – the entire drive will be encrypted. For encryption during the Kali Linux installation, as well as for use, you do not need to delve into how it works.

Go to the page https://www.kali.org/get-kali/, in the Bare Metal section download the installation image.

Using a cross-platform program, Etcher writes an image to a USB flash drive.

Select “Graphical install”.

Select the system language – the installer will be in the same language.

Choose a location – the time zone depends on it.

Select your keyboard layout.

Come up with a name for your system.

Leave this field blank.

Enter the user's full name – whatever.

Computer username – consists of only small English letters and numbers. The first character must be a letter.

Password for your user.

This choice affects the time zone.

To encrypt the entire disk where Kali Linux will be installed, select “Guided - use entire disk and set up encrypted LVM”.

Select the drive for encryption and OS installation.

Select “All files in one partition (recommended for new users)”.

At this stage, the installer will write the new partitioning to the disk, make sure you select the correct disk, as all data will be deleted from it. If everything is correct, then select “Yes”.

The partition to be encrypted is filled with random data – this process takes time.

Enter the password twice that will encrypt the partition – if you forget this password, it will be impossible to recover it and access to the disk will be impossible!

Specify how much disk space you want to allocate for an encrypted partition with an installed OS.

Here you can check the layout of the partitions – you can leave everything as it is.

Select “Yes”.

Select your desktop environment and set of tools.

Installation is complete, restart your computer.

When starting Kali Linux, you need to enter a password to decrypt the partition.

You will also need to enter your username and password to login.

Content of /etc/fstab file:

List of block devices:

How to Install the Latest Linux Kernels on Debian and Debian Based Distributions

Recent versions of the Linux kernel have drivers for new devices and other innovations. Unfortunately, many popular Linux distributions are in no rush to update their kernel. This tutorial will show you how easy it is, without compiling, to install any version of the Linux kernel on Debian and derived distributions, for example, Kali Linux and LMDE (Linux Mint Debian Edition). You can choose to install either a newer kernel or an older one than your distribution's repository suggests.

If you wish, you can easily remove the installed Linux kernels and return to the kernel from the repository.

Note that there are separate instructions for Ubuntu and derivatives, as the process for updating kernels is different: “How to Install the Latest Linux Kernels on Ubuntu and Linux Mint”.

Kernel update warning

It should be remembered that due to the incompatibility of the kernel with programs (first of all, with proprietary GPU drivers), you may encounter problems, including a black screen during boot.

In most cases, the problems encountered can be resolved without reinstalling the distribution. Start by going to the advanced options in the boot menu and boot with the previous version of the kernel. When the computer boots up, remove the problematic kernel.

Proprietary graphics card drivers can cause problems, as older versions may not be compatible with the latest kernels without a patch. If you have proprietary video drivers installed, then seriously consider before following the instructions below. Also get ready, look for instructions on how to solve the problem when loading the distribution into a black screen.

Owners of old distributions should be especially careful – it is strongly recommended to update the kernel only on the latest OS versions.

Another very likely problem that you may encounter if you install the latest kernel is the problem with unresolved dependencies and, as a result, the inability to use the apt package manager to update and install programs. If you are faced with a situation where, after successfully installing a new kernel, you cannot update packages using apt, then try installing older versions of the kernel that suit you, and uninstall the versions that cause dependency problems. Remember that it is impossible to remove the kernel you booted with – boot your computer with any other version of the kernel before uninstalling.

Upgrading the Kernel to the Latest Version on Debian

This section should be suitable for all variations and derivatives of Debian, for example:

  • Debian stable
  • Debian testing
  • Kali Linux
  • Linux Mint Debian Edition (LMDE)
  • MX Linux
  • other

Let's check the current kernel version:

uname -a

In order not to compile the kernel from scratch, we will use the kernels of the XanMod Kernel project.

To install the latest kernel version, just run the following commands:

echo 'deb http://deb.xanmod.org releases main' | sudo tee /etc/apt/sources.list.d/xanmod-kernel.list
wget -qO - https://dl.xanmod.org/gpg.key | sudo apt-key --keyring /etc/apt/trusted.gpg.d/xanmod-kernel.gpg add -
sudo apt update && sudo apt install linux-xanmod

After the program has exited, a computer restart is required for the changes to take effect.

Let's check the kernel version again:

uname -a

Output example:

Linux HackWare-Kali 5.13.19-xanmod1 #0~git20210919.7960459 SMP PREEMPT Sun Sep 19 13:46:36 UTC 2021 x86_64 GNU/Linux

If for some reason the GRUB menu has not been updated, then run the command:

sudo update-grub

How to choose the XanMod kernel version

In total, the following metapackages are available – the kernel version at the time of writing is indicated in square brackets:

  • linux-xanmod [5.13]
  • linux-xanmod-edge [5.14]
  • linux-xanmod-lts [5.10]
  • linux-xanmod-cacule [5.14-cacule]
  • linux-xanmod-rt [5.10-rt]

You can check the kernel version in the linux-xanmod package with the following command:

apt show linux-xanmod

As you can see, this metapackage has in its dependencies (that is, it will actually install) the linux-image-5.13.19-xanmod1 and linux-headers-5.13.19-xanmod1 packages, hence the kernel version is currently 5.13.19.

Let's check the linux-xanmod-edge kernel version:

apt show linux-xanmod-edge

The current Linux kernel version in this package is 5.14.6.

The XanMod repository contains not only kernels that can be installed using metapackages, but also many other versions, you can find them with the command:

apt search linux-image-[0-9.]+-xanmod[0-9]+

When installing the kernel of the selected version, you need to install the corresponding headers files, both packages must have the name of the form linux-image-VERSION-xanmod1 and linux-headers-VERSION-xanmod1, and the VERSION number must be the same, for example:

sudo apt install linux-image-5.12.19-xanmod1 linux-headers-5.12.19-xanmod1

How to remove XanMod core

If you installed the kernel using the linux-xanmod metapackage, you can remove this metapackage with the command:

sudo apt remove linux-xanmod

However, this will not change anything, the installed kernels will remain on the system! To remove the kernels themselves, use a command like:

sudo apt remove `sudo apt show linux-xanmod | grep Depends | sed 's/,//' | awk '{print $2,$3}'`

If you installed the kernel without using the metapackage, then remove the kernel and the headers file specifying the names of the packages and their versions, for example:

sudo apt remove linux-image-5.12.19-xanmod1 linux-headers-5.12.19-xanmod1

How to recover Linux after installing the kernel

If your computer boots with a black screen, freezes, or something doesn't work after updating the kernel, reboot and select Advanced options for your distribution from the GRUB menu:

Then select the previous kernel version and press Enter:

Regardless of the reason, you need to boot with the previous version of the kernel if you want to remove the latest kernel. This is because you cannot remove the kernel that is currently in use.

If you do not see the GRUB2 menu, press and hold the Shift key or press the Esc key repeatedly (this may vary depending on BIOS or UEFI boot and the version of Ubuntu/Linux Mint you are using) while booting GRUB. The Grub menu should appear allowing you to select a previous kernel version.

After booting the previous kernel, you can remove the faulty kernel.

To remove the XanMod kernel in Debian and derivatives run the commands:

sudo apt remove linux-xanmod
sudo apt remove `sudo apt show linux-xanmod | grep Depends | sed 's/,//' | awk '{print $2,$3}'`

If this was not done automatically, then update your GRUB settings:

sudo update-grub

Chromium will no longer sync passwords - what should Linux users do?

Chrome and Chromium on Linux

Everyone knows the Google Chrome web browser. Chromium is at its core. That is, Chromium is the open source web browser that Google builds on the Chrome web browser, adding proprietary (i.e. closed) code to it.

The Chrome browser is distributed by Google itself as compiled files. The Chromium browser is available as open source. For this reason, Chrome is popular among Windows users - most Windows users install binaries compiled by the authors on their system and do not see anything strange in this.

It's a little different on Linux. Linux users also download and install compiled packages, but compilation is done by the distribution maintainers using the source code of the programs. This is in line with the spirit of Linux and its licenses. Closed source packages are placed in separate repositories (package sources for installation).

For this reason, it is Chromium that is prevalent among Linux users, and Chrome is often absent from the repositories. But until recently, browsers were almost identical, so you could use Chromium just like Chrome.

The Chrome/Chromium web browser makes extensive use of Google's APIs. These APIs include, for example, password and bookmark synchronization. But Google announced that from March 2021, some APIs will be available only in the Chrome web browser, but will be disabled in Chromium, as well as in all third-party browsers that use Chromium as their basis. Disabled APIs include password synchronization.

I don't mind third-party web browsers - just imagine that if you log into your Google account on a third-party browser, thanks to the password synchronization function, it gets access to all (!) your passwords on all (!) websites. Many untrustworthy Chromium-based web browsers have sprung up about the creators of which cannot be found and whose source code is not published (sometimes despite their assurances).

But what's really annoying is that important functions will no longer work in Chromium too. From a full-fledged alternative to Chrome, Chromium has now become a web browser with limited functions.

If you don't use password sync, then you have nothing to worry about

Despite the anger of the maintainers of some distributions and threats to stop supporting or even kick the web browser out of the repositories, apparently no one will do it. Therefore, if you do not need the function of synchronizing passwords and bookmarks, then you can safely continue using Chromium on Linux.

But what about Linux users who use Chromium and need password sync and other features? Let's consider several options.

1. Stop using the password sync feature in web browsers

Yes, the fact that all your passwords are stored by strangers is bad, to put it mildly. But it's super convenient if you have more than one device (computer, phone, tablet, second computer, more virtual computers…). But if you think about it, it's like giving the keys to your apartment to an outsider, so that when you appear, he opens and closes the door to your apartment, and you don't have to climb into your pockets for keys. Conveniently. But you have no idea what happens to your keys while you are away.

Therefore, one option is to continue using Chromium, but stop using the password sync feature.

2. Switch to Firefox

Firefox is open source and also has a password sync feature. If you want to show Google that you are not satisfied with this change, you can switch to Firefox. Just in case - if your passwords are synchronized using Firefox, then it is no better or worse than if they are stored by Google.

3. Install Chrome on Linux

In fact, installing Chrome from Google itself on Linux is trivial. So you can go the same route that most Windows users do - just install a web browser with proprietary code.

In Debian, Linux Mint, Ubuntu, Kali Linux and their derivatives, to install Google Chrome, just run the commands:

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i ./google-chrome-stable_current_amd64.deb
sudo apt install -f

That's all! At the same time, during the installation of the web browser, the Google repository will be added to the list of repositories and Chrome will be updated along with the rest of the packages in the system.

In Arch Linux, Manjaro, BlackArch and their derivatives, to install Google Chrome, just run the command:

pikaur -S google-chrome

If you have not yet installed pikaur, then install it according to the instructions “Automatic installation and update of AUR packages”.

To update a web browser package, you will need to run a system update using pikaur - this command is to update both packages from the system repositories and from the AUR:

pikaur -Syu

4. Extensions for synchronization with encryption (Bitwarden)

You can install an extension like Bitwarden and continue using Chromium.

Bitwarden uses end-to-end encryption, meaning passwords are synchronized encrypted. Moreover, the source code is open even for the server, that is, you can synchronize without any third-party participants at all.

Bitwarden works with almost any device and browser you can think of: Windows, Mac, Linux; iOS and Android; Chrome, Firefox, Safari, Edge and many other niche browsers. This gives you freedom of movement, unlike browser password managers.

Conclusion

Which option did you choose or, perhaps, made some other decision?

Error “Cannot load modules/libphp7.so” (SOLVED)

Some Linux distributions have already started migrating to PHP 8. In some distributions the new version of PHP removes the old one, as a result of which the web server may stop working due to the fact that the files specified in the web server configuration are missing or renamed.

Examples of errors you may encounter:

httpd: Syntax error on line 504 of /etc/httpd/conf/httpd.conf: Syntax error on line 1 of /etc/httpd/conf/mods-enabled/php.conf: Cannot load modules/libphp7.so into server: /etc/httpd/modules/libphp7.so: cannot open shared object file: No such file or directory

It says the file /etc/httpd/modules/libphp7.so was not found.

Another error that says the /etc/httpd/conf/extra/php7_module.conf file was not found:

httpd: Syntax error on line 504 of /etc/httpd/conf/httpd.conf: Syntax error on line 2 of /etc/httpd/conf/mods-enabled/php.conf: Could not open configuration file /etc/httpd/conf/extra/php7_module.conf: No such file or directory

On some distributions, the Apache web server service is called apache2, and on some httpd. Therefore, this guide will consider both options.

Fix “Cannot load modules/libphp7.so” when webserver service is named httpd (Arch Linux, CentOS and their derivatives)

To view the status of the service and the errors that led to its inoperability, run the command:

systemctl status httpd.service

Open the config file /etc/httpd/conf/mods-enabled/php.conf:

sudo vim /etc/httpd/conf/mods-enabled/php.conf

Find the line in it

LoadModule php7_module modules/libphp7.so

and replace it with:

LoadModule php_module modules/libphp.so

Then find the line

Include conf/extra/php7_module.conf

and replace with:

Include conf/extra/php_module.conf

Restart the web server service:

sudo systemctl restart httpd.service

and check its status:

systemctl status httpd.service

Fix “Cannot load modules/libphp7.so” when webserver service is named apache2 (Debian, Ubuntu, Linux Mint, Kali Linux and their derivatives)

To view the status of the service and the errors that led to its inoperability, run the command:

systemctl status apache2.service

Disable PHP 7.* module:

a2dismod php7.4

Maybe you have a different version of PHP, start typing “a2dismod php” and use the TAB key for autocompletion:

To enable PHP 8 use a command like (use the TAB key for auto-completion):

a2enmod php8

Restart the web server service:

sudo systemctl restart apache2.service

and check its status:

systemctl status apache2.service
Loading...
X