Oracle linux update yum

ChapterВ 4В Upgrading an Oracle Linux System

Typically, you upgrade an Oracle Linux system by performing a fresh installation. However, starting with Oracle Linux 7, there is support for in-place upgrades. This chapter describes the conditions and method for performing an in-place upgrade.

4.1В Conditions for Performing an In-Place Upgrade

In-place upgrades are supported for systems that run Oracle Linux 6 Update 5 or later only . The following conditions must also be met:

The system to be upgraded must meet the minimum installation requirements for Oracle Linux 7, see Section 1.1, “System Requirements”.

The Oracle Linux 6 system has been completely updated from the ol6_x86_64_latest channel or the ol6_latest repository.

Either the Unbreakable Enterprise Kernel Release 3 (UEK R3) or the Unbreakable Enterprise Kernel Release 4 (UEK R4) release must be installed on the system and it must be the default boot kernel. Upgrading from Unbreakable Enterprise Kernel Release 2 is not supported.

The Oracle Linux 6 system must have been installed with the Minimal set of software.

No Oracle product stack is present on the system.

If the RHCK is installed, it is upgraded as part of the process, but it must not be set as the default boot kernel.

If the system to be upgraded contains valuable data, make a backup or snapshot of the system so that you can recover it to its previous state if the upgrade fails.

Before you upgrade, check the release notes for any known issues with upgrades. See Oracle В® Linux 7 Documentation and Unbreakable Enterprise Kernel Documentation libraries.

To perform an in-place upgrade you must install some additional packages and their dependencies. The system should have access to the Unbreakable Linux Network (ULN), Oracle Linux yum server, or a local yum server.

4.2В Performing an In-Place Upgrade

If the system is registered with ULN, make sure that it is subscribed to the ol6_x86_64_latest and ol6_x86_64_addons channels.

If the system is using the Oracle Linux yum server or a local mirror, make sure that the ol6_latest and ol6_addons repositories are enabled.

Use the yum update command to update the system to the latest Oracle Linux 6 release.

Install the latest versions of the following required packages:

If the system is registered with ULN, delete the system from ULN and disable yum plugins.

You can only delete a system if it is registered to your user name on ULN.

Log in to https://linux.oracle.com with your ULN user name and password.

On the Systems tab, click the link for the system in the list of registered machines.

On the System Details page, click Delete .

When prompted to confirm the deletion, click OK .

On the system, edit the yum configuration file /etc/yum.conf file and disable yum plugins by setting plugins=0 .

Run the preupg command to perform an upgrade assessment:

Examine the upgrade assessment results file /root/preupgrade/result.html .

If the assessment reports any fail , needs_action , or needs_inspection issues, read the remediation instructions for these issues and perform any required actions before proceeding with the upgrade.

You might also need to perform some actions after performing the upgrade.

You can run the preupg command as often as you like to check the system’s readiness for upgrading. A backup of each assessment is stored in the /root/preupgrade-results directory. You might want to back up this directory before performing the upgrade.

The /root/preupgrade directory (and its contents) must be present for the upgrade to proceed.

Run the redhat-upgrade-tool-cli command to perform the upgrade.

For example, to upgrade using an Oracle Linux 7 installation ISO, you might use the following command:

Substitute OL7_ISO with the path to the installation ISO. Alternately, use the —device option to point to a burned media copy of the installation ISO. For example:

Substitute /dev/cdrom with the device where the installation media is accessible.

If you wish to use a network-based resource to perform the upgrade, you can use the —network option in conjunction with the —instrepo to specify the URL where the ISO contents are located. For example:

Substitute OL7_repo_url with the URL where the installation media is accessible. Note that an installation repository must contain a .treeinfo file that provides metadata for the installation. Currently, you cannot use the standard yum repositories exposed on the Oracle Linux yum server directly. If you wish to install from a network resource, you can copy the contents of an installation ISO to a locally hosted web server.

Читайте также:  Windows удаляет файл kms

The —cleanup-post option ensures that there are no Oracle Linux 6 packages remaining on the system after the upgrade. If you do not use this option, check the system after the upgrade and manually remove any Oracle Linux 6 packages, for example, by using the yum remove `rpm -qa | grep el6` .

For more information, use the —help option with the redhat-upgrade-tool-cli command.

If you require use of a proxy server to access a network resource where your installation repository is located, set the appropriate command line variables before running the command. For example:

Reboot the system to start the upgrade.

After the reboot, the upgrade tool installs the required packages, reconfigures the system, and then reboots. Depending on the number of packages, this may take some time.

