HOW TO UPGRADE THE SERVER TO UBUNTU 04.22

shape image

HOW TO UPGRADE THE SERVER TO UBUNTU 04.22

dawnsears.com - A new long-term support (LTS) release of the Ubuntu operating system, Ubuntu 22.04 (Jammy Jellyfish), was released on April 21, 2022. In this guide, we will tell you how to upgrade older versions of the system to Ubuntu 22.04.

UBUNTU 04.22

Importantly! The process of updating the operating system is always a risk of encountering crashes, losing data or misconfiguring the software. We recommend performing a comprehensive backup in advance and testing everything.

To avoid the problems listed above, we recommend creating a new Ubuntu 22.04 server rather than upgrading an old one. You will probably still have to check for software configuration differences, but the base system will be more stable.

Requirements

To complete the guide, you need an Ubuntu 20.04 system (later versions will also work) and a user with sudo support.

Potential errors

Many systems can be easily updated without major incidents, but it is often safer (and more predictable) to upgrade to a new version by installing a distribution from scratch, configuring services, thoroughly testing everything, and only then transferring programs or user data.

Never upgrade a production system without first verifying that all deployed software and all services are upgradeable in the staging environment. Keep in mind that libraries, languages, and system services may change significantly in a new OS version. Please read the Jammy Jellyfish release notes before upgrading.

1: System backup

Before making major updates to any system, you should make sure that you won't lose data if something goes wrong. The best way to achieve this is to back up the entire current file system. If you don't want to copy the entire file system, make copies of at least the users' home directories, as well as any configuration files and database data.

2: Update current packages

Before starting a full update, it is better to update all packages to the latest versions for security reasons. Start by updating the package list:
sudo apt update

Then update the installed packages to the latest available versions:

sudo apt upgrade

The system will show a list of updates and ask for confirmation. Press y and enter to continue.

This process may take some time. Once it's done, use the dist-upgrade command, which will perform any additional upgrades related to changing dependencies and adding or removing packages as needed. This command will process a set of updates that may be delayed by previous operations:

sudo apt dist-upgrade

Press y when prompted to continue and wait for the process to complete.

You now have the latest Ubuntu packages installed and can use the do-release-upgrade command to upgrade your system to version 22.04.

3: Upgrading Ubuntu using the do-release-upgrade tool

Traditionally, Ubuntu releases were upgraded via an apt file, /etc/apt/sources.list, which lists the package repositories, and then running apt-get dist-upgrade to perform the upgrade itself. While this process is still likely to work, Ubuntu now provides a tool called do-release-upgrade that makes upgrading safer and easier.

do-release-upgrade checks for a new version, updates sources.list, and performs a number of other tasks. This tool is officially recommended for remote server updates.

First, let's run do-release-upgrade without parameters:

sudo do-release-upgrade

If the new version of Ubuntu has not been officially released yet, you will most likely get the following output:

Checking for new Ubuntu release
No new release found

Note that on Ubuntu Server, the new LTS release is not available for the do-release-upgrade command to the first patch, in this case 22.04.1. This usually takes several months after the original release date.

If you don't see an available release, add the -d option to upgrade to a development release:

sudo do-release-upgrade -d

If you are connected to your system via SSH, the system will ask if you want to continue. When working with virtual machines or managed servers, be aware that losing your SSH connection is a risk, especially if you have no other means of remotely connecting to the system console (such as a web console).

Remember, it's safest to make critical updates to systems running on machines to which you have physical access.

Type y and press Enter to continue:

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]

After that, the do-release-upgrade command will tell you to start sshd on port 1022.

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.

If you run a firewall, you may need to temporarily open this port. As

this is potentially dangerous it's not done automatically. You can

open the port with e.g.:

'iptables -I INPUT -p tcp --dport 1022 -j ACCEPT'

To continue please press [ENTER]

Press the Enter key. Next, you may be warned that the mirror record was not found. Most of the time you can just ignore this warning and continue with the update (most likely there is actually a local mirror for 22.04). Enter y: 

Updating repository information

No valid mirror found

While scanning your repository information no mirror entry for the

upgrade was found. This can happen if you run an internal mirror or

if the mirror information is out of date.

Do you want to rewrite your 'sources.list' file anyway? If you choose

'Yes' here it will update all 'focal' to 'jammy' entries.

If you select 'No' the upgrade will cancel.

Continue [yN]


After downloading the new package lists and calculating the changes, the system will ask if you want to start the update. Type y again to continue:


Do you want to start the upgrade?

4 packages are going to be removed. 107 new packages are going to be

installed. 554 packages are going to be upgraded.

You have to download a total of 547 M. This download will take about

1 minute with a 40 Mbit connection and 14 minutes with a 5 Mbit connection

connection.

Using and installing an upgrade can take several hours. Once the

download has finished, the process cannot be canceled.

Continue [yN] Details [d]


You may get a warning about not being able to turn off the lock screen:


Unable to disable lock screen

It is highly recommended that the lock screen be disabled during the

upgrade to prevent later issues. Please ensure your screen lock is

disabled before continuing.


If you are connecting to an Ubuntu server, you can ignore this warning by pressing Enter.


The system will then extract, unpack and install new packages. Even if your system uses a fast connection, it will take some time.


During installation, interactive windows with various questions may appear on the screen. For example, you may be asked if you want to automatically restart services when necessary. And here you can confidently answer Yes. The system may also ask if you want to replace the edited configuration file. This is always a case-by-case situation that requires software-specific knowledge, which is beyond the scope of this guide.


After installing the new packages, you will be asked if you are ready to remove the outdated packages. In a standard system without user configuration, you can simply answer y. If your system has a lot of custom settings, you can type d and check the list of packages to remove (in case it contains something you'll need to reinstall later).


Remove obsolete packages?

53 packages are going to be removed.

Continue [yN] Details [d]


Finally, if everything went well, the system will tell you that the update is complete and a reboot is required. Enter Y to continue:


System upgrade is complete.

Restart required

To complete the upgrade, restart is required.

If you selected 'y' system will be restarted.

Continue [yN]


In your SSH session, you should probably see something like:


Connection to 203.0.113.241 closed by remote host.

Connection to 203.0.113.241 closed.


You may need to press some key to exit the local command line, as your SSH session will be terminated on the server side.


Wait for the server to reboot and then connect again. When you log in, you should see a welcome message confirming that you are on a new version of Ubuntu:


Welcome to Ubuntu 22.04 LTS (GNU/Linux 5.15.0-25-generic x86_64)


Conclusion

You now have a working Ubuntu 22.04 installation. After the upgrade, you will probably need to examine the configurations of the services and deployed applications and make the necessary changes. 

All Post
© Copyright Lowongan Kerja Lampung - Loker Lampung - Loker Cpns

Form WhatsApp

This order requires the WhatsApp application.

Order now