How to setup Ubuntu Classic Server 16.04 on Raspberry Pi 3 for running Python 3 applications

Most of the customers who wanted to try out my minimal viable products (MVP) would provide me with an instance of Ubuntu Classic Server 16.0x these days. As such, it makes sense for me to trial my MVPs on the Ubuntu Classic Server 16.0x to ensure that I spend minimal time in deploying my MVPs to validate my customers' needs. Since I have a few Raspberry Pi 3s lying around in the house, I can install a version of Ubuntu Classic Server 16.0x to serve as the development server for me to trial my MVPs.

Fortunately, the good folks at had put up an optimised Ubuntu Classic Server 16.04 image for Raspberry Pi 3.

This post documents the steps that I took to setup Ubuntu Classic Server 16.04 on my Raspberry Pi 3 for running Python 3 applications.

Hardware that I used for my Ubuntu Classic Server 16.04 build

The server hardware consisted of the following parts:

If you have a spare micro USB charger that came along with your typical Android phone, you can use it to power your Raspberry Pi 3 instead of buying the CanaKit 5V 2.5A Raspberry Pi 3 Power Supply / Adapter / Charger (UL Listed).

Prerequisite hardware to install operating system onto the microSD

Raspberry Pi 3 board will load an operating system from a microSD card. Hence, we will need to have a computer with a SD card reader. If your computer does not come with a SD card reader, you have to get one.

If you have the standard SD card reader on your computer, you may want to get the Kingston Digital 32 GB microSDHC Class 10 UHS-1 Memory Card 30MB/s with Adapter (SDC10/32GB) instead.

Installing the Ubuntu Classic Server 16.04 image onto the microSD card

After I got my hands on all the hardware that I needed, I proceeded to get a copy of the Ubuntu Classic Server 16.04 image onto my Mac. To do so, I navigated to the download page of Ubuntu Pi Flavour Maker and downloaded the Ubuntu Classic Server 16.04 for Raspberry Pi 3 image to the filesystem of my Mac. The downloaded file came as ubuntu-16.04-preinstalled-server-armhf+raspi3.img.xz. I double-clicked on the file to extract the .img file. This .img file is what we would deal with for the image installation onto the microSD card.

I then inserted my microSD card into the SD card reader on my Mac via an adapter and used Etcher to write that .img file onto my microSD card.

Assembling the hardware

Once Etcher had installed Ubuntu Classic Server 16.04 onto my microSD card, I removed it from my SD card reader and inserted it to the SD card slot on the Raspberry Pi 3 board. I then proceeded to assemble the Raspberry Pi 3 board to the Official Raspberry Pi case.

Booting into Ubuntu Classic Server 16.04

With the assembly of Raspberry Pi 3 board and Official Raspberry Pi case, I then connected one end of the RJ45 cable to the RJ45 port on my Raspberry Pi 3 board and the other end of the cable to one of the switch port on my home router.

To facilitate the configuration of Ubuntu Classic Server 16.04, I connected my trusty mouse, keyboard, monitor to the USB and HDMI ports of my Raspberry Pi 3 board.

The default username to login Ubuntu Classic Server 16.04 is ubuntu and the password is ubuntu.

At the first login, the system will prompt for password change. I entered ubuntu as the current password and my favourite password twice to change the default password:

You are required to change your password immediately (root enforced)
(current) UNIX password: 
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully

After I had changed the password, I supplied ubuntu as the username and my favourite password to the login prompt to continue with configuring my Ubuntu Classic Server 16.04 on my Raspberry Pi 3.

Changing the timezone of my Ubuntu Classic Server 16.04

The default timezone of my Ubuntu Classic Server 16.04 is set to Etc/UTC. Since I reside in Singapore, I would like my Ubuntu Classic Server 16.04 to be set to Singapore's timezone.

To do so, I first used the timedatectl command to check the option that I would need to use for setting Singapore's timezone:

timedatectl list-timezones | grep Singapore

This command gave me Asia/Singapore as the output.

With this information, I changed the timezone of my Ubuntu Classic Server 16.04 to Singapore's timezone using the following command:

sudo timedatectl set-timezone Asia/Singapore

Default apt-get packages for Ubuntu Classic Server 16.04 on Raspberry Pi 3

The next thing that I did was to check the list of packages that came along with the Ubuntu Classic Server 16.04 image for Raspberry Pi 3. To do so, I typed the following command:

apt list --installed

Which gave me the following list:

accountsservice/xenial,now 0.6.40-2ubuntu10 armhf [installed]
acl/xenial,now 2.2.52-3 armhf [installed]
acpid/xenial,now 1:2.0.26-1ubuntu2 armhf [installed]
adduser/xenial,now 3.113+nmu3ubuntu4 all [installed]
apparmor/xenial,now 2.10.95-0ubuntu2 armhf [installed]
apport/xenial,now 2.20.1-0ubuntu2 all [installed]
apport-symptoms/xenial,now 0.20 all [installed]
apt/xenial,now 1.2.10ubuntu1 armhf [installed]
apt-transport-https/xenial,now 1.2.10ubuntu1 armhf [installed]
apt-utils/xenial,now 1.2.10ubuntu1 armhf [installed]
at/xenial,now 3.1.18-2ubuntu1 armhf [installed]
base-files/xenial,now 9.4ubuntu4 armhf [installed]
base-passwd/xenial,now 3.5.39 armhf [installed]
bash/xenial,now 4.3-14ubuntu1 armhf [installed]
bash-completion/xenial,now 1:2.1-4.2ubuntu1 all [installed]
bcache-tools/xenial,now 1.0.8-2 armhf [installed]
bind9-host/xenial-updates,now 1:9.10.3.dfsg.P4-8ubuntu1 armhf [installed]
bsdmainutils/xenial,now 9.0.6ubuntu3 armhf [installed]
bsdutils/xenial,now 1:2.27.1-6ubuntu3 armhf [installed]
btrfs-tools/xenial,now 4.4-1 armhf [installed]
busybox-initramfs/xenial,now 1:1.22.0-15ubuntu1 armhf [installed]
busybox-static/xenial,now 1:1.22.0-15ubuntu1 armhf [installed]
byobu/xenial,now 5.106-0ubuntu1 all [installed]
bzip2/xenial,now 1.0.6-8 armhf [installed]
ca-certificates/xenial,now 20160104ubuntu1 all [installed]
cloud-guest-utils/xenial,now 0.27-0ubuntu24 all [installed]
cloud-init/xenial,now 0.7.7~bzr1212-0ubuntu1 all [installed]
cloud-initramfs-copymods/xenial,now 0.27ubuntu1 all [installed]
cloud-initramfs-dyn-netconf/xenial,now 0.27ubuntu1 all [installed]
command-not-found/xenial,now 0.3ubuntu16.04 all [installed]
command-not-found-data/xenial,now 0.3ubuntu16.04 armhf [installed]
console-setup/xenial,now 1.108ubuntu15 all [installed]
console-setup-linux/xenial,now 1.108ubuntu15 all [installed]
coreutils/xenial,now 8.25-2ubuntu2 armhf [installed]
cpio/xenial,now 2.11+dfsg-5ubuntu1 armhf [installed]
cron/xenial,now 3.0pl1-128ubuntu2 armhf [installed]
cryptsetup/xenial,now 2:1.6.6-5ubuntu2 armhf [installed]
cryptsetup-bin/xenial,now 2:1.6.6-5ubuntu2 armhf [installed]
curl/xenial,now 7.47.0-1ubuntu2 armhf [installed]
dash/xenial,now 0.5.8-2.1ubuntu2 armhf [installed]
dbus/xenial,now 1.10.6-1ubuntu3 armhf [installed]
debconf/xenial,now 1.5.58ubuntu1 all [installed]
debconf-i18n/xenial,now 1.5.58ubuntu1 all [installed]
debianutils/xenial,now 4.7 armhf [installed]
devio/xenial,now 1.2-1build2 armhf [installed,automatic]
dh-python/xenial,now 2.20151103ubuntu1 all [installed]
diffutils/xenial,now 1:3.3-3 armhf [installed]
distro-info-data/xenial-updates,xenial-security,now 0.28ubuntu0.1 all [installed]
dmeventd/xenial,now 2:1.02.110-1ubuntu10 armhf [installed]
dmidecode/xenial,now 3.0-2 armhf [installed]
dmsetup/xenial,now 2:1.02.110-1ubuntu10 armhf [installed]
dns-root-data/xenial,now 2015052300+h+1 all [installed]
dnsmasq-base/xenial,now 2.75-1 armhf [installed]
dnsutils/xenial-updates,now 1:9.10.3.dfsg.P4-8ubuntu1 armhf [installed]
dosfstools/xenial,now 3.0.28-2 armhf [installed]
dpkg/xenial,now 1.18.4ubuntu1 armhf [installed]
e2fslibs/xenial,now 1.42.13-1ubuntu1 armhf [installed]
e2fsprogs/xenial,now 1.42.13-1ubuntu1 armhf [installed]
eatmydata/xenial,now 105-3 all [installed]
ed/xenial,now 1.10-2 armhf [installed]
eject/xenial,now 2.1.5+deb1+cvs20081104-13.1 armhf [installed]
ethtool/xenial,now 1:4.5-1 armhf [installed]
file/xenial,now 1:5.25-2ubuntu1 armhf [installed]
findutils/xenial,now 4.6.0+git+20160126-2 armhf [installed]
flash-kernel/xenial,now 3.0~rc.4ubuntu63~rpi3.1 armhf [installed]
fonts-ubuntu-font-family-console/xenial,now 1:0.83-0ubuntu2 all [installed]
friendly-recovery/xenial,now 0.2.31 all [installed]
ftp/xenial,now 0.17-33 armhf [installed]
fuse/xenial,now 2.9.4-1ubuntu3 armhf [installed]
gawk/xenial,now 1:4.1.3+dfsg-0.1 armhf [installed]
gcc-5-base/xenial,now 5.3.1-14ubuntu2 armhf [installed]
gcc-6-base/xenial,now 6.0.1-0ubuntu1 armhf [installed]
gdisk/xenial,now 1.0.1-1build1 armhf [installed]
geoip-database/xenial,now 20160408-1 all [installed]
gettext-base/xenial,now 0.19.7-2ubuntu3 armhf [installed]
gir1.2-glib-2.0/xenial,now 1.46.0-3ubuntu1 armhf [installed]
git/xenial,now 1:2.7.4-0ubuntu1 armhf [installed]
git-man/xenial,now 1:2.7.4-0ubuntu1 all [installed]
gnupg/xenial,now 1.4.20-1ubuntu3 armhf [installed]
gpgv/xenial,now 1.4.20-1ubuntu3 armhf [installed]
grep/xenial,now 2.24-1 armhf [installed]
groff-base/xenial,now 1.22.3-7 armhf [installed]
grub-legacy-ec2/xenial,now 0.7.7~bzr1212-0ubuntu1 all [installed]
gzip/xenial,now 1.6-4ubuntu1 armhf [installed]
hdparm/xenial,now 9.48+ds-1 armhf [installed]
hostname/xenial,now 3.16ubuntu2 armhf [installed]
ifenslave/xenial,now 2.7ubuntu1 all [installed]
ifupdown/xenial,now 0.8.10ubuntu1 armhf [installed]
info/xenial,now 6.1.0.dfsg.1-5 armhf [installed]
init/xenial,now 1.29ubuntu1 armhf [installed]
init-system-helpers/xenial,now 1.29ubuntu1 all [installed]
initramfs-tools/xenial,now 0.122ubuntu8 all [installed]
initramfs-tools-bin/xenial,now 0.122ubuntu8 armhf [installed]
initramfs-tools-core/xenial,now 0.122ubuntu8 all [installed]
initscripts/xenial,now 2.88dsf-59.3ubuntu2 armhf [installed]
insserv/xenial,now 1.14.0-5ubuntu3 armhf [installed]
install-info/xenial,now 6.1.0.dfsg.1-5 armhf [installed]
iproute2/xenial,now 4.3.0-1ubuntu3 armhf [installed]
iptables/xenial,now 1.6.0-2ubuntu3 armhf [installed]
iputils-ping/xenial,now 3:20121221-5ubuntu2 armhf [installed]
iputils-tracepath/xenial,now 3:20121221-5ubuntu2 armhf [installed]
irqbalance/xenial,now 1.1.0-2ubuntu1 armhf [installed]
isc-dhcp-client/xenial,now 4.3.3-5ubuntu12 armhf [installed]
isc-dhcp-common/xenial,now 4.3.3-5ubuntu12 armhf [installed]
iso-codes/xenial,now 3.65-1 all [installed]
kbd/xenial,now 1.15.5-1ubuntu4 armhf [installed]
keyboard-configuration/xenial,now 1.108ubuntu15 all [installed]
klibc-utils/xenial,now 2.0.4-8ubuntu1 armhf [installed]
kmod/xenial,now 22-1ubuntu4 armhf [installed]
krb5-locales/xenial,now 1.13.2+dfsg-5 all [installed]
language-selector-common/xenial-updates,now 0.165.1 all [installed]
less/xenial,now 481-2.1 armhf [installed]
libaccountsservice0/xenial,now 0.6.40-2ubuntu10 armhf [installed]
libacl1/xenial,now 2.2.52-3 armhf [installed]
libapparmor-perl/xenial,now 2.10.95-0ubuntu2 armhf [installed]
libapparmor1/xenial,now 2.10.95-0ubuntu2 armhf [installed]
libapt-inst2.0/xenial,now 1.2.10ubuntu1 armhf [installed]
libapt-pkg5.0/xenial,now 1.2.10ubuntu1 armhf [installed]
libasn1-8-heimdal/xenial,now 1.7~git20150920+dfsg-4ubuntu1 armhf [installed]
libasprintf0v5/xenial,now 0.19.7-2ubuntu3 armhf [installed]
libatm1/xenial,now 1:2.5.1-1.5 armhf [installed]
libattr1/xenial,now 1:2.4.47-2 armhf [installed]
libaudit-common/xenial,now 1:2.4.5-1ubuntu2 all [installed]
libaudit1/xenial,now 1:2.4.5-1ubuntu2 armhf [installed]
libbind9-140/xenial-updates,now 1:9.10.3.dfsg.P4-8ubuntu1 armhf [installed]
libblkid1/xenial,now 2.27.1-6ubuntu3 armhf [installed]
libbsd0/xenial,now 0.8.2-1 armhf [installed]
libbz2-1.0/xenial,now 1.0.6-8 armhf [installed]
libc-bin/xenial,now 2.23-0ubuntu3 armhf [installed]
libc6/xenial,now 2.23-0ubuntu3 armhf [installed]
libcap-ng0/xenial,now 0.7.7-1 armhf [installed]
libcap2/xenial,now 1:2.24-12 armhf [installed]
libcap2-bin/xenial,now 1:2.24-12 armhf [installed]
libcomerr2/xenial,now 1.42.13-1ubuntu1 armhf [installed]
libcryptsetup4/xenial,now 2:1.6.6-5ubuntu2 armhf [installed]
libcurl3-gnutls/xenial,now 7.47.0-1ubuntu2 armhf [installed]
libdb5.3/xenial,now 5.3.28-11 armhf [installed]
libdbus-1-3/xenial,now 1.10.6-1ubuntu3 armhf [installed]
libdbus-glib-1-2/xenial,now 0.106-1 armhf [installed]
libdebconfclient0/xenial,now 0.198ubuntu1 armhf [installed]
libdevmapper-event1.02.1/xenial,now 2:1.02.110-1ubuntu10 armhf [installed]
libdevmapper1.02.1/xenial,now 2:1.02.110-1ubuntu10 armhf [installed]
libdns-export162/xenial-updates,now 1:9.10.3.dfsg.P4-8ubuntu1 armhf [installed]
libdns162/xenial-updates,now 1:9.10.3.dfsg.P4-8ubuntu1 armhf [installed]
libdrm2/xenial,now 2.4.67-1 armhf [installed]
libeatmydata1/xenial,now 105-3 armhf [installed]
libedit2/xenial,now 3.1-20150325-1ubuntu2 armhf [installed]
libelf1/xenial,now 0.165-3ubuntu1 armhf [installed]
liberror-perl/xenial,now 0.17-1.2 all [installed]
libestr0/xenial,now 0.1.10-1 armhf [installed]
libevent-2.0-5/xenial,now 2.0.21-stable-2 armhf [installed]
libexpat1/xenial,now 2.1.0-7 armhf [installed]
libfdisk1/xenial,now 2.27.1-6ubuntu3 armhf [installed]
libffi6/xenial,now 3.2.1-4 armhf [installed]
libfribidi0/xenial,now 0.19.7-1 armhf [installed]
libfuse2/xenial,now 2.9.4-1ubuntu3 armhf [installed]
libgcc1/xenial,now 1:6.0.1-0ubuntu1 armhf [installed]
libgcrypt20/xenial,now 1.6.5-2 armhf [installed]
libgdbm3/xenial,now 1.8.3-13.1 armhf [installed]
libgeoip1/xenial,now 1.6.9-1 armhf [installed]
libgirepository-1.0-1/xenial,now 1.46.0-3ubuntu1 armhf [installed]
libglib2.0-0/xenial,now 2.48.0-1ubuntu4 armhf [installed]
libglib2.0-data/xenial,now 2.48.0-1ubuntu4 all [installed]
libgmp10/xenial,now 2:6.1.0+dfsg-2 armhf [installed]
libgnutls-openssl27/xenial,now 3.4.10-4ubuntu1 armhf [installed]
libgnutls30/xenial,now 3.4.10-4ubuntu1 armhf [installed]
libgpg-error0/xenial,now 1.21-2ubuntu1 armhf [installed]
libgpm2/xenial,now 1.20.4-6.1 armhf [installed]
libgssapi-krb5-2/xenial,now 1.13.2+dfsg-5 armhf [installed]
libgssapi3-heimdal/xenial,now 1.7~git20150920+dfsg-4ubuntu1 armhf [installed]
libhcrypto4-heimdal/xenial,now 1.7~git20150920+dfsg-4ubuntu1 armhf [installed]
libheimbase1-heimdal/xenial,now 1.7~git20150920+dfsg-4ubuntu1 armhf [installed]
libheimntlm0-heimdal/xenial,now 1.7~git20150920+dfsg-4ubuntu1 armhf [installed]
libhogweed4/xenial,now 3.2-1 armhf [installed]
libhx509-5-heimdal/xenial,now 1.7~git20150920+dfsg-4ubuntu1 armhf [installed]
libicu55/xenial,now 55.1-7 armhf [installed]
libidn11/xenial,now 1.32-3ubuntu1 armhf [installed]
libisc-export160/xenial-updates,now 1:9.10.3.dfsg.P4-8ubuntu1 armhf [installed]
libisc160/xenial-updates,now 1:9.10.3.dfsg.P4-8ubuntu1 armhf [installed]
libisccc140/xenial-updates,now 1:9.10.3.dfsg.P4-8ubuntu1 armhf [installed]
libisccfg140/xenial-updates,now 1:9.10.3.dfsg.P4-8ubuntu1 armhf [installed]
libjson-c2/xenial,now 0.11-4ubuntu2 armhf [installed]
libk5crypto3/xenial,now 1.13.2+dfsg-5 armhf [installed]
libkeyutils1/xenial,now 1.5.9-8ubuntu1 armhf [installed]
libklibc/xenial,now 2.0.4-8ubuntu1 armhf [installed]
libkmod2/xenial,now 22-1ubuntu4 armhf [installed]
libkrb5-26-heimdal/xenial,now 1.7~git20150920+dfsg-4ubuntu1 armhf [installed]
libkrb5-3/xenial,now 1.13.2+dfsg-5 armhf [installed]
libkrb5support0/xenial,now 1.13.2+dfsg-5 armhf [installed]
libldap-2.4-2/xenial,now 2.4.42+dfsg-2ubuntu3 armhf [installed]
liblocale-gettext-perl/xenial,now 1.07-1build1 armhf [installed]
liblvm2app2.2/xenial,now 2.02.133-1ubuntu10 armhf [installed]
liblvm2cmd2.02/xenial,now 2.02.133-1ubuntu10 armhf [installed]
liblwres141/xenial-updates,now 1:9.10.3.dfsg.P4-8ubuntu1 armhf [installed]
liblxc1/xenial,now 2.0.0-0ubuntu2 armhf [installed]
liblz4-1/xenial,now 0.0~r131-2ubuntu2 armhf [installed]
liblzma5/xenial,now 5.1.1alpha+20120614-2ubuntu2 armhf [installed]
liblzo2-2/xenial,now 2.08-1.2 armhf [installed]
libmagic1/xenial,now 1:5.25-2ubuntu1 armhf [installed]
libmnl0/xenial,now 1.0.3-5 armhf [installed]
libmount1/xenial,now 2.27.1-6ubuntu3 armhf [installed]
libmpdec2/xenial,now 2.4.2-1 armhf [installed]
libmpfr4/xenial,now 3.1.4-1 armhf [installed]
libncurses5/xenial,now 6.0+20160213-1ubuntu1 armhf [installed]
libncursesw5/xenial,now 6.0+20160213-1ubuntu1 armhf [installed]
libnetfilter-conntrack3/xenial,now 1.0.5-1 armhf [installed]
libnettle6/xenial,now 3.2-1 armhf [installed]
libnewt0.52/xenial,now 0.52.18-1ubuntu2 armhf [installed]
libnfnetlink0/xenial,now 1.0.1-3 armhf [installed]
libnih1/xenial,now 1.0.3-4.3ubuntu1 armhf [installed]
libp11-kit0/xenial,now 0.23.2-3 armhf [installed]
libpam-modules/xenial,now 1.1.8-3.2ubuntu2 armhf [installed]
libpam-modules-bin/xenial,now 1.1.8-3.2ubuntu2 armhf [installed]
libpam-runtime/xenial,now 1.1.8-3.2ubuntu2 all [installed]
libpam-systemd/xenial,now 229-4ubuntu4 armhf [installed]
libpam0g/xenial,now 1.1.8-3.2ubuntu2 armhf [installed]
libparted2/xenial,now 3.2-15 armhf [installed]
libpcap0.8/xenial,now 1.7.4-2 armhf [installed]
libpci3/xenial,now 1:3.3.1-1.1ubuntu1 armhf [installed]
libpcre3/xenial,now 2:8.38-3.1 armhf [installed]
libperl5.22/xenial,now 5.22.1-9 armhf [installed]
libpipeline1/xenial,now 1.4.1-2 armhf [installed]
libplymouth4/xenial,now 0.9.2-3ubuntu13 armhf [installed]
libpng12-0/xenial,now 1.2.54-1ubuntu1 armhf [installed]
libpolkit-agent-1-0/xenial,now 0.105-14.1 armhf [installed]
libpolkit-backend-1-0/xenial,now 0.105-14.1 armhf [installed]
libpolkit-gobject-1-0/xenial,now 0.105-14.1 armhf [installed]
libpopt0/xenial,now 1.16-10 armhf [installed]
libprocps4/xenial,now 2:3.3.10-4ubuntu2 armhf [installed]
libpython3-stdlib/xenial,now 3.5.1-3 armhf [installed]
libpython3.5-minimal/xenial,now 3.5.1-10 armhf [installed]
libpython3.5-stdlib/xenial,now 3.5.1-10 armhf [installed]
libreadline5/xenial,now 5.2+dfsg-3build1 armhf [installed]
libreadline6/xenial,now 6.3-8ubuntu2 armhf [installed]
libroken18-heimdal/xenial,now 1.7~git20150920+dfsg-4ubuntu1 armhf [installed]
librtmp1/xenial,now 2.4+20151223.gitfa8646d-1build1 armhf [installed]
libsasl2-2/xenial,now 2.1.26.dfsg1-14build1 armhf [installed]
libsasl2-modules/xenial,now 2.1.26.dfsg1-14build1 armhf [installed]
libsasl2-modules-db/xenial,now 2.1.26.dfsg1-14build1 armhf [installed]
libseccomp2/xenial,now 2.2.3-3ubuntu3 armhf [installed]
libselinux1/xenial,now 2.4-3build2 armhf [installed]
libsemanage-common/xenial,now 2.3-1build3 all [installed]
libsemanage1/xenial,now 2.3-1build3 armhf [installed]
libsepol1/xenial,now 2.4-2 armhf [installed]
libsigsegv2/xenial,now 2.10-4 armhf [installed]
libslang2/xenial,now 2.3.0-2ubuntu1 armhf [installed]
libsmartcols1/xenial,now 2.27.1-6ubuntu3 armhf [installed]
libsqlite3-0/xenial,now 3.11.0-1ubuntu1 armhf [installed]
libss2/xenial,now 1.42.13-1ubuntu1 armhf [installed]
libssl1.0.0/xenial-updates,xenial-security,now 1.0.2g-1ubuntu4.1 armhf [installed]
libstdc++6/xenial,now 5.3.1-14ubuntu2 armhf [installed]
libsystemd0/xenial,now 229-4ubuntu4 armhf [installed]
libtasn1-6/xenial-updates,xenial-security,now 4.7-3ubuntu0.16.04.1 armhf [installed]
libtext-charwidth-perl/xenial,now 0.04-7build5 armhf [installed]
libtext-iconv-perl/xenial,now 1.7-5build4 armhf [installed]
libtext-wrapi18n-perl/xenial,now 0.06-7.1 all [installed]
libtinfo5/xenial,now 6.0+20160213-1ubuntu1 armhf [installed]
libudev1/xenial,now 229-4ubuntu4 armhf [installed]
libusb-0.1-4/xenial,now 2:0.1.12-28 armhf [installed]
libusb-1.0-0/xenial,now 2:1.0.20-1 armhf [installed]
libustr-1.0-1/xenial,now 1.0.4-5 armhf [installed]
libutempter0/xenial,now 1.1.6-3 armhf [installed]
libuuid1/xenial,now 2.27.1-6ubuntu3 armhf [installed]
libwind0-heimdal/xenial,now 1.7~git20150920+dfsg-4ubuntu1 armhf [installed]
libwrap0/xenial,now 7.6.q-25 armhf [installed]
libx11-6/xenial,now 2:1.6.3-1ubuntu2 armhf [installed]
libx11-data/xenial,now 2:1.6.3-1ubuntu2 all [installed]
libxau6/xenial,now 1:1.0.8-1 armhf [installed]
libxcb1/xenial,now 1.11.1-1ubuntu1 armhf [installed]
libxdmcp6/xenial,now 1:1.1.2-1.1 armhf [installed]
libxext6/xenial,now 2:1.3.3-1 armhf [installed]
libxml2/xenial,now 2.9.3+dfsg1-1 armhf [installed]
libxmuu1/xenial,now 2:1.1.2-2 armhf [installed]
libxtables11/xenial,now 1.6.0-2ubuntu3 armhf [installed]
libyaml-0-2/xenial,now 0.1.6-3 armhf [installed]
linux-base/xenial,now 4.0ubuntu1 all [installed]
linux-firmware/xenial,now 1.157 all [installed,automatic]
linux-firmware-raspi2/xenial,now 1.20160503+6832d9a-0ubuntu1~rpi1 armhf [installed]
linux-headers-4.4.0-1009-raspi2/xenial,now 4.4.0-1009.10 armhf [installed,automatic]
linux-headers-raspi2/xenial,now armhf [installed,automatic]
linux-image-4.4.0-1009-raspi2/xenial,now 4.4.0-1009.10 armhf [installed,automatic]
linux-image-raspi2/xenial,now armhf [installed,automatic]
linux-raspi2/xenial,now armhf [installed]
linux-raspi2-headers-4.4.0-1009/xenial,now 4.4.0-1009.10 armhf [installed,automatic]
locales/xenial,now 2.23-0ubuntu3 all [installed]
login/xenial,now 1:4.2-3.1ubuntu5 armhf [installed]
logrotate/xenial,now 3.8.7-2ubuntu2 armhf [installed]
lsb-base/xenial,now 9.20160110 all [installed]
lsb-release/xenial,now 9.20160110 all [installed]
lshw/xenial,now 02.17-1.1ubuntu3 armhf [installed]
lsof/xenial,now 4.89+dfsg-0.1 armhf [installed]
ltrace/xenial,now 0.7.3-5.1ubuntu4 armhf [installed]
lvm2/xenial,now 2.02.133-1ubuntu10 armhf [installed]
lxc-common/xenial,now 2.0.0-0ubuntu2 armhf [installed]
lxcfs/xenial-updates,now 2.0.0-0ubuntu2.1 armhf [installed]
lxd/xenial,now 2.0.0-0ubuntu4 armhf [installed]
lxd-client/xenial,now 2.0.0-0ubuntu4 armhf [installed]
makedev/xenial,now 2.3.1-93ubuntu1 all [installed]
man-db/xenial,now 2.7.5-1 armhf [installed]
manpages/xenial,now 4.04-2 all [installed]
mawk/xenial,now 1.3.3-17ubuntu2 armhf [installed]
mdadm/xenial,now 3.3-2ubuntu7 armhf [installed]
mime-support/xenial,now 3.59ubuntu1 all [installed]
mlocate/xenial,now 0.26-1ubuntu2 armhf [installed]
mount/xenial,now 2.27.1-6ubuntu3 armhf [installed]
mtr-tiny/xenial,now 0.86-1 armhf [installed]
multiarch-support/xenial,now 2.23-0ubuntu3 armhf [installed]
nano/xenial,now 2.5.3-2 armhf [installed]
ncurses-base/xenial,now 6.0+20160213-1ubuntu1 all [installed]
ncurses-bin/xenial,now 6.0+20160213-1ubuntu1 armhf [installed]
ncurses-term/xenial,now 6.0+20160213-1ubuntu1 all [installed]
net-tools/xenial,now 1.60-26ubuntu1 armhf [installed]
netbase/xenial,now 5.3 all [installed]
netcat-openbsd/xenial,now 1.105-7ubuntu1 armhf [installed]
ntfs-3g/xenial,now 1:2015.3.14AR.1-1build1 armhf [installed]
open-iscsi/xenial,now 2.0.873+git0.3b4b4500-14ubuntu3 armhf [installed]
openssh-client/xenial,now 1:7.2p2-4 armhf [installed]
openssh-server/xenial,now 1:7.2p2-4 armhf [installed]
openssh-sftp-server/xenial,now 1:7.2p2-4 armhf [installed]
openssl/xenial-updates,xenial-security,now 1.0.2g-1ubuntu4.1 armhf [installed]
overlayroot/xenial,now 0.27ubuntu1 all [installed]
parted/xenial,now 3.2-15 armhf [installed]
passwd/xenial,now 1:4.2-3.1ubuntu5 armhf [installed]
pastebinit/xenial,now 1.5-1 all [installed]
patch/xenial,now 2.7.5-1 armhf [installed]
pciutils/xenial,now 1:3.3.1-1.1ubuntu1 armhf [installed]
perl/xenial,now 5.22.1-9 armhf [installed]
perl-base/xenial,now 5.22.1-9 armhf [installed]
perl-modules-5.22/xenial,now 5.22.1-9 all [installed]
plymouth/xenial,now 0.9.2-3ubuntu13 armhf [installed]
plymouth-theme-ubuntu-text/xenial,now 0.9.2-3ubuntu13 armhf [installed]
policykit-1/xenial,now 0.105-14.1 armhf [installed]
pollinate/xenial,now 4.15-0ubuntu1 all [installed]
popularity-contest/xenial,now 1.64ubuntu2 all [installed]
powermgmt-base/xenial,now 1.31+nmu1 all [installed]
procps/xenial,now 2:3.3.10-4ubuntu2 armhf [installed]
psmisc/xenial,now 22.21-2.1build1 armhf [installed]
python-apt-common/xenial,now 1.1.0~beta1build1 all [installed]
python3/xenial,now 3.5.1-3 armhf [installed]
python3-apport/xenial,now 2.20.1-0ubuntu2 all [installed]
python3-apt/xenial,now 1.1.0~beta1build1 armhf [installed]
python3-blinker/xenial,now 1.3.dfsg2-1build1 all [installed]
python3-cffi-backend/xenial,now 1.5.2-1ubuntu1 armhf [installed]
python3-chardet/xenial,now 2.3.0-2 all [installed]
python3-commandnotfound/xenial,now 0.3ubuntu16.04 all [installed]
python3-configobj/xenial,now 5.0.6-2 all [installed]
python3-cryptography/xenial,now 1.2.3-1 armhf [installed]
python3-dbus/xenial,now 1.2.0-3 armhf [installed]
python3-debian/xenial,now 0.1.27ubuntu2 all [installed]
python3-distupgrade/xenial-updates,now 1:16.04.14 all [installed]
python3-gdbm/xenial,now 3.5.1-1 armhf [installed]
python3-gi/xenial,now 3.20.0-0ubuntu1 armhf [installed]
python3-idna/xenial,now 2.0-3 all [installed]
python3-jinja2/xenial,now 2.8-1 all [installed]
python3-json-pointer/xenial,now 1.9-3 all [installed]
python3-jsonpatch/xenial,now 1.19-3 all [installed]
python3-jwt/xenial,now 1.3.0-1 all [installed]
python3-markupsafe/xenial,now 0.23-2build2 armhf [installed]
python3-minimal/xenial,now 3.5.1-3 armhf [installed]
python3-newt/xenial,now 0.52.18-1ubuntu2 armhf [installed]
python3-oauthlib/xenial,now 1.0.3-1 all [installed]
python3-pkg-resources/xenial,now 20.7.0-1 all [installed]
python3-prettytable/xenial,now 0.7.2-3 all [installed]
python3-problem-report/xenial,now 2.20.1-0ubuntu2 all [installed]
python3-pyasn1/xenial,now 0.1.9-1 all [installed]
python3-pycurl/xenial,now 7.43.0-1ubuntu1 armhf [installed]
python3-requests/xenial,now 2.9.1-3 all [installed]
python3-serial/xenial,now 3.0.1-1 all [installed]
python3-six/xenial,now 1.10.0-3 all [installed]
python3-software-properties/xenial,now 0.96.20 all [installed]
python3-systemd/xenial,now 231-2build1 armhf [installed]
python3-update-manager/xenial,now 1:16.04.3 all [installed]
python3-urllib3/xenial,now 1.13.1-2 all [installed]
python3-yaml/xenial,now 3.11-3build1 armhf [installed]
python3.5/xenial,now 3.5.1-10 armhf [installed]
python3.5-minimal/xenial,now 3.5.1-10 armhf [installed]
readline-common/xenial,now 6.3-8ubuntu2 all [installed]
rename/xenial,now 0.20-4 all [installed]
resolvconf/xenial,now 1.78ubuntu2 all [installed]
rsync/xenial,now 3.1.1-3ubuntu1 armhf [installed]
rsyslog/xenial,now 8.16.0-1ubuntu3 armhf [installed]
run-one/xenial,now 1.17-0ubuntu1 all [installed]
screen/xenial,now 4.3.1-2build1 armhf [installed]
sed/xenial,now 4.2.2-7 armhf [installed]
sensible-utils/xenial,now 0.0.9 all [installed]
sgml-base/xenial,now 1.26+nmu4ubuntu1 all [installed]
shared-mime-info/xenial,now 1.5-2 armhf [installed]
snapd/xenial,now 2.0.2 armhf [installed]
software-properties-common/xenial,now 0.96.20 all [installed]
sosreport/xenial,now 3.2+git276-g7da50d6-3ubuntu1 armhf [installed]
squashfs-tools/xenial,now 1:4.3-3ubuntu2 armhf [installed]
ssh-import-id/xenial,now 5.5-0ubuntu1 all [installed]
strace/xenial,now 4.11-1ubuntu3 armhf [installed]
sudo/xenial,now 1.8.16-0ubuntu1 armhf [installed]
systemd/xenial,now 229-4ubuntu4 armhf [installed]
systemd-sysv/xenial,now 229-4ubuntu4 armhf [installed]
sysv-rc/xenial,now 2.88dsf-59.3ubuntu2 all [installed]
sysvinit-utils/xenial,now 2.88dsf-59.3ubuntu2 armhf [installed]
tar/xenial,now 1.28-2.1 armhf [installed]
tcpd/xenial,now 7.6.q-25 armhf [installed]
tcpdump/xenial,now 4.7.4-1ubuntu1 armhf [installed]
telnet/xenial,now 0.17-40 armhf [installed]
time/xenial,now 1.7-25.1 armhf [installed]
tmux/xenial,now 2.1-3build1 armhf [installed]
tzdata/xenial,now 2016d-0ubuntu0.16.04 all [installed]
u-boot-rpi/xenial,now 2016.05~rc3+dfsg1-1rpi3.1 armhf [installed]
u-boot-tools/xenial,now 2016.05~rc3+dfsg1-1rpi3.1 armhf [installed]
ubuntu-cloudimage-keyring/xenial,now 2013.11.11 all [installed]
ubuntu-core-launcher/xenial-updates,xenial-security,now armhf [installed]
ubuntu-keyring/xenial,now 2012.05.19 all [installed]
ubuntu-minimal/xenial,now 1.361 armhf [installed]
ubuntu-release-upgrader-core/xenial-updates,now 1:16.04.14 all [installed]
ubuntu-server/xenial,now 1.361 armhf [installed]
ubuntu-standard/xenial,now 1.361 armhf [installed]
ucf/xenial,now 3.0036 all [installed]
udev/xenial,now 229-4ubuntu4 armhf [installed]
ufw/xenial,now 0.35-0ubuntu2 all [installed]
uidmap/xenial,now 1:4.2-3.1ubuntu5 armhf [installed]
unattended-upgrades/xenial,now 0.90 all [installed]
update-manager-core/xenial,now 1:16.04.3 all [installed]
update-notifier-common/xenial,now 3.168 all [installed]
ureadahead/xenial,now 0.100.0-19 armhf [installed]
usbutils/xenial,now 1:007-4 armhf [installed]
util-linux/xenial,now 2.27.1-6ubuntu3 armhf [installed]
uuid-runtime/xenial,now 2.27.1-6ubuntu3 armhf [installed]
vim/xenial,now 2:7.4.1689-3ubuntu1 armhf [installed]
vim-common/xenial,now 2:7.4.1689-3ubuntu1 armhf [installed]
vim-runtime/xenial,now 2:7.4.1689-3ubuntu1 all [installed]
vim-tiny/xenial,now 2:7.4.1689-3ubuntu1 armhf [installed]
vlan/xenial,now 1.9-3.2ubuntu1 armhf [installed]
wget/xenial,now 1.17.1-1ubuntu1 armhf [installed]
whiptail/xenial,now 0.52.18-1ubuntu2 armhf [installed]
xauth/xenial,now 1:1.0.9-1ubuntu2 armhf [installed]
xdg-user-dirs/xenial,now 0.15-2ubuntu6 armhf [installed]
xfsprogs/xenial,now 4.3.0+nmu1ubuntu1 armhf [installed]
xkb-data/xenial,now 2.16-1ubuntu1 all [installed]
xml-core/xenial,now 0.13+nmu2 all [installed]
xz-utils/xenial,now 5.1.1alpha+20120614-2ubuntu2 armhf [installed]
zlib1g/xenial,now 1:1.2.8.dfsg-2ubuntu4 armhf [installed]

