Dealing with PPA and GPG problems in Ubuntu and derivatives

PPAs are extremely useful, making installing and maintaining apps in Ubuntu and derivatives (such as Linux Mint) extremely easy. However, upgrading the system or problems/changes in the maintainer of the PPA can turn things into a pain the neck. Y PPA Manager is a tool from Web UPD8 designed specifically to keep all this under control in a easy way.

Some of the functions are:

  • List the packages available in a PPA added on your system
  • Download packages from PPAs without adding them
  • PPAs backup / restore, along with all the PPA keys
  • Update single repositories using a command line tool (by the way, when you add a PPA using Y PPA Manager, it’s updated without updating all the software sources) called “update-ppa” – usage example: “sudo update-ppa ppa:webupd8team/java”
  • Some options that should help you re-enable the working PPAs when upgrading to a newer Ubuntu / Linux Mint version
  • Remove duplicate PPAs
  • Unity quicklists / optional AppIndicator

Installing Y PPA Manager is as easy as copy and pasting the next lines:

sudo add-apt-repository ppa:webupd8team/y-ppa-manager
sudo apt update
sudo apt install y-ppa-manager

If you are having problems with expired GPG keys:

We know that feeling. The maintainer of a repository changes something and suddenly we start having problems with the GPG Keys. In my case, this happens -too frequently, under my point of view- with QGIS. Luckily we can fix invalid GPG keys with a single-line command:

sudo apt-key list | \
 grep "expired: " | \
 sed -ne 's|pub .*/\([^ ]*\) .*|\1|gp' | \
 xargs -n1 sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys

Command explanation:

  • sudo apt-key list Lists all keys installed in the system.
  • grep “expired: “ Leaves only lines with expired keys.
  • sed -ne ‘s|pub .*/\([^ ]*\) .*|\1|gp’ Extracts keys.
  • xargs -n1 sudo apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv-keys Updates the expired keys with those found in the Ubuntu key server.

Sources:

http://www.webupd8.org/2016/03/y-ppa-manager-updated-with-important.html

https://stackoverflow.com/a/46737148/3866828

Fix and prevent Windows continuously changing UEFI order

Having a dual-boot machine with Windows 8 or Windows 10 and Linux is frustrating, because Windows changes continuously the UEFI booting order, thus preventing GRUB to load. This usually happens after an update.

This command executed from Windows’ Command Prompt (as an administrator) seems to fix the problem for Ubuntu and derivatives:

bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi

For other distros, you will need to identify first which .efi file is needed to boot. More information about the commands available for bcdedit is available in the Window’s IT center‘s website.

MEAN.JS and the CRUD Module Sub-Generator

MEAN.JS still needs to pulish a few things. For example, the compatibility with NODE 7.x. But a part from that, there is the CRUD Module Sub-Generator, which fails to properly add entries to the menu, and it is something that should be working out of the box.

Basically, you can use this generator for automatically creating the files needed for a CRUD interaction, but if you choose to add an entry to the menu… The website stops working and the only thing you can see is a blank page.

I was able to find more people with the same problem, for example:

  • https://groups.google.com/forum/#!searchin/meanjs/yo$20meanjs$3Acrud-module|sort:relevance/meanjs/wKavBQOCZvw/0-dlYj6hCLMJ
  • https://github.com/meanjs/mean/issues/347

But just when I was about to delete the project and find an alternative to MEAN.JS, I found the solution to the problem:

in client\config\customers.client.config.js reemplace this line:

menuConfig.$inject = [‘menuService’];

with this:

menuConfig.$inject = [‘Menus’];

Thanks StackOverflow!

Fix Telegram not showing accents in elementary OS

Diving in the Internet I found some answers, mainly related with IBus. However, it seems like they are not working with elementary OS 0.4 Loki.

The workaround is simple, just edit the file of the launcher corresponding to Telegram:

nano .local/share/applications/telegramdesktop.desktop

and change this line:

Exec=/home/YOUR-USER/Downloads/Telegram/Telegram -- %u

to look like this other one:

Exec=env QT_IM_MODULE=xim /home/YOUR-USER/Downloads/Telegram/Telegram -- %u

That should do the trick. But maybe you need to install a couple of IBus dependencies first? Just in case:

sudo apt install ibus-gtk ibus-gtk3 ibus-qt4

UEFI and Linux

The UEFI (Unified Extensible Firmware Interface) is an example of a good idea developed, enforced, and implemented in the wrong way. What was meant to help us protecting our computer, turned into some kind of kidnapper that prevented us to use the OS of our choice.

Installing a different OS to the provided by the manufacturer is a, sometimes impossible, sometimes painful, task. Some manufacturers simply don’t contemplate the use of anything different from Windows 8 or 10 in their machines (ajem, HP, ajem), forcing us to press the Boot-order-selection key during the booting of OUR devices in order to being able to start, let’s say, Linux. Every single time. I repeat. Every. Single. Time. And it’s curious how, no matter which procedure you use, and how many times you change the UEFI boot order, Windows always comes to the top.

Although I have not been able to fix this problem in my HP machine (well, I know the solution, not buying HP products anymore), I successfully managed to fix it in 2 Lenovo machines. The procedure is quite easy -but use it under your own responsibility. Presuming that Linux has been installed in UEFI mode correctly (there are different methods to check this, but the easiest is to check if you have a boot/efi folder using the command df -h –local | grep /boot), you just need to install boot-repair:

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt update
sudo apt install boot-repair
boot-repair

Just the quick setup should do the magic. However, in my experience, it was not so easy, and the machine was still booting into Windows. I had to boot into Windows and execute the following command in the command line with administrative privileges:

bcdedit /set {bootmgr} path \EFI\ubuntu\shim64.efi

That seems to work in the Lenovo machines, but not for HP (such a surprise).

Fedora 20 not booting after installing nvidia drivers

After installing the propietary nvidia drivers from the RPM Fusion repository, probably Fedora 20 is not going to finish the booting process… However, pressing [CTRL]+[F2] we can log in the text-only terminal and fix the problem.

  1. Remove the installed drivers:

    sudo yum remove xorg-x11-drv-nvidia* nvidia-settings nvidia-config
    									

  2. Reboot:

    reboot
    									

  3. Now you should have a basic graphic interface. Go to /etc/X11 and remove any xorg.conf files. You will need superuser permissions.
  4. Clean and update yum:

    sudo yum clean all; sudo yum update
    									

  5. Install nVidia:

    sudo yum install kernel-devel akmod-nvidia xorg-x11-drv-nvidia-libs
    									

  6. Force akmod:

    sudo /usr/sbin/akmods --force
    									

  7. Reboot.

That should be enough to solve the problem.

Sharing files using Bluetooth in Linux Mint 15

logo bluetoothIf you try to share files using the Bluetooth of your device, and you are using Linux Mint 15, you will realize that something is not working… The reason is that one component is missing. To solve it:

If you are using Linux Mint Mate:

sudo apt-get install mate-user-share
									

If you are using Linux Mint Cinnamon (I’m not pretty sure about this as I have not a Cinnamon desktop, but if it don’t work, you can try with the Gnome version):

sudo apt-get install cinnamon-user-share
									

If you are using Linux with Gnome:

sudo apt-get install gnome-user-share
									

Now you can do right click on the Bluetooth icon in your launcher panel (it is by the time and date), press on Receive files, and mark:

  • Share public files over Bluetooth
  • Require remote devices to bond with this computer
  • Receive files in Downloads folder over Bluetooth
  • Notify about received files

I don’t know why that package is not included by default in the installation but, well, it is easy to solve…