Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

askthedev.com Logo askthedev.com Logo
Sign InSign Up

askthedev.com

Search
Ask A Question

Mobile menu

Close
Ask A Question
  • Ubuntu
  • Python
  • JavaScript
  • Linux
  • Git
  • Windows
  • HTML
  • SQL
  • AWS
  • Docker
  • Kubernetes
Home/ Questions/Q 17370
Next
In Process

askthedev.com Latest Questions

Asked: September 27, 20242024-09-27T14:18:47+05:30 2024-09-27T14:18:47+05:30In: Ubuntu

How can I stop unattended upgrades or any other process utilizing APT on Ubuntu 18.04 or a later version?

anonymous user

I’ve been wrestling with an issue on my Ubuntu 18.04 machine and could really use some advice. So, here’s the deal: I have this running system that I need to keep stable for a project I’m working on, but I’ve noticed that unattended upgrades are updating my packages automatically when I least expect it. You know how it is—I’m in the middle of an important task, and suddenly I get those pesky notifications about updates, or worse, my system tries to restart after an upgrade. It’s super frustrating, and I need a reliable way to stop APT processes from running unattended.

I’ve dabbled with a few things like editing the `unattended-upgrades` configuration file and switching off the automatic updates. But honestly, things seem to be getting a bit overwhelming, and I don’t want to break anything in the process. It’s not just about the unattended upgrades either; I’ve had issues with other processes using APT, like when I’m trying to install software or clean up my system with `apt-get autoremove`, and the package manager is locked up because something else is running.

I read something about the `APT::Periodic::AutocleanInterval` setting, but I’m not 100% sure where to go next. Is there a command or perhaps a setting I can tweak so that I regain control over my updates?

Additionally, are there any recommendations for checking if something else is utilizing APT at that moment? I’d hate to restart the system or mess something up because I wasn’t sure what was running.

Has anyone dealt with this before? What’s worked for you? I’d really appreciate any insights or steps you could share to help keep my system from springing these surprise updates on me during critical work. Thanks!

  • 0
  • 0
  • 2 2 Answers
  • 0 Followers
  • 0
