First time in my life I have something like this:

root@peklan:~# aptitude install git-core
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
FATAL -> Failed to fork.   

can somebody explain how to get rid of this message?

  • 1
    Because it is already installed? Not sure about the fork error though. What happens if you use apt-get? – Zoredache Jun 25 '12 at 0:22
  • ok so question then what's that message about? – holms Jun 25 '12 at 0:24
  • Oddly, I followed a tutorial that uses apt install but the command apt-get install works – Dean Meehan Feb 27 '17 at 22:00

that error message generally means aptitude or apt-get ran out of memory.

some suggestions:

  • if it's a VM, try increasing the RAM allocated to it. if it's a physical machine, try upgrading RAM.

    • if you've got some big memory hungry programs running (e.g. iceweasel, chromium, openoffice) then try killing them. in fact, if you're logged in with X, try logging out and running your upgrade from a text console or over an ssh session.
  • if you've got lots of deb and deb-src entries in your sources.list file(s), then try commenting out most of them, running 'apt-get update', and 'apt-get install git-core'.

(definitely comment out all the deb-src entries unless you frequently rebuild debian source packages for some reason - most people don't.)

  • i'm not sure if it will help (probably won't), but you might also want to look at the Cache-Limit setting. see the man page for apt.conf for details, but in short add something like the following to /etc/apt/apt.conf or to a new text file in /etc/apt/apt.conf.d:

    APT { Cache-Limit "56777216";} };

  • I added a note to the bottom of the known bug concerning apt xapian indexing, which may automatically be happening at the end of the aptitude operation, reference Ubuntu bug 363695 – maxpolk Jan 5 '13 at 16:12
  • 1
    I'm running a VPS with a fixed memory, stopping nginx, mysql and php before the upgrade worked, wrote it as a one line to make it return services back on as fast as possible. – Mohammad AbuShady Mar 4 '14 at 12:38
  • Thanks! I ran into this for the first time in my life as well, using a VM. I just up'd the memory and the problem vanished. You'd think APT would have the courtesy to at least give an "Out of Memory" error instead. :-[ – Dave Apr 11 '20 at 4:13

You can also add swap memory before you attempt to install the package.

You can add 512Mb swap by executing:

curl -sSL https://manageacloud.com/api/cm/configuration/activate_swap/ubuntu/manageacloud-production-script.sh | bash
  • This is downloading and executing some shell script. Could you explain what this does on your machine? – Akkumulator Sep 11 '15 at 17:26
  • @Akkumulator it is a public configuration that activate swap – Tk421 Sep 13 '15 at 7:45
  • Yea, but it also does a bunch of other stuff, like cp /tmp/manageacloud/.manageacloud.sh /tmp/manageacloud/vcs/ and apt-get install -q git. Not sure if that's what I want if I only want a swapfile. – Akkumulator Sep 13 '15 at 8:28
  • @Akkumulator this is a generic template to implement many different configurations. This one is very simple and you can copy/paste if you prefer. .manageacloud.sh is the script that contains the code to activate swap. I agree that the generic script if it is not using git it should not install it. Anyway, it is not harmful. Use whatever is better for you. I will open a request to optimize the generic template. – Tk421 Sep 13 '15 at 8:52
  • There is a step-by-step guide on how to add swap space: linuxize.com/post/how-to-add-swap-space-on-debian-10 – Coconut Oct 4 '20 at 7:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.