Nội dung
This article will help you to list the packages that can be upgraded with apt in Ubuntu and you can completely upgrade these packages if you want.
I. Introduction
The Ubuntu operating system uses apt
and apt-get
commands to manage packages. Apt
is the next-generation update of the apt-get
command and offers similar features with some useful extras. The apt
command can list upgradeable packages first and upgrade if you want.
II. List packages upgradable with apt on Ubuntu
Step 1: SSH into your Ubuntu server
To list the packages that can be upgraded with apt in Ubuntu, we first need to SSH or access your VPS/server as root. If you don’t know how to SSH into your VPS/Server, you can refer to the following tutorial:
After successfully SSH, we continue with step 2 to perform the command to update the package and repository information on Ubuntu.
Step 2: Update package and repository information
The apt
command uses package repositories to get packages and related information. To get the most up-to-date and latest information about packages, you should update information about packages first.
First, we need to run the following command to connect to the repositories and get the latest information about installed packages:
sudo apt update
Here are the results of the update on my Ubuntu server:
Once the latest information is gathered from the repository, it is compared with the package information currently installed on our Ubuntu server and shows how many packages are available in total.
Step 3: List packages that can be upgraded with apt in Ubuntu
Once we know how many packages are available in total, we need to use the following command to list these packages:
apt list --upgradable
Upgradable packages will be listed with the following information:
passwd/focal-updates 1:4.8.1-1ubuntu5.20.04.1 amd64 [upgradable from: 1:4.8.1-1ubuntu5.20.04]
Note:
- Package name with the update: passwd.
- Latest version: 1:4.8.1-1ubuntu5.20.04.1
- OS Architecture: amd64
- Version being installed (old): 1:4.8.1-1ubuntu5.20.04
Step 4: Upgrade packages on Ubuntu with apt dist-upgrade apt dist-upgrade
After we get the list of updates, let’s upgrade this package with the following command:
sudo apt dist-upgrade -y
Then you wait a moment for the process of updating the packets to complete.
Note: Until the update packages are finished, you absolutely must not turn off the Ubuntu server, shutting down the server during this process may cause system errors.
III. Summary
So with just a few simple steps, you can list the packages that can be upgraded with apt in Ubuntu and proceed to upgrade these packages if you want.
Upgrading the packages on the Ubuntu server in particular and other server operating systems in general will help our system work more stable, have better compatibility and fix some bugs found in earlier versions.
See more useful articles about Ubuntu at the following link:
If you need assistance, you can contact support in the ways below:
- Hotline 247: 028 888 24768 (Ext 0)
- Ticket/Email: You use the email to register for the service and send it directly to support@azdigi.com.