Upgrade NanoPi-A64 to Latest Version of Ubuntu

 

NanoPi A64

I recently purchased a NanoPI-A64 so that I could try out a Raspberry Pi alternative. The NanoPI caught my eye as it comes with Gigabit LAN, something dearly missed on the Raspberry Pi. Installation was easy enough, download the Linux image, apply to a compatible microSD card and boot up.

 

 

The only issue was that the image they supply is based on Ubuntu 15.10 (Wily Werewolf) which is now end of life. No problems, easy enough to upgrade right? Not quite, well maybe just for the uninitiated like me. I spent hours trawling the internet for the solution and after a while managed to snip together a set of steps that worked for me. So, to save the next newbie some time, I’ve documented it below.

Upgrading NanoPI-A64 from Wily – The Problem

When trying to update the OS with apt-get update, you will get a bunch of errors like:

Err http://ports.ubuntu.com wily-security/universe arm64 Packages
  404  Not Found [IP: 91.189.88.150 80]
Err http://ports.ubuntu.com wily-security/multiverse arm64 Packages
  404  Not Found [IP: 91.189.88.150 80]
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/wily/main/source/Sources  404  Not Found [IP: 91.189.88.150 80]

W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/wily/restricted/source/Sources  404  Not Found [IP: 91.189.88.150 80]

This is because Ubuntu 15.10 has reached end of life and the associated source files have been moved to the archive site. In order to access the old files, we need to update /etc/apt/sources.list to point to the old-releases site. See the examples below.

Original sources.list

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.

deb http://ports.ubuntu.com/ubuntu-ports/ wily main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ wily main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://ports.ubuntu.com/ubuntu-ports/ wily-updates main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-updates main restricted

## Uncomment the following two lines to add software from the 'universe'
## repository.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://ports.ubuntu.com/ubuntu-ports/ wily universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ wily universe
deb http://ports.ubuntu.com/ubuntu-ports/ wily-updates universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-updates universe

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://ports.ubuntu.com/ubuntu-ports/ wily-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-backports main restricted

deb http://ports.ubuntu.com/ubuntu-ports/ wily-security main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-security main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ wily-security universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-security universe
deb http://ports.ubuntu.com/ubuntu-ports/ wily-security multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-security multiverse

Updated sources.list

###### Ubuntu Main Repos
deb http://old-releases.ubuntu.com/ubuntu/ wily main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ wily main restricted universe multiverse

###### Ubuntu Update Repos
deb http://old-releases.ubuntu.com/ubuntu/ wily-security main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ wily-updates main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ wily-security main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ wily-updates main restricted universe multiverse



I removed the others as I didn’t need them for this exercise. With the updated sources.list, I gave it another try:

[email protected]:/etc/apt# apt-get update
Hit http://old-releases.ubuntu.com wily InRelease
Hit http://old-releases.ubuntu.com wily-security InRelease
Hit http://old-releases.ubuntu.com wily-updates InRelease
Get:1 http://old-releases.ubuntu.com wily/main arm64 Packages [1362 kB]
Get:2 http://old-releases.ubuntu.com wily/restricted arm64 Packages [28 B]
Get:3 http://old-releases.ubuntu.com wily/universe arm64 Packages [6488 kB]
Get:4 http://old-releases.ubuntu.com wily/multiverse arm64 Packages [115 kB]
Get:5 http://old-releases.ubuntu.com wily/main Translation-en [839 kB]
Get:6 http://old-releases.ubuntu.com wily/multiverse Translation-en [107 kB]
Get:7 http://old-releases.ubuntu.com wily/restricted Translation-en [4296 B]
Get:8 http://old-releases.ubuntu.com wily/universe Translation-en [4579 kB]
Hit http://old-releases.ubuntu.com wily/main Sources
Hit http://old-releases.ubuntu.com wily/restricted Sources
Hit http://old-releases.ubuntu.com wily/universe Sources
Hit http://old-releases.ubuntu.com wily/multiverse Sources
Hit http://old-releases.ubuntu.com wily-security/main Sources
Hit http://old-releases.ubuntu.com wily-security/restricted Sources
Hit http://old-releases.ubuntu.com wily-security/universe Sources
Hit http://old-releases.ubuntu.com wily-security/multiverse Sources
Hit http://old-releases.ubuntu.com wily-security/main arm64 Packages
Hit http://old-releases.ubuntu.com wily-security/restricted arm64 Packages
Hit http://old-releases.ubuntu.com wily-security/universe arm64 Packages
Hit http://old-releases.ubuntu.com wily-security/multiverse arm64 Packages
Hit http://old-releases.ubuntu.com wily-security/main Translation-en
Hit http://old-releases.ubuntu.com wily-security/multiverse Translation-en
Hit http://old-releases.ubuntu.com wily-security/restricted Translation-en
Hit http://old-releases.ubuntu.com wily-security/universe Translation-en
Hit http://old-releases.ubuntu.com wily-updates/main Sources
Hit http://old-releases.ubuntu.com wily-updates/restricted Sources
Hit http://old-releases.ubuntu.com wily-updates/universe Sources
Hit http://old-releases.ubuntu.com wily-updates/multiverse Sources
Hit http://old-releases.ubuntu.com wily-updates/main arm64 Packages
Hit http://old-releases.ubuntu.com wily-updates/restricted arm64 Packages
Hit http://old-releases.ubuntu.com wily-updates/universe arm64 Packages
Hit http://old-releases.ubuntu.com wily-updates/multiverse arm64 Packages
Hit http://old-releases.ubuntu.com wily-updates/main Translation-en
Hit http://old-releases.ubuntu.com wily-updates/multiverse Translation-en
Hit http://old-releases.ubuntu.com wily-updates/restricted Translation-en
Hit http://old-releases.ubuntu.com wily-updates/universe Translation-en
Fetched 13.5 MB in 55s (244 kB/s)
Reading package lists... Done

