个人工具

UbuntuHelp:AutomaticSecurityUpdates

来自Ubuntu中文

Oneleaf讨论 | 贡献2007年5月13日 (日) 11:33的版本 (New page: {{From|https://help.ubuntu.com/community/AutomaticSecurityUpdates}} {{Languages|php5}} === Information === This is a simple instructional that will teach you to create a script/cron job to...)

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航, 搜索


Information

This is a simple instructional that will teach you to create a script/cron job to go out and locate security updates and install them automatically in the background. There is always some security risks involved in running software upgrades without supervision, but if you consider those irrelevant for you, then you could follow this simple tutorial.

Instructions

Create a new file by using your favorite text editor. For Ubuntu/Gnome users you can use gedit, and for Kubuntu/KDE users you can use Kate. Also available via the command line are various other text editors that you can use. The file you create, name it ~-apt-security-updates-~ and place it in the directory ~-/etc/cron.weekly/-~. Enter the following text into the ~-apt-security-updates-~ files:

#! /bin/sh
echo "**************" >> /var/log/apt-security-updates
date >> /var/log/apt-security-updates
aptitude update >> /var/log/apt-security-updates
aptitude upgrade -o Aptitude::Delete-Unused=false --assume-yes --target-release dapper-security >> /var/log/apt-security-updates
echo "Security updates (if any) installed"
</code>
Depending on your Ubuntu release, replace "dapper" with your release, for example "edgy".

Once you are complete, you want to make the file executable for root. So via the command line/terminal type the following line:
<pre>
sudo chmod u=rwx,g=rx,o=rx /etc/cron.weekly/apt-security-updates
</code>

=== Post Install/Setup/Execution Information ===
This script will run weekly and it installs all available packages from the security repository. It also generates a log in ~-/var/log/apt-security-updates-~ for later inspection in case something goes wrong.

----
CategorySecurity CategoryCleanup

[[category:UbuntuHelp]]