特殊:Badtitle/NS100:AutomaticSecurityUpdates

来自Ubuntu中文
Oneleaf留言 | 贡献2007年5月14日 (一) 11:14的版本
跳到导航跳到搜索
可打印版本不再受到支持且可能有渲染错误。请更新您的浏览器书签并改用浏览器默认打印功能。

{{#ifexist: :AutomaticSecurityUpdates/zh | | {{#ifexist: AutomaticSecurityUpdates/zh | | {{#ifeq: {{#titleparts:AutomaticSecurityUpdates|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:AutomaticSecurityUpdates|1|-1|}} | zh | | }}

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:

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"

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:

sudo chmod u=rwx,g=rx,o=rx /etc/cron.weekly/apt-security-updates

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.