QGtkStyle could not resolve GTK. Make sure you have installed the proper libraries.

While using keepassx version 2.0.3 on my GNOME desktop, I got the following error message:

QGtkStyle could not resolve GTK. Make sure you have installed the proper libraries.

Here are some details about the Linux distribution used:


cat /etc/os-release


NAME="Ubuntu"
VERSION="19.10 (Eoan Ermine)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 19.10"
VERSION_ID="19.10"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=eoan
UBUNTU_CODENAME=eoan

Tested suggestions:

https://github.com/ilastik/ilastik/issues/1768

In the current shell and in the .bashrc file:


export QT_STYLE_OVERRIDE=gtk2

Still the same error

Here is my working solution working within the Ubuntu GNOME desktop:


keepassx -v
2.0.3

Archlinux wiki provides interesting details about QGtkAStyle:

https://wiki.archlinux.org/index.php/Uniform_look_for_Qt_and_GTK_applications#QGtkStyle

Looking up all the files available in their package qt5-styleplugins:

https://www.archlinux.org/packages/community/x86_64/qt5-styleplugins/

Back to Ubuntu Linux distribution

With the help of the apt-file utility, the Ubuntu related package can be found with the provided filename:


apt-file search libqgtk2.so


qt5-gtk2-platformtheme: /usr/lib/x86_64-linux-gnu/qt5/plugins/platformthemes/libqgtk2.so
qt5-gtk2-platformtheme: /usr/lib/x86_64-linux-gnu/qt5/plugins/styles/libqgtk2style.so

More details about the package qt5-gtk2-platformtheme:


Package: qt5-gtk2-platformtheme
Version: 5.0.0+git23.g335dbec-3ubuntu1
Priority: optional
Section: universe/libs
Source: qtstyleplugins-src
Origin: Ubuntu
Maintainer: Ubuntu Developers
Original-Maintainer: Debian Qt/KDE Maintainers
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 626 kB
Depends: libc6 (>= 2.14), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.12.0), libgtk2.0-0 (>= 2.24.0), libpango-1.0-0 (>= 1.14.0), libqt5core5a (>= 5.12.2), libqt5dbus5 (>= 5.0.2), libqt5gui5 (>= 5.10.0) | libqt5gui5-gles (>= 5.10.0), libqt5widgets5 (>= 5.10.0), libstdc++6 (>= 5), libx11-6, qtbase-abi-5-12-4
Breaks: libqt5libqgtk2 (<< 5.7), qt5-style-platform-gtk2 (<< 5.0.0+git23.g335dbec-3~), qt5-style-plugin-gtk2 (<< 5.0.0+git23.g335dbec-3~), qt5-style-plugins (<< 5.0.0+git23.g335dbec-3~)
Replaces: libqt5libqgtk2 (<< 5.7), qt5-style-platform-gtk2 (<< 5.0.0+git23.g335dbec-3~), qt5-style-plugin-gtk2 (<< 5.0.0+git23.g335dbec-3~), qt5-style-plugins (<< 5.0.0+git23.g335dbec-3~)
Homepage: https://www.qt.io/
Task: ubuntustudio-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop
Download-Size: 164 kB
APT-Sources: http://ca.archive.ubuntu.com/ubuntu eoan/universe amd64 Packages
Description: Qt 5 extra widget styles - GTK+ 2 Platform theme
Qt is a cross-platform C++ application framework. Qt's primary feature
is its rich set of widgets that provide standard GUI functionality.
.
This package contains the GTK+ 2 style and platform theme. Export
QT_QPA_PLATFORMTHEME=gtk2 to enable it for all Qt applications.

Then installing it:


apt install qt5-gtk2-platformtheme

Let’s try using keepassx again.
A new error message pop up:

Failed to load module “canberra-gtk-module”

Same process as above to search for the Ubuntu package that will install the missing file.


apt-file search canberra-gtk-module


libcanberra-gtk-module: /usr/lib/gnome-settings-daemon-3.0/gtk-modules/canberra-gtk-module.desktop
libcanberra-gtk-module: /usr/lib/x86_64-linux-gnu/gtk-2.0/modules/libcanberra-gtk-module.so
libcanberra-gtk-module: /usr/share/doc/libcanberra-gtk-module/changelog.Debian.gz
libcanberra-gtk-module: /usr/share/doc/libcanberra-gtk-module/copyright
libcanberra-gtk3-module: /usr/lib/x86_64-linux-gnu/gtk-3.0/modules/libcanberra-gtk-module.so

