Valery's Mlog

Mindlog of a Freak
November 13th, 2006 by Valery Dachev

apt-get: “E: Dynamic MMap ran out of room”

This post is to remind me about what to do in this case without using Google. So do you get something like:

Reading Package Lists… Error!
E: Dynamic MMap ran out of room

while using apt-get on your Debian/Ubuntu/etc. box ? It seems repositories have become so fat that apt‘s cache is not enough to work with them. There’s a workaround for this problem – just add the following line in /etc/apt/apt.conf or add a new file in /etc/apt/apt.conf.d containing it:

APT::Cache-Limit "20000000";

This value worked for me. It should work now too if the limit is not overriden elsewhere in one of the locations mentioned above. If it doesn’t, increase it. Here is what it does (according to apt.conf(5)):

APT uses a fixed size memory mapped cache file to store the "available&uot; information. This sets the size of that cache (in bytes).

Kewl ! It doesn’t mean it eats my memory – just ~20Mb my disk space. That’s OK.


27 Responses to “apt-get: “E: Dynamic MMap ran out of room””
  1. Well it didnt work for me. :-(

  2. Sorry it worked with the following value :

    APT::Cache-Limit “16777216”;

  3. It’s strange it worked with a lower value. This maybe because of a low disk space. Are you sure made it 20 Mb the previous time instead of 2Mb ?

  4. Awesome, worked great for me!! Thanks!

  5. Got so frustrated, But now it’s fixed. Thanks for your clear explaination.

  6. Andrew says

    Yes, finally I found a solution to this problem! Thanx!

  7. 20M works for me while 10M not.

  8. For me it worked having a 70debconf file within /etc/apt/ap.conf.d and filling it with
    DPkg::Pre-Install-Pkgs {“/usr/sbin/dpkg-preconfigure –apt || true”;};
    APT::Cache-Limit “83886080”;

  9. my .conf was in /etc/apt/apt.conf.d and the file i had to change was “20archive” . It got angry at me for some reason when i changed “70debconf”. same line worked, though: APT::Cache-Limit “20000000”;

  10. @xavierliu: I suppose Apt needs more cache because you have too many Apt sources…

    @robin & adam: In general it’s a better idea to create a new file in this directory as existing ones could be easily overwritten during further upgrades. Files in /etc/apt/apt.conf.d (and almost all *.d directories) are loaded in alphanumeric order one by one. This means a setting in “70debconf”, for example, would override a setting in “20archive”. If you create a new file called “99custom” the chance is this setting won’t be overridden.

  11. Anders says


  12. stupid..

  13. @_!_: I really do appreciate your comment, too. :) And I’m also glad to address you by name. :)

  14. Your solution is superb. Thought I was in for a major repair job!! Many thanks

  15. Good. Thanx.

  16. kawaisunn says

    Yet another heartfelt Thank You!

  17. yay finally got it to work… i had to log in as root and add that line to /etc/apt/apt.confd/20archive.

    Im sure there is a way to do this without logging out and then back in as root but i don’t know how.

  18. Thanks!!!! It works fine with both: “70debconf” or a new one “90perso”
    I use the next value: APT::Cache-Limit “20000000”;
    I am working on linux Mint ;-)

  19. 10x so much – it work!

  20. This issues arises when there is many differents repositories (stable,testing,unstable,sid, multimedia on my box). Another way to solve it, is to remove unused repositories in source list and keep Cache-Limit default value.

    Thanks, anyway for your post,


    Free Software, Free Society


  21. Augustin says

    It worked for me well, but I neede to change the number to 100000…

  22. Worked like a charm! Thanks!

  23. jayaraj says

    Wow! 20M configuration worked :)
    But any lower value dint work for me…
    i feel it varies from situation to situation..
    all the time we may not needs 20M cache! Thats why lower value works for some ppl!
    Thanks a lot :)

  24. Jan Cecik says

    “LC_ALL=C aptitude” worked for me.

  25. Hey, worked just great!

  26. foobar says

    i’d like too add a few notes as this left me puzzled for quite a while

    apt.conf is interpreted after all the files in apt.conf.d (checked with strace )
    and most strangely if a configuration value is present in any of these files setting the value via command line is ignored


  27. Putting 20M (20000000) for the cache value into 70debconf worked for me too. It seems silly that this is still a problem in Debian today, I don’t understand why the size of the cache is not dynamic. Incidentally, I’ve not run into this problem with Ubuntu Server, which is also apt based…

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: