/ mozey.co / blog

ubuntu fresh install

July 1, 2015

Couple of useful things to do an every fresh Ubuntu install, first update apt

sudo apt-get update

🔗 Misc

🔗 Get rid of messages like: “LC_ALL: cannot change locale (en_GB.UTF-8)”

sudo locale-gen en_GB.UTF-8

🔗 Install network time protocol client to keep clock in sync

sudo apt-get install ntp

Configure time zone

sudo dpkg-reconfigure tzdata

Servers should use Etc > UTC

🔗 Customize prompt so you don’t get confused about which server you’ve SSHd into:

vi ~/.profile

PS1="\n<\[\033[0;32m\]SERVER_NAME\[\033[0m\]:\[\033[0;37m\]\u\[\033[0m\]> \j [\$(date +%d-%m\" \"%H:%M)] \w \n! "

🔗 Install software using tasksel

sudo apt-get install tasksel

sudo tasksel

Install collections

LAMP Server

PostgresSQL Database

🔗 Making an Amazon EBS Volume Available for Use

View available disk devices


🔗 Determine whether you need to create a file system on the volume,

an example of DEVICE_NAME is /dev/xvdb

sudo file -s DEVICE_NAME

🔗 Create a filesystem if previous command just displays “data”

sudo mkfs -t ext4 DEVICE_NAME

🔗 Create a mount point directory for the volume,

for example /home/ubuntu/data

sudo mkdir MOUNT_POINT

🔗 Mount the volume


🔗 Add volume to fstab to enable mount on reboot

Create backup of fstab

sudo cp /etc/fstab /etc/fstab.bak

fstab line format and example,

/dev/xvdb       /home/ubuntu/data   ext4                defaults,nofail             0       2
sudo vi /etc/fstab

Adding “nobootwait” option as described by the article gives an error

Check new entry works

sudo mount -a

Change permissions

sudo chown -R ubuntu:ubuntu /home/ubuntu/data/

🔗 Services

List all services

service --status-all

🔗 SystemD

Disable a service

sudo systemctl disable NAME.service