Ubuntu update all packages

Linux and Unix tutorials for new and seasoned sysadmin

Linux and Unix tutorials for new and seasoned sysadmin

Adblock detected 😱
  1. Debian / Ubuntu / Mint Linux and friends try apt-get command.
  2. CentOS / RHEL / Red Hat / Fedora Linux and friends try yum command.
  3. Suse / OpenSUSE Linux use zypper command or graphical tool called YaST online update.
  4. Slackware Linux user try slackpkg command.
  5. Arch Linux user try pacman command.
  6. Gentoo Linux user try emerge command.

apt-get command example to update all packages on the Debian or Ubuntu Linux

$ sudo apt-get update
$ sudo apt-get upgrade
See apt-get command tutorial for more information.

yum command example to update all packages on the RHEL/CentOS/Red Hat/Fedora Linux

# yum update
See yum command tutorial for more information.

zypper command example to update all packages on the OpenSUSE/Suse Linux

# zypper refresh
# zypper update

pacman command example to update all packages on the Arch Linux

# pacman -Syu
# pacman –sync –refresh –sysupgrade
See pacman package manager documentation for more information.

emerge command example to update all packages on the Gentoo Linux

# emerge –sync
# emerge –update –deep –with-bdeps=y @world

See emerge package manager documentation for more information.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Related Tutorials

Your support makes a big difference:

I have a small favor to ask. More people are reading the nixCraft. Many of you block advertising which is your right, and advertising revenues are not sufficient to cover my operating costs. So you can see why I need to ask for your help. The nixCraft takes a lot of my time and hard work to produce. If everyone who reads nixCraft, who likes it, helps fund it, my future would be more secure. You can donate as little as $1 to support nixCraft:

2 comment

thanks a lot
difference between update and upgrade
update= update software and delete Previous file
upgrade= only upgrade software

those are not differences ;
the diffrences are ==>
update => update your repository list of packages .
upgrade => install new version of packages .
if you wanna remove all useless package that installed in your system you should add this option -autoremove

Читайте также:  Буквы для плаката трафарет


The objective is to provide Ubuntu user with an information on how to update Ubuntu packages in order to keep Ubuntu system up to date.

This guide will provide you with instructions on how to update Ubuntu packages from the command line as well as to keep your software packages up to date using the graphical user interface.

Operating System and Software Versions

  • Operating System: – Ubuntu 18.04 Bionic Beaver Linux




  • # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user


Unlike proprietary operating systems, Ubuntu as well as any Linux like operating system come with free of change software updates privilege for every user.

The standard Ubuntu releases are continuously supported for 9 months since the initial release date whereas Ubuntu LTS (long-term support) releases such us Ubuntu 18.04 are supported for duration of five years since the Initial release date ( 26.4.2018 ) for both the desktop and the server. During this time user can automatically or manual apply any security fixes and other critical updates to keep their Ubuntu system updated at all times.

Keeping your system updated will help you protect your computer against vulnerabilities that may be exploited by hackers’ malicious software.

More information about the Ubuntu 18.04 update support cycle is shown below:


Update Ubuntu via Command Line

Despite of the availability of Ubuntu Software Updates via the graphical user interface application, updating the Ubuntu system via the command line is the preferred way to keep you system up to date as it will provide you with more transparency and control.

To begin the Ubuntu update of your system first we need to update the packages index list. Open up terminal and enter: Next, we have the option to list all packages which are scheduled for update: At this stage we have an option to update individual packages using apt install PACKAGE-NAME or install update for all packages at once: All done. Your Ubuntu system is now fully updated.

Kept Back Packages

Due to package dependency changes some of the packages might be kept back.

If this is this case you may now upgrade each kept back package individually using apt install PACKAGE-NAME command or update all kept back packages at once:

Last updated August 4, 2019 By Abhishek Prakash 24 Comments

This tutorial shows you how to update Ubuntu for both the server and desktop versions. It also explains the difference between “update” and “upgrade,” along with a few other things you should know about updates in Ubuntu Linux.

If you are a new user and have been using Ubuntu for a few days or weeks, you might be wondering how to update your Ubuntu system for security patches, bug fixes and application upgrades.

Updating Ubuntu is incredibly simple. I am not exaggerating. It’s as simple as running two commands, or using two mouse clicks.

There are two ways you can update your Ubuntu system:

Let me give you more details. Please note that this tutorial is valid for Ubuntu 18.04, 16.04, or any other version. The command line method is also valid for Ubuntu-based Linux distributions, like Linux Mint, Linux Lite, elementary OS, etc.

Читайте также:  Как отвязать карту от гугл аккаунта

Method 1: Update Ubuntu via the Command Line

