Upgrade Ubuntu 16.04 to 18.04

Posted: 2018-10-20 | Updated: 2020-08-25 | Read Time: 7 minute(s)

Summary

This tutorial shows you how to upgrade an existing Ubuntu 16.04 installation to Ubuntu 18.04 using the terminal or command line.

Commands Used

The commands seen in the video are below. The commands can be copy and pasted directly into the terminal window.

lsb_release -a
sudo apt-get update && sudo apt-get upgrade -y
sudo do-release-upgrade 

After the reboot has completed, then run

sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get autoremove --purge

Video

Tutorial on how to set up Etckeeper (Git versioning) for backups of the /etc directory is at https://youtu.be/dPm8cazYy00.

Full sequence of the Ubuntu 18.04 upgrade can be viewed at https://youtu.be/juY3pZPVSNw.

If you have comments or questions about the video, please leave them on the video's YouTube page.

Video Transcript

COMING UP I'M GOING TO SHOW YOU HOW TO UPGRADE YOUR ABOUT TO 1604 LTS SERVER ADDITION TO A BUN TO 18.04 LTS SERVER ADDITION EVERY TWO YEARS UBUNTU RELEASES AN LTS OR LONG TERM SUPPORT ADDITION OF THEIR OPERATING SYSTEM THE LTS ADDITIONS ARE SUPPORTED FOR UP TO FIVE YEARS AFTER THEIR RELEASE THIS IS BENEFICIAL AS A BUN TO OS HAS AN UPDATE EVERY SIX MONTHS WHICH OCCURS IN APRIL AND OCTOBER THE FINAL VERSION OF UBUNTU 18.04 WAS RELEASED ON APRIL 28 2018 TODAY I'M GOING TO UPGRADE MY DEVELOPMENT SERVER TO THE 1804 VERSION THE COMMANDS THAT ARE USED IN THIS VIDEO WILL BE AVAILABLE IN THE DESCRIPTION BELOW IT WILL ALSO BE AVAILABLE AS A SHELL SCRIPT FROM A GITHUB REPOSITORY THE LINK TO THE REPOSITORY WILL ALSO BE IN THE DESCRIPTION BELOW TO BEGIN YOU'LL NEED TO OPEN A TERMINAL WINDOW AND SINCE I'M RUNNING THIS FROM A VIRTUAL MACHINE I AM GOING TO USE THE TERMINAL WINDOW THAT IS CONNECTED TO THAT VIRTUAL MACHINE AND SO THE FIRST COMMAND I'M GOING TO RUN IS LSB UNDERSCORE RELEASE - A AND THAT WILL SHOW THAT I AM RUNNING UBUNTU AND THAT I AM RUNNING THE 16.04 RELEASE OF THE OPERATING SYSTEM NEXT I'M GOING TO UPGRADE THE OS - AND HIS PACKAGES TO THE LATEST VERSION TO MAKE SURE THAT WE HAVE ANY LAST-MINUTE CHANGES THAT MAY NEED TO BE DONE ARE ALSO PULLED IN SO TO DO THAT I'M GOING TO RUN SUDO APT-GET UPDATE AND THEN SUDO APT-GET UPGRADE AS ONE COMMAND WITH THE DASH Y OPTION AFTER UPGRADE AND IF PROMPTED ENTER YOUR PASSWORD FOR SUDO AND NOW THAT THAT HAS COMPLETED YOU WANT TO MAKE SURE THAT YOU'RE ALSO USING A CONFIGURATION MANAGEMENT SYSTEM SUCH AS GIT OR EVEN SUBVERSION THAT WAY IF YOU HAVE AN ISSUE WITH YOUR CONFIGURATION FILES YOU CAN RESTORE THOSE FILES BACK TO THE SYSTEM AND THEN REBOOT YOUR SYSTEM IF YOU DON'T HAVE THOSE CONFIGURATION FILES YOU'LL END UP HAVING TO REINSTALL THE OS FROM SCRATCH AND SET UP EVERYTHING ELSE FROM SCRATCH I HAVE ANOTHER TUTORIAL THAT SHOWS YOU HOW TO SET UP THE SC DIRECTORY AS WELL AS ANY OTHER DIRECTORY WITH GIT OR ANY OTHER VERSIONING SOFTWARE TO CONTINUE ON THE NEXT YOU'LL NEED TO RUN THE UPGRADE COMMAND WHICH IS SUDO DO - RELEASE - UPGRADE AND IT WILL GO AND CHECK FOR THE LATEST ABUN TO RELEASE US AVAILABLE TO BE DOWNLOAD AND THEN IT WILL DOWNLOAD THAT VERSION YOU ALSO MAKE SURE THAT YOU HAVE A STABLE INTERNET CONNECTION IF YOU DON'T HAVE A STABLE IN CONNECTION THE INSTALL OR UPGRADE WILL FAIL THIS WILL TAKE SOME TIME TO COMPLETE IF THERE ARE ANY CONFLICTS WITH THE CONFIGURATION FILES THAT YOU HAVE IN PLACE THE SYSTEM WILL MANUALLY PROMPT YOU FOR HOW TO RESOLVE THOSE AFTER THE UPDATE HAS COMPLETED YOU'LL NEED TO RESTART YOUR COMPUTER IF IT DOES NOT AUTOMATICALLY RESTART WANTS TO COME BACK ONLINE CHECK THAT YOU HAVE THE LATEST OS INSTALLED BY RERUNNING THE COMMAND SO I HAVE SOME ADDITIONAL PACKAGES INSTALLED OF MY SYSTEM IN PARTICULAR WEBMIN IS ONE OF THOSE ADDITIONAL PACKAGES THAT IS FINDING THE SOURCE LIST AND IT WON'T CONTINUE UNLESS I GIVE IT PERMISSION TO DO SO SINCE IT'S ASKING FOR CONFIRMATION SO I'M JUST GOING TO GO AHEAD AND HIT ENTER SO THEY CAN CONTINUE ON AS YOU SEE HERE I'VE REACHED A PROMPT WHERE IT HAS CHECKED ALL THE PACKAGES THAT ARE CURRENTLY INSTALLED ON A SYSTEM AND THE NEW PACKAGES THAT WILL NEED TO BE INSTALLED AS PART OF THE UPGRADE AS YOU SEE SAYS THERE ARE THREE POCKETS THAT ARE NO LONGER POOR TIT SO THOSE WILL BE PROBABLY BE REMOVED THERE ARE FIVE PACKAGES THAT ARE CLEARLY GOING TO BE REMOVED 147 PACKAGES THAT WILL BE INSTALLED AND 555 PACKAGES THAT WILL BE AN UPGRADED THERE WILL BE A DOWNLOAD TOTAL OF FOUR HUNDRED AND EIGHT MEGABYTES THIS DOWNLOAD WILL TAKE ABOUT 51 MINUTES BASED ON A ONE MEGABYTE DSL CONNECTION AND ABOUT FIVE HOURS WITH THE 56K MODEM I CURRENTLY HAVE A 100 MEGABIT CONNECTION SO BASED UPON THIS CALCULATION THAT IT HAS ALREADY DONE THAT SHOULD TAKE APPROXIMATELY FIVE MINUTES AS IT STATES THIS PROCESS CAN TAKE SEVERAL HOURS HOWEVER ONCE IT'S DONE IT IS DONE SO I'M GOING TO GO AHEAD AND CONTINUE BY ENTERING IN Y AND PRESSING ENTER AND I WAS SHORTENED THE SEQUENCE OF THIS ALTHOUGH THE FULL SEQUENCE WILL BE POSTED IN ANOTHER VIDEO NOW THAT THE UPGRADE TO ABOUT TEEN 18.04 HAS COMPLETED WE WILL LOG BACK IN AND AS YOU SEE ON THE LOGIN SCREEN IT ACTUALLY MENTIONS THAT THIS IS THE 18.04 VERSION SO YOU LOG IN WITH YOUR SAME CREDENTIALS THAT YOU USED BEFORE AND WASH YOU DO GET LOGGED BACK INTO THE SYSTEM YOU'LL WANT TO RUN SUDO APT-GET UPDATE SUDO APT-GET UPGRADE WITH DASH Y AT THE END AND I KNOW YOU'RE THINKING WHY AM I UPGRADING THE SYSTEM WHEN I JUST INSTALLED THE LATEST VERSION OF THE OS THAT'S BECAUSE A LOT OF TIMES WHEN THEY PACKAGE THE OS THAT THE LATEST VERSION OF THE PACKAGES ARE NOT INCLUDED IN THAT LATEST RELEASE CODE VERSION SO AFTER YOU DO THE INSTALLATION OF THE OPERATING SYSTEM YOU'LL NEED TO MAKE SURE YOU GO BACK TO GET THOSE PACKAGE UPDATES AS WELL THAT HAVE BEEN RELEASED SINCE THE LATEST VERSION OF THE OPERATING SYSTEM AND AS YOU SEE IT'S PROMPTING THAT I HAVE A PACKAGE THAT IT'S NO LONGER NEEDED AND SO I CAN REMOVE THAT AS WELL SO I CAN USE SUDO APT-GET AUTO REMOVE NOW USE THE PURGE OPTION AND THEN I USE PHP CONSOLE - TABLE AND I DON'T USE THAT'S WHY ON THIS ONE AND SOMETIMES WHEN YOU REMOVE ONE PACKAGE IT WILL HAVE A BUNCH OF DEPENDENCIES THAT WILL ALSO BE REMOVED AND IF YOU USE THE - Y OPTION IT WILL REMOVE THOSE WITHOUT PROMPTING SINCE THIS IS THE ONLY PACKAGE THAT IS GOING TO REMOVE I'LL GO AHEAD AND GO CONTINUE ALRIGHT NEXT I'M GOING TO GO TO MY ETSY DIRECTORY AND SINCE I HAVE THE CONFIGURATION MANAGEMENT MAINTAINED ON THIS PARTICULAR SERVER I'M GOING TO RUN GET STATUS ON HERE AND SINCE THE ETSY DIRECTORY IS OWNED BY ROOT I HAVE TO USE THE SUDO COMMAND IN FRONT OF THE GET STATUS AND SO IT SAYS ITS UPDATE WITH THE LATEST VERSION HOWEVER I'M NOT FULLY SURE ABOUT THAT SO I'M GOING TO GO AHEAD AND SWITCH THIS WITH THE ROOT USER BY USING SUDO SU AND THEN OUR AND GET STATUS AGAIN AND IT SAYS IT IS UPDATED WITH THE LATEST VERSION SO I WILL DO GIT ADD AND IN PERIOD AND THAT WILL ADD ANY NEW FILES IN HERE AND WILL ALSO ADD ANY EXISTING FILES THEN I WILL RUN GIT STATUS AND THERE ARE NO NEW FILES THIS COMPLETES THE UPGRADE TO ABOUT TEAM 18.04 AND IF YOU WANT TO DO ONE MORE CONFIRMATION YOU CAN DO THE LSB RELEASE - A YOU CAN SEE HERE THAT THE RELEASE IS 18.04 WITH THE CODENAME OF BIOTIC IF THIS TUTORIAL HAS HELPED YOU PLEASE GIVE IT A THUMBS UP IF YOU HAVE ANY QUESTIONS ABOUT ANYTHING IN THIS VIDEO PLEASE DROP THEM IN THE COMMENT SECTION BELOW ALSO PLEASE FOLLOW ME ON INSTAGRAM AND TWITTER AT ALMOST ENGR DON'T FORGET TO SUBSCRIBE TO THE CHANNEL ALSO IF YOU LIKE INSTANT NOTIFICATIONS CLICK THE BELL

Published: 2018-10-20
Updated: 2020-08-25
Author: Kenny Robinson, @almostengr
Category: Technology
Keywords: ubuntu, upgrade ubuntu, do-release-upgrade, lsb_release, linux upgrade, debian upgrade
Video URL: https://youtu.be/p08ZK-QrRmE
Read Time: 7 minute(s)