Checking if Python 3 is installed on the Ubuntu Classic Server 16.04

Since most of my MVPs are based on Python 3, I also checked whether Python 3 was preinstalled. To do so, I typed in the following command:

python --version

Which gave me the following output:

The program 'python' can be found in the following packages:
 * python-minimal
 * python3
Try: sudo apt install <selected package>

I then typed the following command to check for the python3 binary:

python3 --version

Which replied me with Python 3.5.1+.

This meant that I already had the Python 3 executable in the system and I can use the python3 binary to run my Python 3 applications. If I need to run applications written in Python 2, I would install python-minimal by issuing the following command:

sudo apt install python-minimal

Installing Python 3 package manager (pip3) on Ubuntu Classic Server 16.04

The Python 3 Package Manager was not installed by default. Since my Python 3 applications tend to use other Python 3 packages as well, I should install the Python 3 Package Manager to manage my Python 3 dependencies. To install the Python 3 Package Manager, I typed the following command:

sudo apt install python3-pip

Setting locales for to solve Python 3 Package Manager (pip3) locale.Error: unsupported locale setting

After python3-pip was installed successfully, I proceeded to test it with the following command:

pip3 list

However, I was greeted with the following error:

Traceback (most recent call last):
  File "/usr/bin/pip3", line 11, in <module>
  File "/usr/lib/python3/dist-packages/pip/", line 215, in main
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib/python3.5/", line 595, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

