Category Archives: Ubuntu

DevToys can’t start on Ubuntu 24.04

DevToys is a collection of essential developer tools packed into a single desktop application. It provides a wide range of utilities, including a color picker, JSON viewer, and various text manipulation tools, all in a user-friendly interface.

Symptoms: When you click on the DevToys icon, nothing happens. If you try to execute it through the terminal using the devtoys command, it throws the following error:

$ devtoys 

(DevToys:1306833): Gtk-WARNING **: 17:45:26.037: Theme parser error: gtk.css:7879:18-22: Expected a number

(DevToys:1306833): Gtk-WARNING **: 17:45:26.037: Theme parser error: gtk.css:7891:18-22: Expected a number

(DevToys:1306833): Gtk-WARNING **: 17:45:26.070: Theme parser error: gtk-dark.css:7879:18-22: Expected a number

(DevToys:1306833): Gtk-WARNING **: 17:45:26.070: Theme parser error: gtk-dark.css:7891:18-22: Expected a number

(DevToys:1306833): Gtk-WARNING **: 17:45:26.150: Theme parser error: gtk-dark.css:7879:18-22: Expected a number

(DevToys:1306833): Gtk-WARNING **: 17:45:26.150: Theme parser error: gtk-dark.css:7891:18-22: Expected a number

(DevToys:1306833): Gtk-WARNING **: 17:45:26.171: Theme parser error: gtk-dark.css:7879:18-22: Expected a number

(DevToys:1306833): Gtk-WARNING **: 17:45:26.171: Theme parser error: gtk-dark.css:7891:18-22: Expected a number
bwrap: setting up uid map: Permission denied

** (DevToys:1306833): ERROR **: 17:45:26.238: Failed to fully launch dbus-proxy: Child process exited with code 1
fish: Job 1, 'devtoys' terminated by signal SIGABRT (Abort)

The issue is that DevToys doesn’t work on Ubuntu 24.04 due to the missing AppArmor bwrap profile. This is because Ubuntu 24.04 has introduced restricted unprivileged user namespaces, and the AppArmor profile for bwrap is not included by default.

