{"id":20224,"date":"2016-09-23T07:49:10","date_gmt":"2016-09-23T12:49:10","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=20224"},"modified":"2022-06-03T03:42:38","modified_gmt":"2022-06-03T08:42:38","slug":"how-to-enable-automatic-updates-on-a-linux-vps","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-enable-automatic-updates-on-a-linux-vps\/","title":{"rendered":"How to enable automatic updates on Linux"},"content":{"rendered":"
<\/p>\n
We’ll show you, How to enable automatic updates on Linux. In order to keep the data stored on your server as secure as possible, it is recommended to upgrade the services regularly. Keeping your services up to date is a very easy task and requires a small amount of time, but it is crucial for the safety of your data. You can update the services on your Linux VPS manually or enable automatic updates. Today we will show you how to enable automatic updates on a Linux VPS.\u00a0Enabling\u00a0 automatic updates on Linux, is fairly an easy task if you carefully follow the steps in this tutorial.<\/p>\n
<\/p>\n
Before making any changes on your server you should be familiar with the advantages and disadvantages of setting up automatic updates on your server. You can find more information on this topic at https:\/\/fedoraproject.org\/wiki\/AutoUpdates#Why_use_Automatic_updates.3F<\/a>. Please note that the automatic updates will be applied only to the services provided by the package repositories. The automatic updates will not be applied to the services compiled from source. If you are ready you can proceed with the steps below:<\/p>\n The first thing you need to do is to connect to your Linux VPS via SSH<\/a>. Once you are connected you can install the package that allows automatic updates to run.<\/p>\n If you are using a CentOS 7 VPS<\/a>, you should follow the instructions below:<\/p>\n Install the Once yum-cron is installed it is time to configure it. The default configuration file is Save the file and restart the service:<\/p>\n Enable the service on system boot:<\/p>\n That’s it.<\/p>\n You can find more information and configuration options at https:\/\/fedoraproject.org\/wiki\/AutoUpdates<\/a><\/p>\n If you are using a Ubuntu 16.04 VPS<\/a>, you should follow the instructions below:<\/p>\n Install the Once the package is installed you are ready to configure the service. To configure unattended-upgrades you should edit the There is an option to blacklist certain packages if you do not like to be automatically updated. To blacklist a package it should be added to the list:<\/p>\n Next, to enable the automatic updates you should edit the More information and configuration options you can find at https:\/\/help.ubuntu.com\/lts\/serverguide\/automatic-updates.html<\/a><\/p>\n Of course, you don\u2019t have to enable automatic updates on Linux, if you use one of our VPS hosting<\/a> services, in which case you can simply ask our expert Linux admins to help you enable automatic updates on your Linux server. They are available 24\u00d77 and will take care of your request immediately.<\/p>\n PS. If you liked this post, on how to\u00a0 enable automatic updates on Linux, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":" We’ll show you, How to enable automatic updates on Linux. In order to keep the data stored on your server … <\/p>\n1. Enable automatic updates on CentOS 7<\/h2>\n
yum-cron<\/code> package using the yum package manager:<\/p>\n
# yum -y install yum-cron<\/pre>\n
\/etc\/yum\/yum-cron.conf<\/code>. You can edit the file using your favorite text editor. The following options should be set:<\/p>\n
update_cmd = default\r\napply_updates = yes\r\n<\/pre>\n
# systemctl restart yum-cron<\/pre>\n
# systemctl enable yum-cron<\/pre>\n
2. Enable automatic updates on Ubuntu 16.04<\/h2>\n
unattended-upgrades<\/code> package using the apt package manager:<\/p>\n
# apt-get install unattended-upgrades<\/pre>\n
\/etc\/apt\/apt.conf.d\/50unattended-upgrades<\/code> file using a text editor of your choice. You need to adjust the following options to fit your needs:<\/p>\n
Unattended-Upgrade::Allowed-Origins {\r\n \"Ubuntu xenial-security\";\r\n\/\/ \"Ubuntu xenial-updates\";\r\n};<\/pre>\n
Unattended-Upgrade::Package-Blacklist {\r\n \"vim\";\r\n \"libc6\";\r\n};<\/pre>\n
\/etc\/apt\/apt.conf.d\/10periodic<\/code> file using a text editor of your choice and adjust the configuration options to fit your needs .<\/p>\n
APT::Periodic::Update-Package-Lists \"1\";\r\nAPT::Periodic::Download-Upgradeable-Packages \"1\";\r\nAPT::Periodic::AutocleanInterval \"7\";\r\nAPT::Periodic::Unattended-Upgrade \"1\";<\/pre>\n
\n