To solve the error, I proceed to reconfigure the locales to one that is suitable for pip3. To do so, I typed in the following commands:

export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
sudo dpkg-reconfigure locales
sudo localedef -i en_US -c -f UTF-8 en_US.UTF-8

I also opened up /etc/default/locale with nano:

sudo nano /etc/default/locale

And updated the contents to look like the following:


After the locales were reconfigured, I could run pip3 list which showed the list of Python 3 packages that are available:

blinker (1.3)
chardet (2.3.0)
cloud-init (0.7.7)
command-not-found (0.3)
configobj (5.0.6)
cryptography (1.2.3)
idna (2.0)
Jinja2 (2.8)
jsonpatch (1.10)
jsonpointer (1.9)
language-selector (0.1)
MarkupSafe (0.23)
oauthlib (1.0.3)
pip (8.1.1)
prettytable (0.7.2)
pyasn1 (0.1.9)
pycurl (7.43.0)
pygobject (3.20.0)
PyJWT (1.3.0)
pyserial (3.0.1)
python-apt (1.1.0b1)
python-debian (0.1.27)
python-systemd (231)
PyYAML (3.11)
requests (2.9.1)
setuptools (20.7.0)
six (1.10.0)
ssh-import-id (5.5)
ufw (0.35)
unattended-upgrades (0.1)
urllib3 (1.13.1)
wheel (0.29.0)

