- Introduction
- Before you upgrade
- Backup
- Disable automatic Power Management
- Release Notes
- Upgrade policy
- Upgrading Flash
- Network upgrades
- Desktop / GUI Upgrade
- Server / Command line Upgrade
- The Debian way of upgrading
- Upgrading to development releases
- Desktop / GUI Upgrade
- Server / Command line Upgrade
- See Also
- How to upgrade
- Upgrade paths
- Upgrade checklist
- Upgrade
- do-release-upgrade
- Pre-upgrade summary
- Configuration changes
- Package removal
- Reboot
- Обновление Ubuntu и пакетов сервера
- Оглавление
- Обновление индекса пакетов
- Обновление Ubuntu
- Очистка от остаточных файлов
- Благодарность автору
Introduction
This page is a guide to upgrade supported releases of Ubuntu to other supported releases. For more information please refer to the UpgradeNotes.
To upgrade from unsupported releases of Ubuntu, see EOLUpgrades.
Before you upgrade
Backup
Please make sure you have a backup of your important data. For more on disk cloning, please see here.
Disable automatic Power Management
Ubuntu can be configured to automatically suspend and/or hibernate after a period of user inactivity. If Ubuntu is configured as such, the user starts a release upgrade, and leaves the computer unattended during the upgrade, then Ubuntu stops in the middle of the upgrade. This can causes issues, and in the worst case, cause a corrupt install. Therefore, before upgrading Ubuntu, disable any power management feature until the upgrade process is complete. In Ubuntu with Unity, you find this setting in the System Settings application, inside «Power».
Release Notes
Please read the release notes before upgrading. They contain important information for the task of installing a given release, or upgrading to it. For example, they document high-impact bugs and their workarounds.
Upgrade policy
Check the file /etc/update-manager/release-upgrades. Prompt=normal offers upgrades from any release to a newer release; Prompt=never never offers release upgrades; Prompt=lts only offers upgrades from LTS to LTS. You need root privileges to edit this file.
- On the Update manager, click on Settings.
- Select the Updates Tab
- Where it says Release Upgrade, Show new distribution releases choose Normal Releases or LTS Releases
Upgrading Flash
If you want to upgrade flash, please add the following line to your sources.list:
# Change CODENAME to your release: lsb_release -cs deb http://archive.canonical.com/ubuntu CODENAME partner
This will make sure the adobe-flashplugin package will be upgraded.
Network upgrades
Desktop / GUI Upgrade
- Open the Dash by hitting Super key on your keyboard. This may be done by either clicking the key between Ctrl and Alt that may have a Windows logo, or by clicking the Ubuntu logo in the upper left corner of the screen.
- Type «updater».
- Click the «Software Updater» icon under Applications.
- If a release upgrade is available, the Upgrade button will be active. Click it to begin upgrading.
Server / Command line Upgrade
sudo apt install update-manager-core sudo do-release-upgrade
The Debian way of upgrading
Please be aware that while this method is valid, it is not supported by the Ubuntu developers. The ubuntu-release-upgrader package, which provides do-release-upgrade, is designed to handle quirks and transitions when moving between releases of Ubuntu.
# Upgrade all the packages to the latest versions sudo aptitude update sudo aptitude safe-upgrade # Update our sources, save the original as /etc/apt/sources.list.ORIG # This step is REQUIRED, otherwise the instructions below will not upgrade a # single package. # Change karmic/lucid to your required releases eg, dapper/hardy, hardy/lucid, # jaunty/karmic, etc sudo sed -i.ORIG 's/karmic/lucid/g' /etc/apt/sources.list # Backup the /etc/apt/sources.list.d/ folder and create an empty one. # This will disable all Third Party/Launchpad PPA repositories. # These repositories can be re-enabled after a successful upgrade. sudo mv /etc/apt/sources.list.d/ /etc/apt/sources.list.d.ORIG/ sudo mkdir /etc/apt/sources.list.d/ # Upgrade your box sudo aptitude update sudo aptitude safe-upgrade sudo aptitude full-upgrade
Upgrading to development releases
Please be aware that development releases are unstable, and not suited for people who do not want to fix/report/triage bugs. If you want a stable Ubuntu version, stick to the official released versions. For added stability, choose a Ubuntu LTS release.
Desktop / GUI Upgrade
Server / Command line Upgrade
sudo apt install update-manager-core sudo do-release-upgrade -d
Beside the network upgrades you could upgrade to a development release via the Debian (manual) way. This is left as an exercise for the user.
See Also
- http://www.ubuntu.com/getubuntu/upgrading — Official upgrade documentation.
- UpgradeNotes — Upgrade notes for all Ubuntu releases
- EOLUpgrades — Upgrade End-of-Life (unsupported) releases.
Upgrades (последним исправлял пользователь brian-murray 2018-05-16 20:57:08)
The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details
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]
Обновление Ubuntu и пакетов сервера
Правильно обновляем пакеты системы сервера Ubuntu, с помощью терминала.
Оглавление
Наладив авторизацию через SSH, самое время обновить систему и ее пакеты. К тому же, в дальнейшем периодически система будет нам сообщать о том, что некоторые пакеты системы требуют обновления, так что, знать как это делать — мастхев.
Обновление индекса пакетов
Для начала нужно обновить индексы пакетов, чтобы получить самые последние их версии при обновлении:
Затем, обновляем пакеты если нашли что обновлять, для этого есть два варианта команд:
sudo apt upgrade sudo apt dist-upgrade
Команда dist-upgrade делает тоже самое что и upgrade , но обновляет пакеты «по-умному». Например, при конфликтах пакетов, Ubuntu попытается обновить наиболее важные пакеты, за счет менее важных. Она может установить какой-либо дополнительный пакет, а конфликтующий — удалить. Я обновляюсь второй версией команды.
Обновление Ubuntu
Предыдущие две команды не меняют версию системы Ubuntu. Для этого существует команда;
В большинстве случаев имеет смысл обновлять Ubuntu с версиями LTS на LTS. Иными словами, обновлять версию с долгосрочной поддержкой, на новую версию с долгосрочной поддержкой. Эти версии выходят в релиз один раз в 2 года и поддерживаются на протяжении 5 лет. Список версий Ubuntu можно посмотреть здесь.
Перед обновлением системы выключите файрволл UFW или откройте порт 1022.
А после успешного обновления — закройте.
sudo ufw delete allow 1022/tcp
Многие производители ПО не дают гарантий работы своего ПО на версиях не LTS. Допустим вы обновились с версии 20.04 LTS на 20.10 и если какое-то ПО перестало нормально функционировать — то пусть для вас это не будет неожиданностью. Обычно команду sudo do-release-upgrade нужно выполнять один раз в 2-3-4 года. Иными словами, следите за выходом LTS версий Ubuntu и обновляйтесь, предварительно обновив все пакеты системы, сделав бэкап / слепок системы.
Периодически я буду писать статью по обновлению Ubuntu на новые LTS версии.
Очистка от остаточных файлов
После завершения обновления пакетов, иногда остаются остаточные файлы и их можно удалить с сервера командой:
На этом процедура обновлений пакетов, как и базовые правила обновлений самой Ubuntu завершена.
Благодарность автору
Если по какой-либо причине вы хотите поблагодарить автора данного ресурса, вы можете это сделать одним из удобных для вас способов ниже.
Один из самых популярных способов поблагодарить автора, воспользоваться сервисом Яндекс.Деньги.