Adding Ubuntu to Windows 10

Recently I heard from a colleague that Windows has added Ubuntu bash to the OS.

Original Guide from: https://msdn.microsoft.com/en-us/commandline/wsl/install_guide

Lets get started:

1. Verify the OS build by going start menu > System > About

We have to be running a 64-bit version of Windows 10 Anniversary Update or later (build 1607+).

That is checked.

2. Activate Developer Mode

Start Menu > Settings > search Developer mode

Give it a moment, Windows will do some installation.

3. Enable “Windows Subsystem for Linux” – this is already part of the Windows package we have to enable it.

Open Power shell as admin and run the following command:
open start menu > search “power shell” > right click “run as adminstrator”

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Image shows:

Seems that i have already enabled it previously – thus no it is online and no need to restart.

Next to run Bash

open command prompt and type bash then y

Personally I’m comfortable with Ubuntu so I went ahead with the install, alternatively you can search from the Windows store and download other flavors:

Once installed, you are good to go with Bash! – so I was wrong, long waiting time as usual with Microsoft.

20 mins later still installing – come on Microsoft you can do better.

Argghh all it needed was to press enter, might have been faster.

Alright! all set ready to have a Bash!

Ubuntu: sudo: unable to resolve host : Error

It becomes irritating when cloning a server only to get the hostname error again.

root@server1:~$ sudo apt update
sudo: unable to resolve host server1

This happens because the server is unable to determine the hostname of the server

Resolution includes looking at 2 files.

/etc/hostname

/etc/hosts

In /etc/hostname ensure the hostname of your server is updated, matches the current hostname of the server you are using.

sudo nano /etc/hostname

*edit file to hostname

server1

Ctrl + x  and y to save

and in /etc/hosts

sudo nano /etc/hosts

*edit file where server1 is your hostname

127.0.0.1 localhost
127.0.0.1 server1

again to exit, ctrl + x then y

Ubuntu 14.04: NO_PUBKEY : Error

Ubuntu 14.04: Error

The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY

When doing sudo apt update – encountered this error

Get:65 http://sg.archive.ubuntu.com trusty/restricted i386 Packages [13.4 kB]
Get:66 http://sg.archive.ubuntu.com trusty/universe i386 Packages [5866 kB]
Get:67 http://sg.archive.ubuntu.com trusty/multiverse i386 Packages [134 kB]
Get:68 http://sg.archive.ubuntu.com trusty/main Translation-en [762 kB]
Get:69 http://sg.archive.ubuntu.com trusty/multiverse Translation-en [102 kB]
Get:70 http://sg.archive.ubuntu.com trusty/restricted Translation-en [3457 B]
Get:71 http://sg.archive.ubuntu.com trusty/universe Translation-en [4089 kB]
Fetched 34.5 MB in 22s (1566 kB/s)
Reading package lists... Done
W: GPG error: http://ppa.launchpad.net trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4F4EA0AAE5267A6C
W: GPG error: http://ppa.launchpad.net trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C2518248EEA14886

Did a quick search on the web and found a solution

Link Below:

Fix apt-get update “the following signatures couldn’t be verified because the public key is not available”

Solution was to request new keys from the key server

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C C2518248EEA14886

I had 2 missing Keys 4F4EA0AAE5267A6C and C2518248EEA14886

Command to enter would be

sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys  [your required key]