cover image



Tags

vignette

software

review

film

rationality

No Left-Click For You

A few days ago a software update on Ubuntu broke the left-click functionality on my touch pad. This is how it happened and how I fixed it.

It all started in the morning when I ran sudo apt update, and upon discovering that there were no less than 48 packages waiting to be upgraded I ran sudo apt upgrade. I didn’t pay much attention during the upgrade process but, as you’ll see later, that wouldn’t have made a difference. This is a virtual machine that I mostly use for development work, but all I did afterwards was browse a couple of websites and then shut it down.

Later, whilst sipping my coffee, I powered up the machine to get some work done. However, when the log in screen appeared I discovered that clicking on the account section didn’t make the password field appear. I then tried clicking on the menu bar options at the top, but nothing happened. Moving the cursor over the GUI elements activates hover effects and reveals tool tips, but clicking was useless. I let out a sigh, rolled up my metaphorical sleeves, and set to work.

I began the troubleshooting process, conventionally enough, by performing a reboot. I had access neither to the Power Off option in the menu nor to the command line, so I performed a shutdown using VirtualBox’s ACPI Shutdown feature (EDIT: It slipped my mind that you can access the terminal from the login screen and log in from there or perform a shut down). When I powered on the machine again I discovered that the problem hasn’t been solved. But this time, unlike before, it occurred to me to click on the “Not listed?” link, and to my surprise the username prompt appeared. I promptly entered my username and password and logged in.

I clicked around the desktop, but the only additional piece of information I gained was that the right-click functioned normally, showing context menus wherever it should. I concluded that, with the odd exception of the “Not listed?” link mentioned before, nothing in the GUI responds to left-clicks.

The obvious next step was to fire up the terminal, something which, of course, had to be done using the keyboard. I was practically certain that one or more of this morning’s updated packages was responsible for the current state of affairs, so I began my investigation by running sudo apt update, thinking that if a package hadn’t been installed properly it might be listed as available. But the result was negative: no updates were available.

The next step was to dig deeper and examine the package manager’s log file. A bit of googling (on my phone of course) informed me that the file was at /var/log/dpkg.log. I used the grep command to retrieve a list of installed packages from the log file and filter them by date, and redirected the output to a new file. Examining the file showed that of the 48 packages installed this morning, 42 failed to install properly (i.e. had records listing “half-installed” as status). The records also showed that many of the “half-installed” packages were successfully reinstalled afterwards (i.e. each one had an additional record listing “installed” as status), so the next step was to ascertain which, if any, of the packages had a “half-installed” record without having a corresponding “installed” record.

I used grep twice again on the log file, sending each group of “installed” and “half-installed” records to a separate file. And to make the upcoming comparison job easier I used the sort command to sort each file’s contents by package name. I then opened each file in a separate tab and began checking the “half-installed” records against the “installed” records. But the result was again negative: every single package with a “half-installed” record had a corresponding “installed” record.

By now the package manager has twice assured me that the morning’s packages were properly updated. But I wasn’t buying it. It was time to closely examine the purpose of each one of the 42 reinstalled packages. I noticed that of the 7 packages directly related to the system’s GUI, 5 were specifically related to the display server. Four of the updates were to Xserver’s packages while the fifth was to the XWayland package. I don’t know much about display servers but I knew that GUI applications rely on them to function properly. I also knew that Ubuntu was transitioning from Xserver to Wayland, and a bit of googling informed me that XWayland is a compatibility layer used to run Xserver applications on Wayland. Now, for all I knew, any of these 5 packages could have caused the issue, but since my past experience with Wine had left me biased against compatibility software I decided to start with the XWayland package. Sure enough, as soon as I reinstalled the package, the left-click functionality returned.

While dealing with this incident I learned some interesting bits of technical information. But as far as the larger picture was concerned it only confirmed what I already knew:

Posted: 27-07-2022
Tags: software