Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Perform Software Updates on Linux Systems

Software updates are crucial for maintaining the security, stability, and performance of any operating system. In the Linux environment, managing software updates can be done efficiently through various package management systems. This article will guide you through the process of updating software on different Linux distributions, ensuring your system remains up-to-date and secure.

Examples:

Updating Software on Debian-based Systems (e.g., Ubuntu)

  1. Update Package Lists: Before installing updates, you need to refresh the package lists to ensure you have the latest information about available updates.

    sudo apt update
  2. Upgrade Packages: To upgrade all installed packages to their latest versions, use the following command:

    sudo apt upgrade
  3. Full Upgrade: For a more comprehensive upgrade that handles package dependencies and removes obsolete packages, use:

    sudo apt full-upgrade
  4. Automatic Updates: To enable automatic updates, you can install and configure the unattended-upgrades package:

    sudo apt install unattended-upgrades
    sudo dpkg-reconfigure unattended-upgrades

Updating Software on Red Hat-based Systems (e.g., CentOS, Fedora)

  1. Update Package Lists and Upgrade: For Red Hat-based systems, the yum or dnf package managers are used. To update the package lists and upgrade all packages, use:

    sudo yum update    # For CentOS/RHEL 7 and earlier
    sudo dnf update    # For Fedora and CentOS/RHEL 8 and later
  2. Automatic Updates: To enable automatic updates, you can install and configure the dnf-automatic package:

    sudo dnf install dnf-automatic
    sudo systemctl enable --now dnf-automatic.timer

Updating Software on Arch-based Systems (e.g., Arch Linux, Manjaro)

  1. Update Package Lists and Upgrade: Arch-based systems use the pacman package manager. To update the package lists and upgrade all packages, use:

    sudo pacman -Syu
  2. Automatic Updates: For automatic updates, you can create a cron job or systemd timer. Here's an example of a systemd timer:

    • Create a service file /etc/systemd/system/pacman-upgrade.service:

      [Unit]
      Description=Pacman System Upgrade
      
      [Service]
      Type=oneshot
      ExecStart=/usr/bin/pacman -Syu --noconfirm
    • Create a timer file /etc/systemd/system/pacman-upgrade.timer:

      [Unit]
      Description=Run Pacman System Upgrade Daily
      
      [Timer]
      OnCalendar=daily
      Persistent=true
      
      [Install]
      WantedBy=timers.target
    • Enable and start the timer:

      sudo systemctl enable --now pacman-upgrade.timer

Updating Software on SUSE-based Systems (e.g., openSUSE)

  1. Update Package Lists and Upgrade: For SUSE-based systems, the zypper package manager is used. To update the package lists and upgrade all packages, use:

    sudo zypper refresh
    sudo zypper update
  2. Automatic Updates: To enable automatic updates, you can configure zypper with a cron job or systemd timer. Here's an example of a systemd timer:

    • Create a service file /etc/systemd/system/zypper-upgrade.service:

      [Unit]
      Description=Zypper System Upgrade
      
      [Service]
      Type=oneshot
      ExecStart=/usr/bin/zypper update -y
    • Create a timer file /etc/systemd/system/zypper-upgrade.timer:

      [Unit]
      Description=Run Zypper System Upgrade Daily
      
      [Timer]
      OnCalendar=daily
      Persistent=true
      
      [Install]
      WantedBy=timers.target
    • Enable and start the timer:

      sudo systemctl enable --now zypper-upgrade.timer

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.