After the upgrade completes, perform any post-upgrade actions identified by the upgrade assessment.

If the system was previously registered with ULN, check that yum plugins are enabled and re-register the system with ULN.

On the system, edit the yum configuration file /etc/yum.conf file and enable yum plugins by setting plugins=1 .

Run the uln_register command.

Alternatively, if you use the GNOME graphical user desktop, select Applications , System Tools , and then ULN Registration .

When prompted, enter your ULN user name, password, and customer support identifier (CSI).

Copyright В© 2014, 2020, Oracle and/or its affiliates. Legal Notices

Источник

Yum, шпаргалка

Шпаргалка по работе с пакетным менеджером Yum (Yellowdog Updater, Modified), который используется в популярных Linux дистрибутивах: RedHat, CentOS, Scientific Linux (и других). В целях экономии места вывод команд не представлен.

Оглавление

список названий пакетов из репозиторий

список всех доступных пакетов

список всех установленных пакетов

установлен ли указанный пакет

список установленных и доступных пакетов

список пакетов, относящихся к ядру

отображение информации о пакете

список зависимостей и необходимых пакетов

найти пакет, который содержит файл

поиск пакета по имени и описанию

получить информацию о доступных обновлениях безопасности

вывести список групп

вывести описание и содержимое группы

установка группы пакетов «Basic Web Server»

Проверка на доступные обновления

список подключенных репозиториев

информация об определенном репозитории

информация о пакетах в указанном репозитории

установить все пакеты из репозитория

удалить пакеты установленные из репозитория

проверить локальную базу rpm (поддерживаются параметры dependencies, duplicates, obsoletes, provides)

просмотр yum истории (вывод списка транзакций)

просмотр информации определенной транзакции (установленные пакеты, установленные зависимости)

дополнительно можно просмотреть лог

удалить пакеты сохраненные в кэше

удалить все пакеты и метаданные

обновить все пакеты

обновить до определенной версии

установить из локальной директории (поиск/установка зависимостей будут произведены из подключенных репозиториев)

установить с http

откатиться к предыдущей версии пакета

переустановка пакета (восстановление удаленных файлов)

удаление ненужных более пакетов

создание локальных репозиториев (createrepo ставится отдельно)

установка обновлений по расписанию (yum-cron устанавливается отдельно)

Опции Yum

ответить «yes» при запросе,

ответить «no» при запросе

использовать Yum без плагинов

или отключить определенный плагин

включить плагины, которые установлены, но отключены

включить отключенный репозиторий

скачать пакеты, но не устанавливать
(на Centos 7 x86_64 будут скачаны в ‘/var/cache/yum/x86_64/7/base/packages/’)

Cледующие команды доступны после установки пакета yum-utils

найти из какого репозитория установлен пакет

найти процессы, пакеты которых обновлены и требуют рестарта

запрос к репозиторию, узнать зависимости пакета, не устанавливая его

синхронизировать yum репозиторий updates в локальную директорию repo1

проверить локальный репозиторий на целостность

установить необходимые зависимости для сборки RPM пакета

управление конфигурационными опциями и репозиториями yum

запрос к локальной базе yum, отображение информации о пакете
(использованная команда, контрольная сумма, URL с которого был установлен и другое)

скачать rpm пакеты из репозитория

скачать src.rpm пакет из репозитория
(должен быть подключен соответствующий репозиторий, например в ‘/etc/yum.repos.d/CentOS-Sources.repo’ в CentOS)

Конфигурационные файлы Yum и их расположение

Основной конфигурационный файл

директория, с конфигурациями (например, yum плагины)

директория, содержащая информацию о репозиториях

Некоторые опции yum.conf:

Директория, где yum хранит кэш и файлы базы (по умолчанию ‘/var/cache/yum’)

Определяет должен или нет Yum хранить кэш заголовков и пакетов после успешной установки. Значения: 0 или 1. (по умолчанию 1)

уровень вывода отладочных сообщений. Значения: 1-10 (по умолчанию 2)

лог файл (по умолчанию ‘/var/log/yum.log’)

обновлять устаревшие пакеты

проверка подписи пакетов. Значения: 0 или 1 (по умолчанию 1)

включение плагинов. Значения: 0 или 1 (по умолчанию 1)

Некоторые полезные плагины

Добавляет опцию командной строки для просмотра ченжлога перед/после обновлениями

выбирает более быстрые репозитории из списка зеркал

добавляет команды keys, keys-info, keys-data, keys-remove, которые позволяют работать с ключами.