apt-cache info libcanberra-gtk-module

Package: libcanberra-gtk-module
Version: 0.30-7ubuntu1
Priority: optional
Section: universe/libs
Source: libcanberra
Origin: Ubuntu
Maintainer: Ubuntu Developers
Original-Maintainer: Debian GNOME Maintainers
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 51.2 kB
Depends: libc6 (>= 2.4), libcanberra-gtk0 (>= 0.2), libglib2.0-0 (>= 2.12.0), libgtk2.0-0 (>= 2.24.5-4), libx11-6
Homepage: http://0pointer.de/lennart/projects/libcanberra/
Task: ubuntu-mate-core, ubuntu-mate-desktop
Download-Size: 9,904 B
APT-Sources: http://ca.archive.ubuntu.com/ubuntu eoan/universe amd64 Packages
Description: translates GTK+ widgets signals to event sounds
A GtkModule which will automatically hook into all kinds of events
inside a GTK+ program and generate sound events from them.

Installing the requested package libcanberra-gtk-module

apt install libcanberra-gtk-module

Problem solved. Keepassx can now open any password file without error or warning message.

Possible missing firmware /lib/firmware/nvidia/gv100/acr/ucode_load.bin for module nouveau

After applying the latest updates on a Debian Buster machine, this message pops up:


/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.19.0-6-amd64
cryptsetup: WARNING: The initramfs image may not contain cryptsetup binaries
nor crypto modules. If that's on purpose, you may want to uninstall the
'cryptsetup-initramfs' package in order to disable the cryptsetup initramfs
integration and avoid this warning.
W: Possible missing firmware /lib/firmware/nvidia/gv100/acr/ucode_load.bin for module nouveau

This file /lib/firmware/nvidia/gv100/acr/ucode_load.bin is only provided by a newer version of firmware-misc-nonfree provided in the buster-backports:

Firmware-misc-nonfree package details from buster-backports

To install it:


apt-get -t buster-backports install firmware-misc-nonfree

Powering on virtual machine from esxcli

If it gets difficult to power on a virtual machine from the vSphere client, vim-cmd offers the possibility to perform this task after connecting on the ESXi host using ssh.

Here are a couple of useful vim-cmd commands:

List all the VMs on the ESXi host:
vim-cmd vmsvc/getallvms

Get VM status using its id:
vim-cmd vmsvc/power.getstate vm_id

Power on a VM using its id:
vim-cmd vmsvc/power.on vm_id

Sources:

https://kb.vmware.com/s/article/1038043

http://nigelhickey.com/power-vm-via-ssh

Pseudo-terminal will not be allocated because stdin is not a terminal

If you need to run a job using cron and this job includes some remote access to Linux servers using ssh, your script may not behave the way you want:

Pseudo-terminal will not be allocated because stdin is not a terminal

The ssh tool provides the option -t.

As per ssh’s manpage:

-t’ Force pseudo-tty allocation. This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g. when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty.

If you need to run a sudo command on the remote server, the option -t must be used several times as follows:
ssh -t -t -t -t fool@remote_host "sudo systemctl status apache2"

How to display the current time in a different timezone than yours ?

To quote an example from the Superuser forum:

It’s 6pm in Taipei, what time is it here?

date --date='TZ="Asia/Taipei" 18:00'
Fri Jul 16 11:00:00 BST 2010

At 11am here in London, what time is it in Taipei?

TZ=Asia/Taipei date -d "11:00 BST"
Fri Jul 16 18:00:00 CST 2010

Source: https://superuser.com/questions/164339/timezone-conversion-by-command-line

Could not launch application ‘blueman.desktop’: Unable to start application: Failed to execute child process “blueman-applet” (No such file or directory)

After an upgrade from Debian 9.9 to Debian 10, some errors were found in my .xsessions-errors file.

The apt-file utility provided by the Debian distribution provides an easy way to provide the matching Debian package for a given file.

To install it :

apt install apt-file

To provide it with the latest details from Debian repos :

apt-file update

To look for the corresponding Debian package that blueman.desktop file belongs to :

apt-file search blueman.desktop
blueman: /etc/xdg/autostart/blueman.desktop
blueman: /usr/share/Thunar/sendto/thunar-sendto-blueman.desktop

To install it :

apt install blueman

More details :

Details of apt-file Debian package

Details of blueman Debian package