0

I am repeatedly seeing the apt-get update/install process leading to a situation in which /usr/lib/apt/methods/https eats up the system's memory and as a result the OS oom killer is triggered. The OOM killer kills off the https process and the apt-get operation fails.

I'm running on EC2 t2.smalls and t2.mediums.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.2 LTS
Release:    14.04
Codename:   trusty
$ uname -a
Linux stage-app1 3.13.0-48-generic #80-Ubuntu SMP Thu Mar 12 11:16:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Mark Koch
  • 1
  • 1
  • If this can be reproduced reliably on a test system, then please file a bug report. The developers did not intend apt to consume the entire system's RAM. – user535733 Mar 27 '19 at 03:06

4 Answers4

0

OOM killer is triggered when your instance runs out of ram so clearly you have to little of it for what you want to do.

You have two ways of solving this.

  1. Decreasing the amount of ram consumed during your apt-* work by stopping all memory consuming services before doing the upgrades etc.

  2. Adding / Increasing a swap to your instance to off-load memory to disk You can see this question regarding adding swap in ubuntu if you aren't certain

tomodachi
  • 14,832
0

Workaround: Revert back to previous apt-transport-https.

$ sudo apt-get install -y --force-yes apt-transport-https=1.0.1ubuntu2

When I did this I no longer saw issues with /usr/lib/apt/methods/https consuming the machines memory, and OOM killer didn't have to do it's job.

Mark Koch
  • 1
  • 1
0

Suffered the same that OP. Fixed doing:

wget http://archive.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.0.1ubuntu2.19_amd64.deb
dpkg -i apt_1.0.1ubuntu2.19_amd64.deb
aptitude update
aptitude upgrade

After that, apt works as normal and OOM doesn't kill anymore. BTW, I've unatended upgrades ON, so maybe some kind of mid-install caused this :S

0

It seems that apt-get update is simply very greedy in terms of memory (for an explanation, see Why does "apt-get .update" increase memory usage significantly?).

I have had the same problem on a 1GB machine where the https process(es) would eat up all memory and eventually get killed. In my case there weren't other processes consuming a significant amount of memory so tomodachi's answer was not applicable.

I was able to eventually run the command to completion through a combination of the following:

  • editing the /etc/apt/sources.list file, reducing the number of sources
  • running aptitude update to preprocess/deduplicate the sources as far as possible before launching apt-get update

And still then just barely...