Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unattended-upgrades for laptop #351

Open
DavidHenryThoreau opened this issue Dec 29, 2023 · 0 comments
Open

unattended-upgrades for laptop #351

DavidHenryThoreau opened this issue Dec 29, 2023 · 0 comments

Comments

@DavidHenryThoreau
Copy link

I'm using unattended-upgrades for desktop and server which works very well, but I'm trying to configure it to laptop but I've set additional variables and it still does not work :

echo "
// Enable the update/upgrade script (0=disable)
APT::Periodic::Enable "1";

// Do "apt-get update" automatically every n-days (0=disable)
APT::Periodic::Update-Package-Lists "1";

// Do "apt-get upgrade --download-only" every n-days (0=disable)
APT::Periodic::Download-Upgradeable-Packages "1";

// Run the "unattended-upgrade" security upgrade script
// every n-days (0=disabled)
// Requires the package "unattended-upgrades" and will write
// a log in /var/log/unattended-upgrades
APT::Periodic::Unattended-Upgrade "1";

// Do "apt-get autoclean" every n-days (0=disable)
APT::Periodic::AutocleanInterval "20";

// Define basic patterns
//Unattended-Upgrade::Origins-Pattern {
//        "origin=${distro_id},codename=${distro_codename}";
//        "origin=Armbian";
//};

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Verbose "1";
Unattended-Upgrade::Remove-New-Unused-Dependencies "true";
Unattended-Upgrade::Remove-Unused-Dependencies "true";
Unattended-Upgrade::OnlyOnACPower "false";
//Unattended-Upgrade::Automatic-Reboot "true";
//Unattended-Upgrade::Automatic-Reboot-Time "02:30";

Unattended-Upgrade::Origins-Pattern {
        "origin=*";
      };" > /etc/apt/apt.conf.d/02-armbian-periodic

dpkg-divert --no-rename --add /etc/apt/apt.conf.d/02-armbian-periodic


SYSTEMD_EDITOR=tee systemctl edit apt-daily.timer <<EOF
[Timer]
OnBootSec=1min
RandomizedDelaySec=0
EOF


systemctl restart apt-daily.timer


SYSTEMD_EDITOR=tee systemctl edit apt-daily-upgrade.timer <<EOF
[Timer]
OnBootSec=3min
RandomizedDelaySec=0
EOF

systemctl restart apt-daily-upgrade.timer

SYSTEMD_EDITOR=tee systemctl edit apt-daily-upgrade.service <<EOF
[Unit]
ConditionACPower=false
EOF

systemctl restart apt-daily-upgrade.service

sed -i 's/ANACRON_RUN_ON_BATTERY_POWER.*/ANACRON_RUN_ON_BATTERY_POWER=yes/' /etc/default/anacron

echo -ne "[Unit]\nConditionACPower=" >> /etc/systemd/system/anacron.service.d/on-ac.conf

systemctl daemon-reload
systemctl restart anacron

unattended-upgrades --dry-run --debug

systemctl list-timers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant