Ubuntu Server Guide
Download 1.23 Mb. Pdf ko'rish
|
ubuntu-server-guide (1)
- Bu sahifa navigatsiya:
- Notifications
Automatic Updates
The unattended-upgrades package can be used to automatically install updated packages and can be con- figured to update all packages or just install security updates. First, install the package by entering the following in a terminal: sudo apt i n s t a l l unattended−upg r a des To configure unattended-upgrades, edit /etc/apt/apt.conf.d/50unattended−upgrades and adjust the follow- ing to fit your needs: Unattended−Upgrade : : Allowed−O r i g i n s { ” $ { d i s t r o _ i d } : $ { distro_codename } ” ; ” $ { d i s t r o _ i d } : $ { distro_codename}− s e c u r i t y ” ; // ” $ { d i s t r o _ i d } : $ { distro_codename}−up d a t e s ” ; // ” $ { d i s t r o _ i d } : $ { distro_codename}−pr o p o s e d ” ; // ” $ { d i s t r o _ i d } : $ { distro_codename}−b a c k p o r t s ” ; } ; Certain packages can also be blacklisted and therefore will not be automatically updated. To blacklist a package, add it to the list: Unattended−Upgrade : : Package−B l a c k l i s t { // ” vim ” ; // ” l i b c 6 ” ; // ” l i b c 6 −dev ” ; // ” l i b c 6 −i 6 8 6 ” ; } ; Note The double “//” serve as comments, so whatever follows “//” will not be evaluated. To enable automatic updates, edit /etc/apt/apt.conf.d/20auto−upgrades and set the appropriate apt con- figuration options: APT : : P e r i o d i c : : Update−Package−L i s t s ” 1 ” ; APT : : P e r i o d i c : : Download−Upgradeable−Packages ” 1 ” ; 15 APT : : P e r i o d i c : : A u t o c l e a n I n t e r v a l ” 7 ” ; APT : : P e r i o d i c : : Unattended−Upgrade ” 1 ” ; The above configuration updates the package list, downloads, and installs available upgrades every day. The local download archive is cleaned every week. On servers upgraded to newer versions of Ubuntu, depending on your responses, the file listed above may not be there. In this case, creating a new file of this name should also work. Note You can read more about apt Periodic configuration options in the apt.conf(5) manpage and in the /usr/lib/apt/apt.systemd.daily script header. The results of unattended-upgrades will be logged to /var/log/unattended−upgrades. 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. 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. To install the apticron package, in a terminal enter: sudo apt i n s t a l l a p t i c r o n Once the package is installed edit /etc/apticron/apticron.conf, to set the email address and other options: EMAIL=”root@example . com” References Most of the material covered in this chapter is available in man pages, many of which are available online. • The InstallingSoftware Ubuntu wiki page has more information. • For more dpkg details see the dpkg man page. • The APT User’s Guide and apt man page contain useful information regarding apt usage. • See the aptitude user’s manual for more aptitude options. • The Adding Repositories HOWTO (Ubuntu Wiki) page contains more details on adding repositories. Download 1.23 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling