13

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?

holms
  • 1,524
  • 7
  • 20
  • 37

2 Answers2

16

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";} };

cas
  • 6,783
  • 32
  • 35
  • 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](https://bugs.launchpad.net/ubuntu/+source/apt-xapian-index/+bug/363695) – maxpolk Jan 05 '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 04 '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 04:13
1

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
Tk421
  • 230
  • 1
  • 8
  • 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](https://manageacloud.com/configuration/activate_swap) – Tk421 Sep 13 '15 at 07: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 08: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 08:52
  • There is a step-by-step guide on how to add swap space: https://linuxize.com/post/how-to-add-swap-space-on-debian-10/ – Coconut Oct 04 '20 at 07:12