Share
  • Facebook

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Continue with Google
    or use

    Forgot Password?

    Need An Account, Sign Up Here
    Continue with Google

    2 Answers

    • Voted
    • Oldest
    • Recent
    1. anonymous user
      2024-09-27T14:18:49+05:30Added an answer on September 27, 2024 at 2:18 pm

      To manage unattended upgrades on your Ubuntu 18.04 machine, you can start by disabling them completely to regain control over your package updates. Edit the `unattended-upgrades` configuration file located at `/etc/apt/apt.conf.d/20auto-upgrades`. You can achieve this by running the command:
      sudo nano /etc/apt/apt.conf.d/20auto-upgrades.
      In this file, you should find the lines:
      AAPT::Periodic::Enable: "1";
      and
      AAPT::Periodic::Update-Package-Lists: "1";
      Change these values to "0" to disable automatic updates. Additionally, visit the `/etc/apt/apt.conf.d/50unattended-upgrades` file to fine-tune which packages are automatically updated by commenting out any relevant lines. This should greatly minimize unexpected updates.

      For issues related to APT being locked by other processes, you can check which process is using it by executing:
      sudo lsof /var/lib/dpkg/lock
      or
      ps aux | grep apt.
      This will show a list of processes that are currently using APT. If you wish to prevent any locking issues while performing maintenance tasks like apt-get autoremove, consider using sudo dpkg --configure -a to ensure any incomplete operations are finalized. If you determine that an unwanted process is using APT, you can either wait for it to finish or stop it cautiously using its PID with sudo kill . Always ensure that you have backups and are aware of what processes you stop to avoid potential system instability.

        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    2. anonymous user
      2024-09-27T14:18:49+05:30Added an answer on September 27, 2024 at 2:18 pm

      Sounds like you’re having a pretty frustrating time with those automatic updates in Ubuntu! It’s like they know when you’re in the zone and decide to pop up with their notifications. Here’s a way to get a handle on it:

      Disable Unattended Upgrades

      You can disable unattended upgrades altogether. Open your terminal and run this command:

      sudo dpkg-reconfigure -f noninteractive unattended-upgrades

      When prompted, just choose not to enable automatic updates. This should stop your system from grabbing updates without your say-so.

      Edit Config File

      If you’d rather keep some updates but want to limit them, you can edit the unattended-upgrades configuration file. Here’s how:

      sudo nano /etc/apt/apt.conf.d/20auto-upgrades

      Look for these lines:

      Apt::Periodic::Update-Package-Lists "1";
      Apt::Periodic::Unattended-Upgrade "1";

      Change their values to “0” to disable them:

      Apt::Periodic::Update-Package-Lists "0";
      Apt::Periodic::Unattended-Upgrade "0";

      APT Lock Issues

      For the locked APT issue when trying to install or remove packages, you can check if any APT processes are running using:

      ps aux | grep apt

      This will show you if there’s anything actively using APT. If you see a running process that you didn’t start, it might be the culprit.

      Cleaning Up

      As for the APT::Periodic::AutocleanInterval, that’s more about cleaning up old packages than about stopping updates. You can tweak it by editing:

      sudo nano /etc/apt/apt.conf.d/10periodic

      You can set it to a higher number or even to “0” to disable autocleaning.

      Final Tip

      Just to be on the safe side, it’s a good idea to backup your files before making big changes. Just to keep things stable while you play around with the settings!

      Good luck, and hopefully, these steps help! Just take it slow, and you’ll find the balance between stability and updates.

        • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp

    Related Questions

    • I'm having trouble installing the NVIDIA Quadro M2000M driver on Ubuntu 24.04.1 LTS with the current kernel. Can anyone provide guidance or solutions to this issue?
    • What steps can I take to troubleshoot high usage of GNOME Shell in Ubuntu 24.04?
    • I recently performed a fresh installation of Ubuntu 24.04, and I've noticed that my RAM usage steadily increases over time until my system becomes unresponsive. Has anyone experienced this issue ...
    • How can I resolve the "unknown filesystem" error that leads me to the GRUB rescue prompt on my Ubuntu system?
    • I'm experiencing an issue with Ubuntu 24.04 where Nautilus fails to display the progress indicator when I'm copying large files or folders. Has anyone else encountered this problem, and what ...

    Sidebar

    Related Questions

    • I'm having trouble installing the NVIDIA Quadro M2000M driver on Ubuntu 24.04.1 LTS with the current kernel. Can anyone provide guidance or solutions to this ...

    • What steps can I take to troubleshoot high usage of GNOME Shell in Ubuntu 24.04?

    • I recently performed a fresh installation of Ubuntu 24.04, and I've noticed that my RAM usage steadily increases over time until my system becomes unresponsive. ...

    • How can I resolve the "unknown filesystem" error that leads me to the GRUB rescue prompt on my Ubuntu system?

    • I'm experiencing an issue with Ubuntu 24.04 where Nautilus fails to display the progress indicator when I'm copying large files or folders. Has anyone else ...

    • How can I configure a server running Ubuntu to bind specific IP addresses to two different network interfaces? I'm looking for guidance on how to ...

    • Is it possible to configure automatic login on Ubuntu MATE 24.04?

    • After upgrading from Ubuntu Studio 22.04 to 24.04.1, I lost all audio functionality. What steps can I take to diagnose and resolve this issue?

    • I am experiencing issues booting Ubuntu 22.04 LTS from a live USB. Despite following the usual procedures, the system fails to start. What steps can ...

    • I'm encountering a problem with my Expandrive key while trying to update my Ubuntu system. Has anyone else faced similar issues, and if so, what ...

    Recent Answers

    1. anonymous user on How do games using Havok manage rollback netcode without corrupting internal state during save/load operations?
    2. anonymous user on How do games using Havok manage rollback netcode without corrupting internal state during save/load operations?
    3. anonymous user on How can I efficiently determine line of sight between points in various 3D grid geometries without surface intersection?
    4. anonymous user on How can I efficiently determine line of sight between points in various 3D grid geometries without surface intersection?
    5. anonymous user on How can I update the server about my hotbar changes in a FabricMC mod?
    • Home
    • Learn Something
    • Ask a Question
    • Answer Unanswered Questions
    • Privacy Policy
    • Terms & Conditions

    © askthedev ❤️ All Rights Reserved

    Explore

    • Ubuntu
    • Python
    • JavaScript
    • Linux
    • Git
    • Windows
    • HTML
    • SQL
    • AWS
    • Docker
    • Kubernetes

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.