блокировать указанные пакеты от обновления, команда yum versionlock

добавление команд yum verify-all, verify-multilib, verify-rpm для проверки контрольных сумм пакетов

Работа Yum через прокси сервер

Для всех пользователей:
добавить в секцию [main] в /etc/yum.conf

при необходимости указать пароль, добавить

указать прокси для отдельного пользователя

Буду рад любым дополнениям и замечаниям.
Дополнительно читайте:

Источник

ChapterВ 2В Yum Configuration

The main configuration file for yum is /etc/yum.conf . This chapter describes how to configure directives in the configuration file.

Читайте также:  Принтер установка hp laserjet 1005 для windows

2.1В Yum Configuration Directives

The global definitions for yum are located under the [main] section heading of the yum configuration file. The following table lists the important directives.

Directory used to store downloaded packages.

Logging level, from 0 (none) to 10 (all).

If set to 1, only update packages for the correct architecture.

A space separated list of packages to exclude from installs or updates, for example: exclude=VirtualBox-4.? kernel* .

If set to 1, verify the authenticity of the packages by checking the GPG signatures. You might need to set gpgcheck to 0 if a package is unsigned, but you should be wary that the package could have been maliciously altered.

Pathname of the GPG public key file.

Maximum number of versions that can be installed of any one package.

If set to 0, remove packages after installation.

Pathname of the yum log file.

If set to 1, replace obsolete packages during upgrades.

If set to 1, enable plugins that extend the functionality of yum .

URL of a proxy server including the port number. See Section 2.2, “Configuring Use of a Proxy Server”.

Password for authentication with a proxy server.

User name for authentication with a proxy server.

Directories where yum should look for repository files with a .repo extension. The default directory is /etc/yum.repos.d .

See the yum.conf(5) manual page for more information.

The following listing shows an example [main] section from the yum configuration file.

It is possible to define repositories below the [main] section in /etc/yum.conf or in separate repository configuration files. By default, yum expects any repository configuration files to be located in the /etc/yum.repos.d directory unless you use the reposdir directive to define alternate directories.

2.2В Configuring Use of a Proxy Server

If your organization uses a proxy server as an intermediary for Internet access, specify the proxy setting in /etc/yum.conf as shown in the following example.

If the proxy server requires authentication, additionally specify the proxy_username , and proxy_password settings.

If you use the yum plugin ( yum-rhn-plugin ) to access the ULN, specify the enableProxy and httpProxy settings in /etc/sysconfig/rhn/up2date as shown in this example.

If the proxy server requires authentication, additionally specify the enableProxyAuth , proxyUser , and proxyPassword settings.

All yum users require read access to /etc/yum.conf or /etc/sysconfig/rhn/up2date . If these files must be world-readable, do not use a proxy password that is the same as any user’s login password, and especially not root ‘s password.

2.3В Yum Repository Configuration

The yum configuration file or yum repository configuration files can contain one or more sections that define repositories.

The following table lists the basic directives for a repository.