On the desktop, open the terminal. You can find it in the menu, or use the Ctrl+Alt+T keyboard shortcut. If you are logged on to an Ubuntu server, you already have access to a terminal.

In the terminal, you just have to use the following command:

It will ask for a password. You can use your account’s password. You won’t see characters on the screen while typing, so keep on typing your password and hit enter. This will update the packages in Ubuntu.

Now let me explain the above command.

It’s actually not a single command, it’s a combination of two commands. The && is a way to combine two commands such that the second command runs only when the previous command ran successfully.

The “-y” in the end automatically enters “yes” when the command “apt upgrade” ask for your confirmation before installing updates.

Note that you can also use the two commands separately, one by one:

It will take a little longer, because you have to wait for one command to finish and then enter the second command.

Explanation: sudo apt update

This command updates the local database of available packages. If you don’t run this command, the local database won’t be updated and your system will not know if there are any new versions of packages available.

This is why, when you run the “sudo apt update” command, you’ll see lots of URLs in the output. The command fetches the package information from the respective repositories (the URLs you see in the output).

At the end of the command, it tells you how many packages can be upgraded. You can see these packages by running the following command:

Explanation: sudo apt upgrade

This command matches the versions of installed packages with the local database. It collects all of them, and then it will list those packages that have a newer version available. At this point, it will ask if you want to upgrade the installed packages to the newer version.

You can type “yes,” or “y,” or just press enter to confirm the installation of updates.

So the bottom line is that “sudo apt update” checks for the availability of new package versions, while “sudo apt upgrade” actually installs the new versions.

The term update might be confusing, as you might expect the “apt update” command to update the system by installing new software, but that’s not how it works.

Method 2: Update Ubuntu via the GUI [For Desktop Users]

If you are using Ubuntu as a desktop, you don’t have to go to the terminal to update the system. You can still use the command line, but it’s optional for you.

In the menu, look for “Software Updater” and run it.

It will check if there are updates available for your system.

If there are updates available, it will give you the option to install the updates.

Click on “Install Now.” It may ask for your password.

Once you enter your password, it will start installing the updates.

In some cases, you may need to reboot your Ubuntu system for the installed updates to work properly. You’ll be notified at the end of the update if you need to restart the system.

Читайте также:  Метеум погода от яндекса

You can choose to restart later if you don’t want to reboot your system straightaway.

Tip: If the software updater returns an error, you should use the command “sudo apt update” in the terminal. The last few lines of the output will contain the actual error message. You can then search on the internet for that error and fix the problem.

A few things to keep in mind about updating Ubuntu

You just learned how to update your Ubuntu system. If you are interested, you should also know these few things relating to Ubuntu updates.

Cleaning up after an update

After an update, your system may have some unnecessary packages that are no longer required. You can remove such packages and free up some space by using this command:

Live patching the kernel in Ubuntu Server to avoid rebooting

In the case of Linux kernel updates, you’ll have to restart the system after the update. This can be a problem if you don’t want downtime for your server.

The live patching feature allows for the patching of the Linux kernel while it is still running. In other words, you don’t have to reboot your system.

If you manage servers, you may want to enable live patching in Ubuntu.

Ubuntu version upgrades are different from package upgrades

The update methods discussed here keep your Ubuntu install fresh and updated. It doesn’t cover OS version upgrades (for example, upgrading Ubuntu 16.04 to 18.04).

Ubuntu version upgrades are an entirely different thing. They involve updating the entire operating system core. You’ll need to make proper backups before starting this lengthy process.


I hope you liked this tutorial on updating the Ubuntu system, and that you learned a few new things.

If you have any questions, please fee free to ask. If you are an experienced Linux user and have some tip that can make this tutorial more useful, please share it with the rest of us.

Like what you read? Please share it with others.

  • Facebook 85
  • Twitter 0
  • LinkedIn 0
  • Reddit 0
  • Pinterest 3

About Abhishek Prakash

I am a professional software developer, and founder of It’s FOSS. I am an avid Linux lover and open source enthusiast. I use Ubuntu and believe in sharing knowledge. Apart from Linux, I love classic detective mysteries. I’m a huge fan of Agatha Christie’s work.

I have elementary and your article is very useful. However, could you please teach how to make just one update on elementary / Ubuntu? in case, for instance, I don’t have time to make all the updates.

Glad you find it useful.

“how to make just one update on elementary / Ubuntu”

There are a few ways to do that.

If you are using the graphical update manager, there is a drop down that shows the available updates. You can deselect the updates that you don’t want.

In terminal, you can see the upgradeable packages using the command ‘apt list –upgradable’ and then, use sudo apt install

for the packages that you want to upgrade. Install commands performs upgrdae for the already installed packages (if there is an updated version available).

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock detector