Linux ubuntu sudo update

What does «sudo apt-get update» do?

In a nutshell, apt-get update doesn’t actually install new versions of software. Instead, it updates the package lists for upgrades for packages that need upgrading, as well as new packages that have just come to the repositories.

    apt-get update downloads the package lists from the repositories and «updates» them to get information on the newest versions of packages and their dependencies. It will do this for all repositories and PPAs. From http://linux.die.net/man/8/apt-get:

Used to re-synchronize the package index files from their sources. The indexes of available packages are fetched from the location(s) specified in /etc/apt/sources.list (5). An update should always be performed before an upgrade or dist-upgrade.

Used to install the newest versions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources.list (5). Packages currently installed with new versions available are retrieved and upgraded; under no circumstances are currently installed packages removed, nor are packages that are not already installed retrieved and installed. New versions of currently installed packages that cannot be upgraded without changing the install status of another package will be left at their current version. [Emphasis mine] An update must be performed first so that apt-get knows that new versions of packages are available.

In addition to performing the function of upgrade, this option also intelligently handles changing dependencies with new versions of packages; apt-get has a «smart» conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones, if necessary. The /etc/apt/sources.list (5) file contains a list of locations from which to retrieve desired package files. See also apt_preferences(5) for a mechanism for over-riding the general settings for individual packages.

You can combine commands with && as follows:

sudo apt-get update && sudo apt-get install foo bar baz foo-dev foo-dbg 

or to get newest versions possible as per version requirements of dependencies:

sudo apt-get update && sudo apt-get dist-upgrade 

You need sudo both times, but since sudo by default doesn’t prompt you within 5 or so minutes since the last sudo operation, you will be prompted for your password only once (or not at all).

Читайте также:  Linux полный размер папки

Источник

How to upgrade

This article details how to upgrade an Ubuntu Server or Ubuntu cloud image to the next release.

Upgrade paths

Ubuntu supports the ability to upgrade from one LTS to the next LTS in sequential order. For example, a user on Ubuntu 16.04 LTS can upgrade to Ubuntu 18.04 LTS, but cannot jump directly to Ubuntu 20.04 LTS. To do this, the user would need to upgrade twice: once to Ubuntu 18.04 LTS, and then upgrade again to Ubuntu 20.04 LTS.

It is recommended that users run an LTS release as it provides 5 years of standard support and security updates. After the initial standard support, an extended support period is available via an Ubuntu Pro subscription.

For a complete list of releases and current support status see the Ubuntu Wiki Releases page.

Upgrade checklist

To ensure a successful upgrade, please review the following items:

  • Check the release notes for the new release for any known issues or important changes. Release notes for each release are found on the Ubuntu Wiki Releases page.
  • Fully update the system. The upgrade process works best when the current system has all the latest updates installed. Users should confirm that these commands complete successfully and that no further updates are available. It is also suggested that users reboot the system after all the updates are applied to verify they are running the latest kernel. To upgrade run the following commands:
sudo apt update sudo apt upgrade 

Upgrade

It is recommended to upgrade the system using the do-release-upgrade command on Server edition and cloud images. This command can handle system configuration changes that are sometimes needed between releases.

do-release-upgrade

To begin the process run the following command:

Upgrading to a development release of Ubuntu is available using the -d flag. However, using the development release (or this flag) is not recommended for production environments.

Upgrades from one LTS to the next LTS release are only available after the first point release. For example, Ubuntu 18.04 LTS will only upgrade to Ubuntu 20.04 LTS after the 20.04.1 point release. If users wish to update before the point release (e.g., on a subset of machines to evaluate the LTS upgrade) users can force the upgrade via the -d flag.

Pre-upgrade summary

Before making any changes the command will first do some checks to verify the system is ready to update. The user will be prompted with a summary of the upgrade before proceeding. If the user accepts the changes, the process will begin to update the system’s packages:

Do you want to start the upgrade? 5 installed packages are no longer supported by Canonical. You can still get support from the community. 4 packages are going to be removed. 117 new packages are going to be installed. 424 packages are going to be upgraded. You have to download a total of 262 M. This download will take about 33 minutes with a 1Mbit DSL connection and about 10 hours with a 56k modem. Fetching and installing the upgrade can take several hours. Once the download has finished, the process cannot be canceled. Continue [yN] Details [d] 

Configuration changes

It is possible during the upgrade process the user gets presented with a message to make decisions about package updates. These prompts occur when there are existing configuration files edited by the user and the new package configuration file are different. Below is an example prompt:

Configuration file '/etc/ssh/ssh_config' ==> Modified (by you or by a script) since installation. ==> Package distributor has shipped an updated version. What would you like to do about it ? Your options are: Y or I : install the package maintainer's version N or O : keep your currently-installed version D : show the differences between the versions Z : start a shell to examine the situation The default action is to keep your current version. *** ssh_config (Y/I/N/O/D/Z) [default=N] ? 

Users should look at the differences between the files and decide what to do. The default response is to keep the current version of the file. There are situations where accepting the new version, like with /boot/grub/menu.lst , is required for the system to boot correctly with the new kernel.

Package removal

After all packages are updated the user will again remove any obsolete, no longer needed, packages:

Remove obsolete packages? 30 packages are going to be removed. Continue [yN] Details [d] 

Reboot

Finally, when the upgrade is complete the user is prompted to reboot the system. The system is not considered upgraded until a reboot occurs:

System upgrade is complete. Restart required To finish the upgrade, a restart is required. If you select 'y' the system will be restarted. Continue [yN] 

Источник

Оцените статью
Adblock
detector