个人工具

“UbuntuHelp:AutomaticSecurityUpdates”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第7行: 第7行:
 
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:
 
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:
 
<pre><nowiki>
 
<pre><nowiki>
 +
#! /bin/sh
 
echo "**************" >> /var/log/apt-security-updates
 
echo "**************" >> /var/log/apt-security-updates
 
date >> /var/log/apt-security-updates
 
date >> /var/log/apt-security-updates

2007年5月24日 (四) 09:04的版本


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"

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.