Ubuntu team recommend upgrading a Server Edition installation by using the do-release-upgrade command. Part of the update-manager-core package, it does not have any graphical dependencies and is installed by default. This page shows how to use the recommended upgrade method for AWS Lightsail box powered by Ubuntu Linux 16.04 LTS.
AWS Lightsail upgrade Ubuntu 16.04 LTS to 18.04 LTS
The procedure to upgrade Ubuntu 16.04 LTS to 18.04 LTS is as follows for AWS Lightsail server:
Step 1. Login to AWS Lightsail box
Use the ssh command:
$ ssh -i ~/path/to/your-key ubuntu@aws-ip-address
Step 2. Update existing system
Type the apt-get command or apt command:
$ sudo apt update
$ sudo apt upgrade
Reboot the Linux box if kernel was updated
$ sudo reboot
After reboot makes sure either UFW firewall is temporarily disabled or TCP port 1022 is open. One could use the TCP port 1022 during upgrade procedure if something went wrong. The following command can verify if any software firewall is working on your system or not:
$ sudo iptables -L -n -v
I have no firewall running on my box. However, if you have a firewall running, open ssh port 1022 using the following ufw syntax:
$ sudo ufw allow 1022/tcp comment 'Temp open port ssh tcp port 1022 for upgrade'
Step 3. How to upgrade to Ubuntu 18.04 LTS using do-release-upgrade
Upgrade the operating system to the latest release from the command-line by typing the following command:
$ sudo do-release-upgrade
Before continuing with the procedure, you must open port TCP port # 1022 for safety reasons if port ssh failed during updates. Login to aws lightsail console, click on the networking tab and open port 1022 as follows:
Now follow on-screen instructions. During upgrade procedure, you may be promoted to replace existing grub or ssh config file. Make sure you choose to keep existing version to avoid problems. After some time you will see “System upgrade is complete” message. Press y to restart your system to load updates kernel and operating system for your cloud server:
Step 4. Verification for AWS Lightsail instance
Login using the ssh command:
$ ssh -i ~/path/to/your-key ubuntu@aws-ip-address
Verify Ubuntu Linux kernel version with uname:
$ uname -r
Make sure all needed ports are open and running with the ss command or netstat command:
$ sudo ss -tulpn
$ sudo netstat -tulpn
Use grep command/egrep command or tail command/cat command to verify log files for errors:
$ dmesg
$ tail -f /path/to/log/files
$ egrep -i 'err|cri' /var/log/nginx/error.log
Step 5. Remove tcp port 1022 added to AWS Lightsail instance/networking
Login to AWS Lightsail, choose networking and edit rules link:
Remove custom TCP 1022 rule and click on the save button/link:
Finally, remove ufw rule if added:
$ sudo ufw delete allow 1022/tcp
Conclusion
And there you have it Ubuntu Linux 16.04 LTS updated to Ubuntu 18.04 LTS running on AWS Lightsail cloud. See this page for more info.
- How to upgrade Ubuntu 16.04 to 18.04 LTS using terminal
- AWS Lightsail upgrade Ubuntu 16.04 LTS to 18.04 LTS
- How Do I Update Ubuntu Linux Softwares Using Command Line?
- HowTo: Upgrade To a Newer Version of Ubuntu 14.04 LTS
- Upgrade Ubuntu 18.04 to 20.04 LTS using command line
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 0 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |