5

I was updating a slightly out of date server with yum update and ran into memory issues. It appears that yum requires enough free RAM to download each package.

Updating single packages was not a problem, as most individual packages fit in memory by themselves. However, updating all packages in one operation was not possible, because yum appears to download all the packages into RAM first, at the same time. This meant that the first several dozen packages would download, but at some point they would stop downloading and every subsequent package would give memory errors, even though the individual packages were very small. The total download size was larger than the amount of free RAM even after stopping all services.

My solution was to go through manually and pick out the largest packages and update them first. This let me get the remaining packages to total less than the amount of free RAM. But there has to be a better way.

Why can't yum download each file individually and save them to disk? When updating large numbers of packages, the requirement that all the downloads must fit into RAM at the same time is kind of silly. It could download them to disk first, and then it would have more than enough RAM to install the individual packages. Updating all, if done properly, should use no more memory than updating the largest single package. In other terms, if three dependency-free packages need A, B, and C amounts of RAM to be updated, the memory usage of yum should be max(A,B,C) and NOT A+B+C.

Is there a way to do this, or is this just a shortcoming of yum?

Others have told me that yum doesn't download to RAM. I'm not quite sure, then, why it only downloads packages until RAM is full and then stops. The download location for yum is not on a RAM disk, and there is plenty of free disk space. The question still remains.

2
  • 2
    I've been running into this problem recently using Centos7 on AWS 'nano' EC2 instances (512MB of RAM). The only workaround is to kill off any non essential processes prior to running yum update. I can't understand why Yum should need hundreds of MB!
    – IanB
    Commented Feb 5, 2019 at 9:29
  • I have the same problem on an EC2 instance with 1GB of RAM running a java web app capped at 512MB. Apparently the memory left is not enough for yum, which kills my web app every night..
    – Vlad
    Commented Jan 22, 2021 at 9:11

0

You must log in to answer this question.

Browse other questions tagged .