How to overcome emerge lock file hindrance

In this article I will show how you can overcome some hindrance pose by the Gentoo package manager emerge. I was recently trying get latest stable firefox from the repo and got this lock file error to fetch it.
Say you are emerging a package and all of sudden due to various reason it has interrupted. Now next time you try to emerge the same piece of software and you get a line saying ” waiting for the the lock file.…” and wait infinitum.

Now what was the cause off it? As it was interrupted previously,so it cannot go and do the emerging.It is good feature built into emerge.So it gives indication that something going wrong.What would be the first action?to delete the file as the path will be clearly shown by the package manager.If you delete that file and re-emerge that software you get same error.Because it is not fulfilling the package manager requirements.

So you need to do the below thing at the terminal:

bhaskar@bhaskar-laptop_23:33:26_Tue Feb 08:~> sudo emerge -f packagename

Yep! you got it right ;that “-f” stand for “fetch“,means it will re-fetch it from the repo,but from the place where it was interrupted. Clear??

Here is clue straight out of the emerge manual and it says,

-fetchonly (-f)
Instead of doing any package building, just perform fetches for all packages (fetch things from SRC_URI based upon USE setting).

Now before that you need to check whether two emerge are trying to run concurrently..if not then go and remove /var/tmp/portage,which probably preventing you from fetching.Once you are done with clean up the mentioned dir then run the above mentioned command will fetch thing normally.

Hope this will help.