So far so good, no errors and we progressed further than before. With the package lists and dependencies refreshed, time to baseline our 15.10 installation.

[email protected]:/etc/apt# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
apt dh-python dpkg init initscripts libapt-pkg4.16 libc-bin libgcrypt20 libpam-modules libpam-modules-bin libpam-runtime libpam0g libpcre3 libsystemd0 libudev1 linux-libc-dev
multiarch-support systemd systemd-sysv sysv-rc sysvinit-utils tzdata udev
23 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 10.5 MB of archives.
After this operation, 17.4 kB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://old-releases.ubuntu.com/ubuntu/ wily-security/main dpkg arm64 1.18.2ubuntu5.1 [2044 kB]
Get:2 http://old-releases.ubuntu.com/ubuntu/ wily-updates/main init arm64 1.23ubuntu4 [3974 B]
Get:3 http://old-releases.ubuntu.com/ubuntu/ wily-updates/main libapt-pkg4.16 arm64 1.0.10.2ubuntu3 [589 kB]
Get:4 http://old-releases.ubuntu.com/ubuntu/ wily-updates/main apt arm64 1.0.10.2ubuntu3 [958 kB]
Get:5 http://old-releases.ubuntu.com/ubuntu/ wily-security/main libc-bin arm64 2.21-0ubuntu4.3 [1032 kB]
Get:6 http://old-releases.ubuntu.com/ubuntu/ wily-security/main libpam0g arm64 1.1.8-3.1ubuntu3.2 [50.8 kB]
Get:7 http://old-releases.ubuntu.com/ubuntu/ wily-security/main libpam-modules-bin arm64 1.1.8-3.1ubuntu3.2 [33.5 kB]
Get:8 http://old-releases.ubuntu.com/ubuntu/ wily-security/main libpam-modules arm64 1.1.8-3.1ubuntu3.2 [223 kB]
Get:9 http://old-releases.ubuntu.com/ubuntu/ wily-updates/main libpcre3 arm64 2:8.35-7.1ubuntu1.4 [194 kB]
Get:10 http://old-releases.ubuntu.com/ubuntu/ wily-updates/main libudev1 arm64 225-1ubuntu9.1 [45.0 kB]
Get:11 http://old-releases.ubuntu.com/ubuntu/ wily-updates/main udev arm64 225-1ubuntu9.1 [917 kB]
Get:12 http://old-releases.ubuntu.com/ubuntu/ wily-updates/main sysvinit-utils arm64 2.88dsf-59.2ubuntu2.1 [25.2 kB]
Get:13 http://old-releases.ubuntu.com/ubuntu/ wily-updates/main sysv-rc all 2.88dsf-59.2ubuntu2.1 [36.1 kB]
Get:14 http://old-releases.ubuntu.com/ubuntu/ wily-updates/main libsystemd0 arm64 225-1ubuntu9.1 [160 kB]
Get:15 http://old-releases.ubuntu.com/ubuntu/ wily-updates/main systemd arm64 225-1ubuntu9.1 [2760 kB]
Get:16 http://old-releases.ubuntu.com/ubuntu/ wily-updates/main systemd-sysv arm64 225-1ubuntu9.1 [13.0 kB]
Get:17 http://old-releases.ubuntu.com/ubuntu/ wily-updates/main initscripts arm64 2.88dsf-59.2ubuntu2.1 [24.8 kB]
Get:18 http://old-releases.ubuntu.com/ubuntu/ wily-security/main libgcrypt20 arm64 1.6.3-2ubuntu1.1 [270 kB]
Get:19 http://old-releases.ubuntu.com/ubuntu/ wily-security/main libpam-runtime all 1.1.8-3.1ubuntu3.2 [37.8 kB]
Get:20 http://old-releases.ubuntu.com/ubuntu/ wily-security/main multiarch-support arm64 2.21-0ubuntu4.3 [7182 B]
Get:21 http://old-releases.ubuntu.com/ubuntu/ wily-security/main tzdata all 2016f-0ubuntu0.15.10 [166 kB]
Get:22 http://old-releases.ubuntu.com/ubuntu/ wily-updates/main dh-python all 2.20150826ubuntu1.1 [69.0 kB]
Get:23 http://old-releases.ubuntu.com/ubuntu/ wily-security/main linux-libc-dev arm64 4.2.0-42.49 [807 kB]
Fetched 10.5 MB in 1min 24s (124 kB/s)

