How to set up automatic upgrade on Debian
This article mainly introduces "how to set up automatic upgrade on Debian". In daily operation, I believe many people have doubts about how to set up automatic upgrade on Debian. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "how to set up automatic upgrade on Debian". Next, please follow the editor to study!
If you have purchased a Debian server and want to update the latest security patches on your own, you need to do this:
Run this command to install the Uninstall upgrade package, and a package to identify changes:
Apt- y install unattended-upgrades apt-listchanges
After the installation is complete, edit the incomplete upgrade configuration:
Nano / etc/apt/apt.conf.d/50unattended-upgrades
Paste the following into this file, then use it to modify the entry and remember to remove those asteroids.
APT::Periodic::Update-Package-Lists "1"; APT::Periodic::Download-Upgradeable-Packages "1"; APT::Periodic::AutocleanInterval "7"; APT::Periodic::Unattended-Upgrade "1"; Unattended-Upgrade::Mail "* * YOUR_EMAIL_HERE**"
/ / Automatically upgrade packages from theseUnattended-Upgrade::Origins-Pattern {"ostensibly stable"; "ostensible Debian authoring adept label=Debian-Security updates"; "ostensible Debian authoring aegis proposed house updates"; "origin=Debian,codename=$ {distro_codename}, label=Debian-Security";}
/ / You can specify your own packages to NOT automatically upgrade hereUnattended-Upgrade::Package-Blacklist {/ / "vim"; / / "libc6"; / / "libc6-dev"; / / "libc6-i686";}; Unattended-Upgrade::MailOnlyOnError "true"; Unattended-Upgrade::Automatic-Reboot "false"
Note: delete the original line (ctrl+k) from the file that can be saved
Note: if you want the server to restart if necessary, you can set the automatic reboot to true.
Install "apticron" to manage the automation of APT updates:
Apt-y install apticron
Open / etc/apticron/apticron.conf and set the e-mail variable to your email address so that you can receive a list of changes.
EMAIL= "* * me@www.vultrla.com**" DIFF_ONLY= "1" LISTCHANGES_PROFILE= "apticron" SYSTEM= "* * HOSTNAME.OF.SERVER**" NOTIFY_HOLDS= "0" NOTIFY_NO_UPDATES= "0"
Open / etc/apt/listchanges.conf to configure APT to save changes to the database:
[apt] frontend=pageremail_address=**me@example**confirm=0save_seen=/var/lib/apt/listchanges.dbwhich=news
You can run unattended-upgrade manually in debug mode to see if it works:
Unattended-upgrade-d at this point, the study on "how to set up automatic upgrade on Debian" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!