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]

Unturned Headless Server with Ubuntu 14.04

Greetings!

This would be my first tutorial of a headless installation, we will be using Steamcmd and Rocket to get the server running.

There are 3 parts to this installation.

1. Install the pre requisites the programs required to run Steam and Rocket.
2. Install steamcmd
3. Install Rocket

1. Install the programs

sudo apt-get install lib32gcc1 zip lib32stdc++6 curl

apt install mono-runtime libmono2.0-cil

If there is an error with mono during running the script, install this instead ( alittle over kill though)

sudo apt-get install mono-complete

2. Now install steamcmd

mkdir ~/Steam && cd ~/Steam
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -

3. Final and tricky bit to install Rocket Mod

Steps as follows, got to https://rocketmod.net/get-rocket# get the download link or use the below link if it has not expired.
sudo wget https://api.rocketmod.net/download.unturned-linux.latest.44691EEF-75EC-45DF-B2FD-50320A289BA5 
(download the Linux version of Rocket Mod)

Rename the file to a zip file
sudo mv download.unturned-linux.latest.44691EEF-75EC-45DF-B2FD-50320A289BA5 ./rocket.zip

Extract the content
sudo unzip rocket.zip -d ./

Finally once unpacking go to Script folder and run the update.sh file that will download all the relevant files
cd Scripts/
sudo chmod +x *.sh

At this point you would want to create a new steam account to run the server. Different from the account you use to play the game.

Replace USERNAME and PASSWORD with your steam username and password.
sudo ./update.sh USERNAME PASSWORD

Its fairly simple but it took me 3 days to muck around and get the files in the right place for the setup.

once all the files are downloaded.
You are done!

In the Next post i will talk about how to run the Server and how to configure. I’m no expert so feel free to leave comments below. Some sources for this project which I got most of the information from.

  • https://developer.valvesoftware.com/wiki/SteamCMD#Linux
  • https://github.com/RocketMod/Rocket/wiki/Installing-Rocket
  • https://github.com/RocketMod/Rocket.Unturned/blob/master/Rocket.Unturned/Scripts/Linux/README