Upgrading node and yarn

Problem

You are getting the following error when trying to use yarn:

$ yarn
yarn install v1.21.1
[1/5] Validating package.json...
error xxxxx@: The engine "node" is incompatible with this module. Expected version "^10.0.0". Got "8.10.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Solution

Upgrade yarn

$ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
[sudo] password for username: 
OK

$ echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
deb https://dl.yarnpkg.com/debian/ stable main

$ sudo apt-get update
$ sudo apt-get upgrade

Which should give the updated yarn version:

$ yarn
yarn install v1.22.5
[1/5] Validating package.json...
error xxxxx@: The engine "node" is incompatible with this module. Expected version "^10.0.0". Got "8.10.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Upgrade node version with the correct version from above (ie 10.0.0)

$ curl -fsSL https://deb.nodesource.com/setup_10.x | sudo -E bash -

$ sudo apt-get install -y nodejs
....
The following packages will be upgraded:
  nodejs
...

And then the needed versions would have been installed:

$ yarn
yarn install v1.22.5
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
Done in 0.90s.

Find the current AMI image (i.e. Ubuntu 16.04) in AWS using command line

If you would like to programatically find the current image of a specific distribution in AWS for your region, with the use of the aws cli, use the following (in this example looking for Ubuntu 16.04).

aws ec2 describe-images \
    --owners 099720109477 \
    --filters "Name=name,Values=ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-????????" "Name=state,Values=available" \
    --query "reverse(sort_by(Images, &CreationDate))[:1].ImageId" \
    --output text

Or for 18.04

aws ec2 describe-images \
    --owners 099720109477 \
    --filters "Name=name,Values=ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-????????" "Name=state,Values=available" \
    --query "reverse(sort_by(Images, &CreationDate))[:1].ImageId" \
    --output text

This is from the examples in the documentation here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html

Raspberry, Ubuntu and Megatools

To install megtools (command line utilities for Mega.nz), in your raspberry with ubuntu installed follow the steps below (thanks to the instructions from here: https://www.instructables.com/id/Descarga-archivos-de-Mega-con-Raspberry-Pi/)

  • Install the necessary packages
sudo apt-get -y install build-essential libglib2.0-dev libssl-dev libcurl4-openssl-dev libgirepository1.0-dev 

You may also need to add some additional packages if there is an error about the documentation.

  • Get the latest source code from https://megatools.megous.com
wget https://megatools.megous.com/builds/megatools-1.10.3.tar.gz
  • Compile and install them
tar xvfz megatools-1.10.3.tar.gz
cd megatools-1.10.3
./configure
make
sudo make install
sudo ldconfig
  • Add your Mega account credentials in ~/.megarc like:
[Login]
Username = my_mega@email
Password = mypassword
  • use the mega tools commands (megacopy, megals, megaget etc.

Erlang and Elixir with asdf in Raspberry 4 with Ubuntu 20.04

To install the latest/current versions of erlang (23.0.2) and elixir (1.10.3), follow the instructions below:

Install asdf ( full instructions https://asdf-vm.com/#/core-manage-asdf-vm):

git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.7.8

Add the following two lines in your ~/.bashrc file:

# Add asdf version manager 
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash

Reload/Source your bash file with

source ~/.bashrc

Install the erlang plugin

asdf plugin add erlang

If you get the following warnings:

...
Extracting source code
Building Erlang/OTP 23.0.2 (asdf_23.0.2), please wait...
WARNING: It appears that a required development package 'libssl-dev' is not installed.
WARNING: It appears that a required development package 'automake' is not installed.
WARNING: It appears that a required development package 'autoconf' is not installed.
WARNING: It appears that a required development package 'libncurses5-dev' is not installed.
Configure failed.
...

Install the missing packages:

sudo apt install libssl-dev automake autoconf libncurses5-dev

Install latest erlang version:

asdf install erlang latest
...
Erlang/OTP 23.0.2 (asdf_23.0.2) has been successfully built
...

Set it up globally (if you want):

asdf global erlang 23.0.2

Add elixir plugin:

asdf plugin add elixir

Install latest elixir version (1.10.3):

asdf install elixir latest

Set it up globally:

asdf global elixir 1.10.3-otp-23

Finally you can also install the latest Phoenix version (1.5.3):

mix archive.install hex phx_new 1.5.3

Cannot login to MariaDB server with root account

Problem

You are trying to login to MariaDB with the root user, but even after resetting the password, it is still not possible to login.

Solution

It seems that certain MariaDB packages that come with Linux distributions use the unix_socket as the authentication method.

MariaDB [mysql]> SELECT user, host, plugin FROM user WHERE user='root';
+------+-----------+-------------+
| user | host      | plugin      |
+------+-----------+-------------+
| root | localhost | unix_socket |
+------+-----------+-------------+
1 row in set (0.00 sec)

Change the plugin as described here (https://stackoverflow.com/a/43424234) with the following:

MariaDB [mysql]> UPDATE mysql.user SET plugin = '' WHERE user = 'root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

Errors were encountered while processing: linux-image-3.13.0-128-generic

Problem

You are trying to install/remove a package but you always get an error message about linux message as above:

Errors were encountered while processing:
 linux-image-3.13.0-128-generic

Solution

Try the following:

rm -rf /var/lib/dpkg/info/linux-image-3.13.0-128-generic.*
apt-get purge linux-image-3.13.0-128-generic

failed to execute ‘/lib/udev/socket:@/org/freedesktop/hal/udev_event’ ‘socket:@/org/freedesktop/hal/udev_event’

Problem

Looking at your /var/log/syslog you see entries every few seconds like the following:

Mar  1 15:44:52 L530 systemd-udevd[11464]: failed to execute '/lib/udev/socket:@/org/freedesktop/hal/udev_event' 'socket:@/org/freedesktop/hal/udev_event': No such file or directory
Mar  1 15:44:52 L530 systemd-udevd[11451]: Process 'socket:@/org/freedesktop/hal/udev_event' failed with exit code 2.
Mar  1 15:44:54 L530 systemd-udevd[11479]: failed to execute '/lib/udev/socket:@/org/freedesktop/hal/udev_event' 'socket:@/org/freedesktop/hal/udev_event': No such file or directory
Mar  1 15:44:54 L530 systemd-udevd[11466]: Process 'socket:@/org/freedesktop/hal/udev_event' failed with exit code 2.

Solution

Seems that hal is not used in newer Ubuntu versions, so you can remove it:

sudo apt-get purge hal

Taken from the answer here