Installing Virtualenv on Ubuntu Classic Server 16.04

Since I anticipate running different Python 3 applications on my Raspberry Pi 3, it would be useful to have a tool create isolated Python 3 runtime environment for each Python 3 application. Virtualenv is one tool that allows us to created isolated environments for running Python 3 applications on the same server to eliminate any potential dependency conflicts.

To install Virtualenv on my Ubuntu Classic Server 16.04, I ran the following command:

sudo apt install virtualenv

Solving "sudo: unable to resolve host ubuntu"

When I tried to run sudo chown on a folder, I was shown the following error:

sudo: unable to resolve host ubuntu

To solve this error, I used nano to open /etc/hosts:

sudo nano /etc/hosts

And added the following line of code: ubuntu

After I saved the file, I was able to run sudo chown command.

Buying the recommended hardware list to build your own Ubuntu Classic Server 16.04 on Raspberry Pi 3

If you do not have the Raspberry Pi 3 hardware mentioned in this post yet, you may want to purchase them from Amazon. Simply click on the button below to add the Raspberry Pi 3 hardware to your cart. You may remove anything that you already have or replace some of the hardware with other hardware.

About Clivant

Clivant a.k.a Chai Heng enjoys composing software and building systems to serve people. He owns and hopes that whatever he had written and built so far had benefited people. All views expressed belongs to him and are not representative of the company that he works/worked for.