Flux

Is there any alternative to flux? Does Vaseline or petroleum jelly work?

No. You've got to have flux. Most electronic solder (different from plumbing solder) has a flux core (or if you have solder paste it's mixed-in) so you don't always need additional flux.

There's rosin based flux, and there is water soluble flux and "no clean" flux.

SagarDev:
Is there any alternative to flux? Does Vaseline or petroleum jelly work?

No. The main purpose of flux is to act as a cleaner for the soldering process, so that the solder will properly "wet" the joint. Petroleum jelly is a grease - not good for such purposes.

Standard flux-core solder should work for most hobbyist soldering and re-work needs. If all you are doing is thru-hole work, you should not need anything else.

If you are wanting a cheaper source for liquid flux and need larger quantities - but don't want to pay the higher prices for the luxury - there is a solution:

Search instructables for "diy liquid flux" - in short, what you will find is that to make liquid flux, you get a container for storing the flux, then fill it with methanol (from the hardware store) or ethanol (everclear from the liquor store). Then, crush up some pine rosin flux (you can get this as a powder for bowling - or you can get it as a block used for string instruments like violins - look on amazon) and add a bit to the alcohol. Put on a tight lid and shake; let it sit and dissolve - shake some more. Recipes and amounts will vary; you'll need to experiment - but in the end, you'll get a nice liquid flux - be sure to mark the container you are storing it in "poisonous" - especially if you used methanol as the solvent! To dispense it, use a syringe with a blunt cannula attached.

Paste could probably be made the same way, but you'd have to increase the ratio of flux to solvent, so it is less "liquid" - the problem would be storage, as it would probably dry out fairly quickly unless sealed tightly.

Lastly - if you are looking for "solder bearing flux" (liquid or paste) - that probably can't be homebrewed.

The role of flux is to be a reducing agent when hot, stealing the oxygen from any metal oxides
that are forming, making compounds which are repelled by the molten metals, thus allow pure
metal surfaces to meet free from oxide films. Without a flux its very hard to get metal-to-metal
contact (wetting).