multicloud365
  • Home
  • Cloud Architecture
    • OCI
    • GCP
    • Azure
    • AWS
    • IAC
    • Cloud Networking
    • Cloud Trends and Innovations
    • Cloud Security
    • Cloud Platforms
  • Data Management
  • DevOps and Automation
    • Tutorials and How-Tos
  • Case Studies and Industry Insights
    • AI and Machine Learning in the Cloud
No Result
View All Result
  • Home
  • Cloud Architecture
    • OCI
    • GCP
    • Azure
    • AWS
    • IAC
    • Cloud Networking
    • Cloud Trends and Innovations
    • Cloud Security
    • Cloud Platforms
  • Data Management
  • DevOps and Automation
    • Tutorials and How-Tos
  • Case Studies and Industry Insights
    • AI and Machine Learning in the Cloud
No Result
View All Result
multicloud365
No Result
View All Result

Replace Ubuntu utilizing Apt & Cron

admin by admin
June 17, 2025
in Cloud Networking
0
Replace Ubuntu utilizing Apt & Cron
399
SHARES
2.3k
VIEWS
Share on FacebookShare on Twitter


There are a number of strategies to replace Ubuntu. These strategies embrace bundle updates through the desktop, the unattended improve script, and good outdated Apt. Because the title suggests, this submit explores the final possibility utilizing Cron.

Utilizing the Apt command through Cron is especially supposed in case you have put in a cut-down, customised or server model of Ubuntu. Conversely, Desktop customers utilizing the total set up don’t want to fret because the GUI robotically handles updates.

You need to use the unattended improve script if you wish to write the small print and adjustments to the log information and ship a mail report back to a system admin consumer. Nonetheless, this may be scripted utilizing Bash if you want.

The unattended-upgrades script in Ubuntu is helpful once you need to:

  • Do a dry run of an improve with out really putting in something.
  • Deal with safety and non-security updates individually.

Due to this fact, this submit is especially supposed for Ubuntu server customers with a light-weight set up. Thus utilizing Apt and Cron can be an ideal match and a no-frills strategy.

As a matter of warning – upgrades can doubtlessly break issues—equally; it’s safer to be up-to-date.

Let’s get began!

First, open Cron utilizing the next command:

Word that you could run this command utilizing sudo. Alternatively, you could be logged in as root.

Subsequent, add the next strains utilizing your favorite textual content editor and save:

0 17 * * 7 /usr/bin/apt replace
0 18 * * 7 /usr/bin/apt improve -q -y
0 19 * * 7 /usr/bin/apt autoclean

The Apt replace command solely will get the details about the most recent model of packages out there in your system. Whereas the Apt improve command on Ubuntu downloads and upgrades the bundle to the brand new model.

Autoclean clears the native repository of retrieved bundle information. However it solely removes information that may now not be downloaded and are successfully ineffective.

You may set your Cron to run the Ubuntu APT updates anytime. The instance above runs the improve on Sundays beginning at 17:00, then at 18:00 and eventually at 19:00.

Utilizing Ansible?

Ansible permits for straightforward automation. For instance, you’ll be able to add the next to your playbook to replace Ubuntu utilizing Apt and Cron:

duties:
    #
    # Add replace cron
    #
    - identify: Replace
      change into: sure
      become_method: sudo
      cron:
        identify: "replace"
        consumer: "root"
        weekday: "7"
        minute: "0"
        hour: "19"
        job: "/usr/bin/apt replace -q -y"
        state: current

    #
    # Add improve cron
    #
    - identify: Improve
      change into: sure
      become_method: sudo
      cron:
        identify: "improve"
        consumer: "root"
        weekday: "7"
        minute: "0"
        hour: "20"
        job: "/usr/bin/apt improve -q -y"
        state: current

    #
    # Add autoclean cron
    #
    - identify: Autoclean
      change into: sure
      become_method: sudo
      cron:
        identify: "autoclean"
        consumer: "root"
        weekday: "7"
        minute: "0"
        hour: "23"
        job: "/usr/bin/apt autoclean"
        state: current

Wrapping Up

You’ve got realized the variations between Apt updates utilizing Cron, the desktop GUI replace methodology, and Ubuntu’s unattended-upgrades script. As well as, you realized how one can replace, improve and auto-clean your Apt cache utilizing Cron in Ubuntu.

You Could Additionally Be In

Tags: AptCronUbuntuupdate
Previous Post

OpenText Mission and Portfolio Administration in motion: Actual how-tos, actual advantages, actual PPM

Next Post

Google’s Cloud Location Finder unifies multi-cloud location information

Next Post
Smaller machine varieties for A3 Excessive VMs with NVIDIA H100 GPUs

Google's Cloud Location Finder unifies multi-cloud location information

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Trending

Unifying VMs and Containers on a Single Platform

Unifying VMs and Containers on a Single Platform

April 11, 2025
Mastering Cybersecurity Regulation And Constructing Resilience In The Digital Age

Mastering Cybersecurity Regulation And Constructing Resilience In The Digital Age

June 29, 2025
Kubernetes ResourceQuota & LimitRange Instance Packages

Docker Lab & Project – Creating an Picture

July 1, 2025

Configuring and Allow Database Vault for CDB and PDB

April 24, 2025
Understanding 2024 cyber assault developments

Understanding 2024 cyber assault developments

April 25, 2025
Safe IOT machine uploads to Oracle Database through REST API

Safe IOT machine uploads to Oracle Database through REST API

March 26, 2025

MultiCloud365

Welcome to MultiCloud365 — your go-to resource for all things cloud! Our mission is to empower IT professionals, developers, and businesses with the knowledge and tools to navigate the ever-evolving landscape of cloud technology.

Category

  • AI and Machine Learning in the Cloud
  • AWS
  • Azure
  • Case Studies and Industry Insights
  • Cloud Architecture
  • Cloud Networking
  • Cloud Platforms
  • Cloud Security
  • Cloud Trends and Innovations
  • Data Management
  • DevOps and Automation
  • GCP
  • IAC
  • OCI

Recent News

Past Pilots: Reinventing Enterprise Working Fashions with AI

Past Pilots: Reinventing Enterprise Working Fashions with AI

July 20, 2025
Why Select Pre-Constructed DevOps Infrastructure to Scale back Your Time to Market

Why Select Pre-Constructed DevOps Infrastructure to Scale back Your Time to Market

July 20, 2025
  • About Us
  • Privacy Policy
  • Disclaimer
  • Contact

© 2025- https://multicloud365.com/ - All Rights Reserved

No Result
View All Result
  • Home
  • Cloud Architecture
    • OCI
    • GCP
    • Azure
    • AWS
    • IAC
    • Cloud Networking
    • Cloud Trends and Innovations
    • Cloud Security
    • Cloud Platforms
  • Data Management
  • DevOps and Automation
    • Tutorials and How-Tos
  • Case Studies and Industry Insights
    • AI and Machine Learning in the Cloud

© 2025- https://multicloud365.com/ - All Rights Reserved