Различия
Здесь показаны различия между двумя версиями данной страницы.
Следующая версия | Предыдущая версия Последняя версия Следующая версия справа и слева | ||
wiki:руководство_по_ubuntu_server:управление_пакетами:automatic_updates [2012/05/15 21:53] создано |
wiki:руководство_по_ubuntu_server:управление_пакетами:automatic_updates [2018/08/26 00:17] |
||
---|---|---|---|
Строка 4: | Строка 4: | ||
=====Автоматические обновления===== | =====Автоматические обновления===== | ||
- | The unattended-upgrades package can be used to automatically install updated packages, and can be configured to update all packages or just install security updates. First, install the package by entering the following in a terminal: | + | Пакет unattended-upgrades может использоваться для автоматической установки обновленных пакетов и может быть настроен обновлять все пакеты или только обновления безопасности. Для начала установите пакет, введя в терминале следующее: |
+ | <code>sudo apt-get install unattended-upgrades</code> | ||
- | sudo apt-get install unattended-upgrades | + | Для настройки unattended-upgrades отредактируйте /etc/apt/apt.conf.d/50unattended-upgrades и поправьте следующее под ваши требования: |
- | + | <code>Unattended-Upgrade::Allowed-Origins { | |
- | To configure unattended-upgrades, edit /etc/apt/apt.conf.d/50unattended-upgrades and adjust the following to fit your needs: | + | |
- | + | ||
- | Unattended-Upgrade::Allowed-Origins { | + | |
"Ubuntu precise-security"; | "Ubuntu precise-security"; | ||
// "Ubuntu precise-updates"; | // "Ubuntu precise-updates"; | ||
- | }; | + | };</code> |
- | Certain packages can also be blacklisted and therefore will not be automatically updated. To blacklist a package, add it to the list: | + | Безусловно пакеты могут помещаться в "черный список" и, следовательно, не будут обновлены автоматически. Для блокирования обновления пакета добавьте его в список: |
- | + | <code>Unattended-Upgrade::Package-Blacklist { | |
- | Unattended-Upgrade::Package-Blacklist { | + | |
// "vim"; | // "vim"; | ||
// "libc6"; | // "libc6"; | ||
// "libc6-dev"; | // "libc6-dev"; | ||
// "libc6-i686"; | // "libc6-i686"; | ||
- | }; | + | };</code> |
- | The double “//” serve as comments, so whatever follows "//" will not be evaluated. | + | <note>Двойнной слеш %%"//"%% служит для комментариев, поэтому что бы не следовало за %%"//"%%, оно не будет обработано.</note> |
- | To enable automatic updates, edit /etc/apt/apt.conf.d/10periodic and set the appropriate apt configuration options: | + | Чтобы разрешить автоматические обновления отредактируйте /etc/apt/apt.conf.d/20auto-upgrades и установите соответствующие опции настройки apt: |
- | + | <code>APT::Periodic::Update-Package-Lists "1"; | |
- | APT::Periodic::Update-Package-Lists "1"; | + | |
APT::Periodic::Download-Upgradeable-Packages "1"; | APT::Periodic::Download-Upgradeable-Packages "1"; | ||
APT::Periodic::AutocleanInterval "7"; | APT::Periodic::AutocleanInterval "7"; | ||
- | APT::Periodic::Unattended-Upgrade "1"; | + | APT::Periodic::Unattended-Upgrade "1";</code> |
- | + | ||
- | The above configuration updates the package list, downloads, and installs available upgrades every day. The local download archive is cleaned every week. | + | |
- | + | ||
- | You can read more about apt Periodic configuration options in the /etc/cron.daily/apt script header. | + | |
- | + | ||
- | The results of unattended-upgrades will be logged to /var/log/unattended-upgrades. | + | |
- | + | ||
- | Notifications | + | |
- | Notifications | + | Настройки, приведенные выше, обновляют список пакетов, загружают и устанавливают доступные обновления каждый день. Локальный архив загрузок чистится каждую неделю. |
- | Configuring Unattended-Upgrade::Mail in /etc/apt/apt.conf.d/50unattended-upgrades will enable unattended-upgrades to email an administrator detailing any packages that need upgrading or have problems. | + | <note>Вы можете почитать больше о настройках периодичности apt в заголовке сценария /etc/cron.daily/apt.</note> |
- | Another useful package is apticron. apticron will configure a cron job to email an administrator information about any packages on the system that have updates available, as well as a summary of changes in each package. | + | Результаты работы unattended-upgrades сохраняются в журнале /var/log/unattended-upgrades. |
- | To install the apticron package, in a terminal enter: | + | ====Уведомления==== |
- | sudo apt-get install apticron | + | Настройка Unattended-Upgrade::Mail в файле /etc/apt/apt.conf.d/50unattended-upgrades позволит unattended-upgrades посылать почтовые сообщения администратору с уточнением какие пакеты требуют обновления или имеют проблемы. |
- | Once the package is installed edit /etc/apticron/apticron.conf, to set the email address and other options: | + | Другим полезным пакетом является apticron. Пакет apticron настраивает задачу cron для отправки почтовых сообщений администратору по любым пакетам в системе, для которых есть обновления, а также перечень изменений по каждому пакету. |
- | EMAIL="root@example.com" | + | Для установки пакета apticron введите в терминале: |
+ | <code>sudo apt-get install apticron</code> | ||
+ | Как только пакет установится, отредактируйте /etc/apticron/apticron.conf для установки почтового адреса и других опций: | ||
+ | <code>EMAIL="root@example.com"</code> | ||
---- | ---- |