As mentioned in this comment (https://github.com/DevToys-app/DevToys/issues/1198#issuecomment-2411370778), the solution is to install the apparmor-profiles package, link the bwrap profile, and load it.

Here are the steps:

sudo apt install apparmor-profiles
sudo ln -s /usr/share/apparmor/extra-profiles/bwrap-userns-restrict /etc/apparmor.d/
sudo apparmor_parser /etc/apparmor.d/bwrap-userns-restrict

After following these steps, DevToys should start working correctly on Ubuntu 24.04.

locale: Cannot set LC_CTYPE to default locale

I have an Ubuntu 24.04 server and I have the following errors when I run “locale” command:
locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory
That’s how I fixed it:
sudo apt-get update
sudo apt-get install locales
sudo locale-gen en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8

Hot to install GPaste on Ubuntu 23.10

GPaste is an open-source clipboard management tool for Linux-based operating systems. Clipboard managers like GPaste allow users to manage and access a history of items they have copied to the clipboard, enabling them to easily paste previously copied content.

Sadly, there are binary packages available but you can compile it and install it manually.

Continue reading

How to install autojump for Fish on Ubuntu

Autojump is a tool that can be used to jump around in the shell to frequently used directories by typing just a part of their name. It is typically aliased to j. Autojump is available as a package in the Ubuntu repositories, but it needs manual intervention to be available in the fish shell.

1. Install autojump

sudo apt install autojump

2. Source the autojump.fish file in your fish configuration, by opening the file ~/.config/fish/config.fish in an editor and adding these lines:

begin
    set --local AUTOJUMP_PATH /usr/share/autojump/autojump.fish
    if test -e $AUTOJUMP_PATH
        source $AUTOJUMP_PATH
    end
end

3. Add j shortcut command to fish creating a new file ~/.config/fish/functions/j.fishwith the following content:

function j
    set new_path (autojump $argv)

    if test -d "$new_path"
        echo $new_path
        cd "$new_path"
    else
        echo "autojump: directory '$argv' not found"
        echo "Try \`autojump --help\` for more information."
        false
    end
end

Usage examples:

j Down – changes to my Downloads folder
j work – changes to my workspace folder

Enjoy!

Install docker and docker-compose on Linux Mint 20.3

Issue the following commands in the terminal, one by one and you are ready to go! It’s simple as that 🙂

#docker setup
echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" | sudo tee /etc/apt/sources.list.d/docker.list
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io pigz

#execution permission
sudo usermod -aG docker $USER

#docker compose
sudo curl -L "https://github.com/docker/compose/releases/download/2.2.3/docker-compose-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose</pre>

Fingerprint reader 0a5c:5843 Broadcom Corp. 58200 Ubuntu / Linux mint driver install

First, we need to checkout the following repo containing the driver:

git clone https://git.launchpad.net/~oem-solutions-engineers/libfprint-2-tod1-broadcom/+git/libfprint-2-tod1-broadcom/

Then go into the cloned folder and issue the following commands:

sudo sh install.sh
python3 debian/update-fw.py

You may need to restart the laptop in order the changes to be applied.

Finally, enable fingerprint login using the following command:

sudo pam-auth-update

PHP Warning: PHP Startup: mcrypt: Unable to initialize module

If you have installed multiple PHP versions using PPA maintained by Ondrej SurĂ˝ you may end up with the following error message:

PHP Warning: PHP Startup: mcrypt: Unable to initialize module
Module compiled with module API=20190902
PHP compiled with module API=20170718

This is caused by a misconfiguration: the php.ini file is pointing to the latest version of mcrypt instead of the one compiled for PHP 7.2. To fix that you have to correct the path to the extension. Open the file for editing:


sudo vi /etc/php/7.2/cli/conf.d/mcrypt.ini

and replace extension=/usr/lib/php/20190902/mcrypt.so with extension=/usr/lib/php/20170718/mcrypt.so. Do the same for /etc/php/7.2/fpm/conf.d/mcrypt.ini file.

If you have the module mcrypt.so listed in /etc/php/7.2/cli/php.ini or /etc/php/7.2/fpm/php.ini – delete it to avoid “PHP Warning: Module ‘mcrypt’ already loaded in Unknown on line 0” error

Install the latest versions of Vagrant and VirtualBox on Linux Mint 19.2

I use Linux Mint 19.2 as daily driver on my ThinkPad L480. This step by step tutorial will guide you through the process of getting the latest versions of VirtualBox and Vagrant instead of the outdated versions available in the official Ubuntu repositories.

VirtualBox and Vagrant receive updates on Linux much often than the repositories update. If you want to consistently get these updates when they become available, you’ll want to add VirtualBox and Vagrant repository to your system. This will allow you to get notified for new versions and update trough Linux Mint Update Manager and apt.

Continue reading

This machine ID is already enabled with a different key or is non-unique

I have purchased new VPS and I wanted to enable Ubuntu live patch service for it. Unfortunately, the command canonical-livepatch enable [TOKEN] failed with this ugly error message:

This machine ID is already enabled with a different key or is non-unique.
Either “sudo canonical-livepatch disable” on the other machine, or regenerate a
unique /etc/machine-id on this machine with
“sudo rm /etc/machine-id /var/lib/dbus/machine-id && sudo systemd-machine-id-setup” :
{“error”: “Conflicting machine-id”}

I thought to myself “Ok, let’s try the suggested solution”. What I did was to backup the file /etc/machine-id, than delete it and run suggested systemd command. I was surprised to see the newly generated UUID was the same! Consulting with man page of systemd-machine-id-setup command revealed that “If run inside a KVM virtual machine and a UUID is configured (via the -uuid option), this UUID is used to initialize the machine ID. The caller must ensure that the UUID passed is sufficiently unique and is different for every booted instance of the VM.”. Obviously, my new VPS provider did not ensure that and somebody else has the same machine ID on his/her VPS and enabled Ubuntu live patch for it.

Continue reading

Control screen backlight brightness from the command line

I have a Dell Latitude E5430 running Linux Mint 19 Tara. In Cinnamon, my function keys for brightness work correctly, but that was not the case with i3wm session. My first bet was to bind shortcuts executing xbacklight command but it doesn’t work because of this bug. So, I started to research for workaround and I found brightlight – “a program that can get and
set the screen backlight brightness on Linux systems using the kernel sysfs
interface.”. Sounds perfect but there are no prebuild binaries so you need to do it by yourself. The following steps are short guide how to build and install brightlight on Ubuntu and Ubuntu derivatives.

Continue reading