Linux – Prevent apt-check from eating all the memory

aptlinuxUbuntuubuntu-12.04

On Ubuntu 12.04 LTS, with server of 512MB RAM, the apt-check is using up to 250 memory and cause my system to un-usable every night, e.g.

ps ax | grep apt
14895 ?        DN     0:02 /usr/bin/python /usr/lib/update-notifier/apt-check --human-readable
14896 ?        DN     0:02 /usr/bin/python /usr/lib/update-notifier/apt-check --human-readable
14899 ?        DN     0:02 /usr/bin/python /usr/lib/update-notifier/apt-check --human-readable
14902 ?        DN     0:02 /usr/bin/python /usr/lib/update-notifier/apt-check --human-readable
14906 ?        DN     0:02 /usr/bin/python /usr/lib/update-notifier/apt-check --human-readable
14912 ?        DN     0:02 /usr/bin/python /usr/lib/update-notifier/apt-check --human-readable
14913 ?        DN     0:02 /usr/bin/python /usr/lib/update-notifier/apt-check --human-readable
14914 ?        DN     0:01 /usr/bin/python /usr/lib/update-notifier/apt-check --human-readable
14915 ?        DN     0:01 /usr/bin/python /usr/lib/update-notifier/apt-check --human-readable
14916 ?        DN     0:02 /usr/bin/python /usr/lib/update-notifier/apt-check --human-readable
14917 ?        DN     0:01 /usr/bin/python /usr/lib/update-notifier/apt-check --human-readable
14920 ?        DN     0:02 /usr/bin/python /usr/lib/update-notifier/apt-check --human-readable
15299 ?        DN     0:01 /usr/bin/python /usr/lib/update-notifier/apt-check --human-readable
15302 ?        DN     0:02 /usr/bin/python /usr/lib/update-notifier/apt-check --human-readable
16368 pts/0    D+     0:00 grep apt

What the heck this script is running multiple time and eating my system resource? There is a bug here [1] which is confirmed but without any resolution. I am a little surprised that this bug is critical and exists in the LTS, sigh…

Anyway, Not sure when the ubuntu team is able to fix, Any idea how to do it by us?

[1] https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/746508

Best Answer

Disable update-notifier

If you want to disable update-notifier, you can follow instruction in this link.

Modified Quote from link

  1. Method 1 - Disable for one user

    Create a local(user) copy of update-notifier.desktop

    mkdir -p ~/.config/autostart
    cp /etc/xdg/autostart/update-notifier.desktop ~/.config/autostart/
    vim ~/.config/autostart/update-notifier.desktop
    

    Find this line in the local file

    X-GNOME-Autostart-Delay=60
    

    Replace with:

    X-GNOME-Autostart-enabled=false
    

    Now log out and in again, or kill the running update-notifier:

    killall update-notifier
    
  2. Method 2 - Disable for all users

    Do the same as method 1, but instead of modifying a local/user copy, modify /etc/xdg/autostart/update-notifier.desktop

Manually Check for update

After disabling update-notifier, use Update Manager(GUI), or following command line to check for package update

sudo apt-get update
sudo apt-get dist-upgrade

The first line download the latest package list from repository. The second line will show all installed packages with update available.

Related Topic