Upgrading to Ubuntu Zesty

Ok, time to do the release upgrade now to the latest version of Ubuntu. You can technically skip the next couple of steps but I have them here for completeness sake and also to show where I went wrong. Before we continue, ensure that you have the following package installed:

apt-get install update-manager-core

Time to upgrade:

[email protected]:/etc/apt# do-release-upgrade
Checking for a new Ubuntu release
Your Ubuntu release is not supported anymore.
For upgrade information, please visit:
http://www.ubuntu.com/releaseendoflife

Get:1 Upgrade tool signature [836 B]
Get:2 Upgrade tool [1265 kB]
Fetched 1266 kB in 0s (0 B/s)
authenticate 'xenial.tar.gz' against 'xenial.tar.gz.gpg'
extracting 'xenial.tar.gz'

Reading cache

Checking package manager

Continue running under SSH?

This session appears to be running under ssh. It is not recommended
to perform a upgrade over ssh currently because in case of failure it
is harder to recover.

If you continue, an additional ssh daemon will be started at port
'1022'.
Do you want to continue?

Continue [yN] y

Starting additional sshd

To make recovery in case of failure easier, an additional sshd will
be started on port '1022'. If anything goes wrong with the running
ssh you can still connect to the additional one.

To continue please press [ENTER]

Reading package lists... Done
Building dependency tree
Reading state information... Done
Hit http://old-releases.ubuntu.com wily InRelease
Hit http://old-releases.ubuntu.com wily-security InRelease
Hit http://old-releases.ubuntu.com wily-updates InRelease

Aaaaaaaah hang on that won’t work for the upgrade ^^^ and sure enough:

Error during update

A problem occurred during the update. This is usually some sort of
network problem, please check your network connection and retry.

W:Failed to fetch
http://archive.ubuntu.com/ubuntu/dists/xenial/main/binary-arm64/Packages
404 Not Found [IP: 91.189.91.26 80]
, W:Failed to fetch

So what’s happened is that with our updated sources.list, we pointed apt to the old distros in order to get the latest Wily files. Now that we need to update to the latest distro version, we will need to update our sources.list so that we can grab the released versions rather than the archived ones.

I wasn’t sure why the upgrade was trying to get Xenial when Zesty is out but I added them both anyway. Our new sources.list now looks like this:

###### Ubuntu Main Repos
# zesty
deb http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted universe multiverse
# Xenial
deb http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted universe multiverse
# Wily
deb http://old-releases.ubuntu.com/ubuntu/ wily main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ wily main restricted universe multiverse

###### Ubuntu Update Repos
# zesty
deb http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse
# Xenial
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
# Wily
deb http://old-releases.ubuntu.com/ubuntu/ wily-security main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu/ wily-updates main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ wily-security main restricted universe multiverse
deb-src http://old-releases.ubuntu.com/ubuntu/ wily-updates main restricted universe multiverse

A reboot and refresh later and we are good as gold:

[email protected]:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 17.04
Release: 17.04
Codename: zesty

Note: The kernel, the essential component in this all, doesn’t get an upgrade and as such, the core board functionality remains unchanged.

As part of the post-upgrade cleanup, I removed the unneeded items from the sources.list leaving only:

###### Ubuntu Main Repos
# zesty
deb http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-backports main restricted universe multiverse

###### Ubuntu Update Repos
# zesty
deb http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-updates main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ zesty-security main restricted universe multiverse

Final Thoughts

So there you have it. A step by step guide to upgrade your NanoPI-A64 to the latest version of Ubuntu. When you write it down, it’s actually pretty easy and straightforward. I hope the above helps to save someone a ton of time trying to do this on their unit.

Now onto the next problem, if anyone has a solution for me, please drop me a note below in the comments:

[email protected]:/mnt# mount -t cifs -o user=meme  //192.168.4.101/Public /mnt/nas
Password for [email protected]//192.168.4.101/Public:  ********
mount error: cifs filesystem not supported by the system
mount error(19): No such device
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

I have both cifs-util and samba installed.

Post Author: Noeneel Sharma

Australian born tech expert, Noeneel, is the founder of the GeekLingo. He has over 20 years of experience in the Information Technology (IT) world. As an Information Technologist, he has a Bachelor in Information Technology, MBA and a Master of Business Process Management. He has professional working experience working across reputable industries including telecommunication, legal, accounting, banking, and most recently electricity. He spends most of his time with his gadgets as he enjoys photography, researching and runs the popular aquatic forum SKF Aquatics. Connect with Noeneel on Google+, Twitter, and Facebook.

Leave a Reply