Location of the repository channel (expressed as a file:// , ftp:// , http:// , or https:// address). This directive must be specified.

If set to 1, permit yum to use the channel.

Descriptive name for the repository channel. This directive must be specified.

Any other directive that appears in this section overrides the corresponding global definition in [main] section of the yum configuration file. See the yum.conf(5) manual page for more information.

The following listing shows an example repository section from a configuration file.

In this example, the values of gpgkey and gpgcheck override any global setting. yum substitutes the name of the current system’s architecture for the variable $basearch .

yum automatically searches the /etc/yum.repos.d directory for files with the suffix .repo and appends these to the configuration when it is processing. Use this directory to define repository files for repositories that you want to make available.

2.4В Downloading the Oracle Linux Yum Server Repository Files

The Oracle Linux yum server provides a direct mapping of all of the Unbreakable Linux Network (ULN) channels that are available to the public without any specific support agreement. The repository labels used for each repository on the Oracle Linux yum server map directly onto the channel names on ULN. See Oracle В® Linux: Unbreakable Linux Network User’s Guide for Oracle Linux 6 and Oracle Linux 7 at https://docs.oracle.com/en/operating-systems/oracle-linux/uln-user/ol_channels_uln.html for more information about the channel names and common suffixes used for channels and repositories.

Prior to January 2019, Oracle shipped a single yum repository configuration file for each Oracle Linux release. This configuration file is copied into /etc/yum.repos.d/public-yum-ol7.repo at installation, but can also be downloaded from the Oracle Linux yum server directly to obtain updates.

The original configuration file is deprecated in favor of modular repository files that are managed and updated automatically via yum in the form of RPM packages that are more targeted in scope. For example, core repository configuration files required for Oracle Linux 7 are available in the oraclelinux-release-el7 package. This package includes all of the repository configuration required to install base packages for the release, including packages from the ol7_latest , ol7_addons repositories and all of the supported repositories for UEK.

Читайте также:  Linux mint включить вай фай

The modular yum repository configuration files released as packages that can be maintained via yum can help to simplify repository management and also ensure that your yum repository definitions are kept up to date automatically, whenever you update your system.

A list of all available RPM files to manage all of the possible yum repository configurations for your release can be obtained by running:

To install the yum repository configuration for a particular set of software that you wish to use, use yum to install the corresponding package. For example, to install the yum repository configuration for the Oracle Linux Software Collection Library, run:

If your system is still configured to use the original single yum repository configuration file at /etc/yum.repos.d/public-yum-ol7.repo , you should update your system to transition to the current approach to handling yum repository configuration. To do this, ensure that your system is up to date and then run the /usr/bin/ol_yum_configure.sh script:

The /usr/bin/ol_yum_configure.sh script checks the /etc/yum.repos.d/public-yum-ol7.repo file to determine which repositories are already enabled and installs the appropriate corresponding packages before renaming the original configuration file to /etc/yum.repos.d/public-yum-ol7.repo.sav to disable it in favor of the more recent modular repository configuration files.

If, for some reason, you manage to remove all configuration to access the Oracle Linux yum server repositories, you should create a temporary yum repository configuration file at /etc/yum.repos.d/ol7-temp.repo with the following as the minimum required content:

Then reinstall the oraclelinux-release-el7 package to restore the default yum configuration:

For more information on manually setting up Oracle Linux yum server repository configuration files, see https://yum.oracle.com/getting-started.html.

You can enable or disable repositories in each repository configuration file by setting the value of the enabled directive to 1 or 0 for each repository listed in the file, as required. The preferred method of enabling or disabling repositories under Oracle Linux 7 is to use the yum-config-manager command as described in Section 2.6, “Using Yum Utilities to Manage Configuration”.

2.5В Using Yum on Oracle Cloud Infrastructure Systems

Compute instances in Oracle Cloud Infrastructure have access to regional yum servers via the service gateway. Regional yum servers on Oracle Cloud Infrastructure differ from the Oracle Linux yum server in that they also mirror content available on restricted ULN channels.

Yum repository configuration in Oracle Linux typically makes use of a yum variable in the baseurl for managing appropriate yum server access. For example, the baseurl to the _latest repository for Oracle Linux 7 is:

The $ociregion variable can be set by populating content in /etc/yum/vars/ociregion . If this file does not exist, or the file is empty, the baseurl is expanded to point to the publicly accessible Oracle Linux yum server. In the case of a typical Oracle Cloud Infrastructure compute instance, the value of variable is set when the instance is created so that the baseurl is expanded to point to the closest regional yum server on the Oracle Cloud Infrastructure service network. For example, if $ociregion is set to -phx , the baseurl expands to point to the regional yum server located in Phoenix.

By using variables, configuration can remain relatively standard across Oracle Linux deployments but provide access to the additional resources available to Oracle Cloud Infrastructure customers.

2.6В Using Yum Utilities to Manage Configuration

The yum-utils package includes several utilities that can help you to manage configuration and apply updates safely to your existing configuration. Most significant of these is yum-config-manager .

To install the yum-utils package:

You can use yum-config-manager to add repositories either at a specified URL, or within a specified repository file. For example, to add the legacy repository configuration file for Oracle Linux 7 from the Oracle Linux yum server:

The legacy repository configuration file is unmaintained and deprecated. The information in this file may not be current and newer repositories may not be listed.

You can use the same command to automatically generate a repository configuration file for a valid yum repository, by pointing to the URL where the repository is hosted. For example, to create a new configuration file in /etc/repos.d for the Unbreakable Enterprise Kernel Release 5 repository. run:

To enable a repository using yum-config-manager , use the —enable option. For example, to enable the ol7_addons repository, run:

You can use the —disable option in a similar way to disable a repository.

The yum-config-manager tool can also be used to set other configuration options using the —setopt and —save options. See the yum-config-manager(1) manual page for more information.

For a list of the tools included in the yum-utils package and a description of what these tools can do, see the yum-utils(1) manual page for more information.

Copyright В© 2020, 2021, Oracle and/or its affiliates. Legal Notices

Источник

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