Saturday, December 10, 2011

Error message: apt-mirror is already running

I'm setting up a private mirror of Debian "wheezy" ("testing") and, in a fit of numb-wittedness, I didn't change the location of the /var/spool/apt-mirror directory - so it was in a partition with insufficient free disk space. After a short time of mirroring, the partition filled up and apt-mirror failed with a "disk full" error.

After moving the partial mirror over to a larger partition and doing "ln -si" to create a symbolic link, I tried running the apt-mirror command again. It failed with the following message:
# su - apt-mirror -c apt-mirror
apt-mirror is already running
Now, of course, this was not true; apt-mirror was not running. After some digging, I found the answer over at Ubuntu Forums:

Quoting Stephen Lilley's contribution to that thread:
Bug #424462 this bug is already discussed at

it has given the following solution
"the case for this error message is that file:
was not deleted on apt-mirror exit.
If you delete apt-mirror.lock file, then apt-mirror will run OK"
I note that Bug #424462 referred to the lock file not getting deleted upon the user terminating the mirroring operation with CTRL-C. In the version of apt-mirror I'm using (0.4.8-4), that bug has been corrected. However, the same bug raises its head when the apt-mirror script aborts due to the disk filling up.

No comments:

Post a Comment