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

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’ 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.

Popularity: 49% [?]

Categories: Technical Tags:
  1. November 16th, 2006 at 14:43 | #1

    Well it didnt work for me. :-(

  2. November 16th, 2006 at 14:48 | #2

    Sorry it worked with the following value :

    APT::Cache-Limit “16777216″;

  3. November 16th, 2006 at 14:50 | #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. December 4th, 2006 at 12:01 | #4

    Awesome, worked great for me!! Thanks!

  5. Ko
    December 17th, 2006 at 19:49 | #5

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

  6. Andrew
    January 18th, 2007 at 23:13 | #6

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

  7. January 25th, 2007 at 14:29 | #7

    20M works for me while 10M not.

  8. robin
    February 9th, 2007 at 22:28 | #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″;
    robin

  9. adam
    February 17th, 2007 at 00:36 | #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. February 17th, 2007 at 01:01 | #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
    April 9th, 2007 at 12:19 | #11

    Thanks!

  12. _!_
    April 17th, 2007 at 22:08 | #12

    stupid..

  13. April 17th, 2007 at 22:26 | #13

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

  14. paul
    April 21st, 2007 at 12:28 | #14

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

  15. paulo
    April 22nd, 2007 at 18:13 | #15

    Good. Thanx.

  16. kawaisunn
    May 3rd, 2007 at 12:50 | #16

    Yet another heartfelt Thank You!

  17. greg
    May 20th, 2007 at 20:00 | #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. laliv
    May 23rd, 2007 at 19:35 | #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. esk
    June 6th, 2007 at 16:29 | #19

    10x so much – it work!

  20. October 5th, 2007 at 03:49 | #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,

    Cheers,

    Free Software, Free Society

    ?+
    mx

  21. Augustin
    October 22nd, 2007 at 19:08 | #21

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

  22. February 12th, 2008 at 18:34 | #22

    Worked like a charm! Thanks!

  23. jayaraj
    February 27th, 2008 at 04:00 | #23

    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
    September 2nd, 2008 at 12:37 | #24

    “LC_ALL=C aptitude” worked for me.

  25. October 1st, 2008 at 13:52 | #25

    Hey, worked just great!

  26. foobar
    February 10th, 2009 at 14:38 | #26

    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

    odd

  27. November 8th, 2009 at 14:25 | #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…

  1. No trackbacks yet.