Lima is the capital and largest city of Peru. It's a major transportation hub in Peru, and it is difficult to travel from the north of Peru to the south without passing through Lima.
The best place to hitch a ride north is the Ancon Tollbooth. Take any bus going to Huaral and ask to get of off at the peaje Ancon. Alternatively, there are micros that go to Ancon, but they will drop you off at a truck weigh station, a few kilometers before the tollbooth. You can try hitching from there or ask any truck to take you to the tollbooth.
All trucks and buses heading north use this tollbooth to leave Lima.