Update entity framework on Ubuntu 18.04

The EF Core tools version '3.1.1' is older than that of the runtime '3.1.4'. Update the tools for the latest features and bug fixes.

In order to update EF Core tools on Ubuntu 18.04 from the terminal simply run the following  command:

dotnet tool update --global dotnet-ef

Installing .NET Core SDK on Ubuntu 20.04 LTS

I'm typically an early adopter of new Ubuntu LTS releases and as such I reformatted my laptop with the release hoping to get going with .NET Core right away but the posted install guide on Microsoft docs didn't work. I went back to the docs a few days later and found that the guide had been pulled. After weeks of waiting we finally got an update today! The packages should be available on 5/12/2020 (only 2.5 weeks after the LTS dropped, ­čÄë great job Microsoft!)

There are several workarounds for anyone that needs to use the SDK immediately. Check them out here.

UPDATE 5/13/2020: The Ubuntu packages are live and the dependencies issues yesterday were resolved. Here's how to get it going until Microsoft updates their documentation.

wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-3.1
Dotnet-sdk-3.1 Ubuntu 20.04 installation steps

If you had previous failed attempts you may have to purge old sources.

sudo dpkg --purge packages-microsoft-prod && sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update

The power of Control-R in Ubuntu

If you're anything like me in the terminal you're continuously using the up arrow to look back through commands. Today I found that if you hold the CTRL key then press R it will load the previous command search (I use Ubuntu 20.04 LTS). Start typing and if the command you want is shown press enter to execute. If this is not the correct command press CTRL-R to search back further. If you do not want to execute just hit CTRL-C to cancel.

reverse-i-search

Hint - this is based on your HISTSIZE setting. The default on my system is 500 which is fine for my purposes.

How to mount QNAP file share with fstab on Ubuntu 18.04

  1. Create a mount location on your Ubuntu host.
sudo mkdir /media/<sharename>

2. Create a credentials file (I created mine at /media/nfs-credentials with sudo touch /media/nfs-credentials and put the following lines in the file.

username=<shareusername>
password=<sharepassword>

Edit /etc/fstab and add a line at the bottom being careful not to edit any lines that already exist.

//<share_ip>/<sharename> /media/<sharename> cifs uid=0,credentials=/nfs/nas-credentials,iocharset=utf8,noperm 0 0

Test your mount with the following command:

sudo mount -a

Navigate to /media/<sharename> and you should see the contents of your share.

Your share will automatically mount at system boot from now on.

How to update Gitlab repository public key

brennan@gitlab:~$ sudo apt update
[sudo] password for brennan:
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Get:3 https://packages.gitlab.com/gitlab/gitlab-ee/ubuntu bionic InRelease [23.3 kB]
Err:3 https://packages.gitlab.com/gitlab/gitlab-ee/ubuntu bionic InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3F01618A51312F3F
Fetched 23.3 kB in 1s (24.3 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://packages.gitlab.com/gitlab/gitlab-ee/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3F01618A51312F3F
W: Failed to fetch https://packages.gitlab.com/gitlab/gitlab-ee/ubuntu/dists/bionic/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3F01618A51312F3F
W: Some index files failed to download. They have been ignored, or old ones used instead.

I recently went to update my self-hosted Gitlab instance on Ubuntu 18.04 and got a new error: NO_PUBKEY 3F01618A51312F3F

To fix this just re-import the public key of the repository and run the apt update again.

curl --silent https://packages.gitlab.com/gpg.key | sudo apt-key add -

Happy coding!