我在Ubuntu服务器上跟踪了启用自动升级的文档,但它实际上根本没有更新任何内容。
我的/etc/apt/apt.conf.d/50无人值守-升级看起来几乎是默认的。
// Automatically upgrade packages from these (origin, archive) pairs
Unattended-Upgrade::Allowed-Origins {
"Ubuntu karmic-security";
"Ubuntu karmic-updates";
};
// List of packages to not update
Unattended-Upgrade::Package-Blacklist {
// "vim";
// "libc6";
// "libc6-dev";
// "libc6-i686";
};
// Send email to this address for problems or packages upgrades
// If empty or unset then no email is sent, make sure that you
// have a working mail setup on your system. The package 'mailx'
// must be installed or anything that provides /usr/bin/mail.
Unattended-Upgrade::Mail "pupeno@example.com";
// Automatically reboot *WITHOUT CONFIRMATION* if a
// the file /var/run/reboot-required is found after the upgrade
//Unattended-Upgrade::Automatic-Reboot "false";目录/var/log/无人值守-升级/为空。运行/etc/init.d/无人值守-升级启动不是很好:
root@mozart:~# /etc/init.d/unattended-upgrades start
Checking for running unattended-upgrades: root@mozart:~#好像有东西坏了,但我不知道为什么。
我有正在等待的更新,它们没有被应用:
root@mozart:~# aptitude safe-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
The following packages will be upgraded:
linux-libc-dev
1 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/743kB of archives. After unpacking 4096B will be used.
Do you want to continue? [Y/n/?]在我拥有的所有服务器中,无人值守的升级似乎已被禁用:
root@mozart:~# apt-config shell UnattendedUpgradeInterval APT::Periodic::Unattended-Upgrade
root@mozart:~#知道我错过了什么吗?
发布于 2010-02-22 02:04:32
你有没有检查过/etc/apt/apt.conf.d/10周期?
它应该有最后一行
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "1";
APT::Periodic::Unattended-Upgrade "1";发布于 2012-06-21 07:19:05
查看Ubuntu版本的实际文档如下:
/usr/share/doc/unattended-upgrades/README.gz对于Ubuntu11.10,要启用它,您可以:
sudo dpkg-reconfigure -plow unattended-upgrades(这是一个交互式对话框),它将创建具有以下内容的/etc/apt/apt.conf.d/20auto-upgrades:
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";因此,Ubuntu10.04服务器指南中的信息确实已经过时了。
如果您使用的是木偶,就像我们在比波和索洛瓦斯所做的那样,您可以使用这样的方法来自动化正常的无人值守的升级配置:
# Unattended upgrades
package { unattended-upgrades: ensure => present }
file { '/etc/apt/apt.conf.d/50unattended-upgrades':
content => template('bipposerver/50unattended-upgrades'),
mode => 0644,
require => Package['unattended-upgrades'],
}
file { '/etc/apt/apt.conf.d/20auto-upgrades':
source => 'puppet:///bipposerver/20auto-upgrades',
mode => 0644,
require => Package['unattended-upgrades'],
}
service { unattended-upgrades:
enable => true,
subscribe => [ Package['unattended-upgrades'],
File['/etc/apt/apt.conf.d/50unattended-upgrades',
'/etc/apt/apt.conf.d/20auto-upgrades'] ],
}确保提供您认为合适的模板/文件50unattended-upgrades和20auto-upgrades。
我还在更新Ubuntu页面以反映这一点。
发布于 2010-02-18 23:55:22
我看不出你的/etc/apt/apt.conf.d/50unattended-upgrades有什么问题。我的看起来和你的差不多,但我只让安全升级自动应用,没有别的。我还将其设置为简单地将邮件发送到"root“(后缀处理其余部分)。
但是: init脚本/etc/init.d/unattended-upgrades不是用于运行无人参与的升级。它只检查无人值守的升级进程是否正在运行,并等待直到退出。我真的不知道为什么需要它,也不知道它为什么要做它所做的(以前的Ubuntu版本中甚至没有它),但是它不是做无人值守的升级的方法。
相反,在Ubuntu上有一个名为unnattended-upgrades的Python程序来完成这项工作。试着手动运行,看看会发生什么。还请检查命令的输出。
apt-config shell UnattendedUpgradeInterval APT::Periodic::Unattended-Upgrade 应该是UnattendedUpgradeInterval='1',表明您正确地配置了APT以允许无人值守的升级。
Ubuntu每天从cron运行/etc/cron.daily/apt。如果你看一下那个脚本,你会发现它做了各种各样与APT相关的事情,其中包括无人值守的升级。我猜你在某种程度上禁用了那个cron脚本,所以没有人参与任何事情的发生。
差不多就是这样,从我头上跳下来。如果你尝试过我的想法,但没有成功,请贴上一篇后续文章。
HTH
https://serverfault.com/questions/111201
复制相似问题