Use the apt command to make Ubuntu update regularly

Source: Internet
Author: User
Do you want to update Ubuntu automatically on a daily basis, but you don't want to do it yourself? One of the students in the class is a Linux expert. He told me that apt-getupdate can be used, after hearing this, it is of course the joy of the Dragon Heart (it is clear that you can sneak up with a smile). Since you can get lazy, let's get lazy together. You can use the following methods to complete regular daily updates: 1. first in cron. create a new file in daily. If you want to update the file, call it upgrade: sudonano/etc/c.

Do you want to update Ubuntu automatically on a daily basis, but you don't want to do it yourself?
One of the students in the class is a Linux expert,
He told me that apt-get update can be used,
After hearing this, it is of course the joy of long heart (it is clear that you can be lazy by secretly LAUGHING ),
Since we can be lazy, let's get lazy together. You can use the following methods to complete regular daily updates:

1. First create a new file under cron. daily. Since it is to be updated, call it upgrade:

Sudo nano/etc/cron. daily/upgrade

2. Add four lines of commands to the upgrade file:
#! /Bin/sh
Apt-get update
Apt-get-y dist-upgrade
Apt-get clean

3. Do not change the permission. Therefore, you need to change it to 775 first (permission 755 is enough ):
Sudo chmod 755/etc/cron. daily/upgrade

4. If you are afraid to write an error, perform it first. If there is no error message, it is OK:
Sudo/etc/cron. daily/upgrade

5. In the end, remember to restart crond and you will be done. (You can also restart it. XD ):
$ Sudo/etc/init. d/cron restart

In this way, Ubuntu will be updated on a regular basis every day, so it is really lazy to the highest point!
If there are updates, please be blessed ~

Ubuntu can be used for testing...
In addition, if you want to know how to use apt commands, this website is quite easy to understand. I also learned this:
Http://www.linuxidc.com/Linux/2011-04/34059.htm

Note: The official saying that aptitdue is better than apt-get, so it can be replaced by aptitdue.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.