First, I'd start by throwing out the sugar you have in the house...all of it! Are they getting into any other food in the cupboard where you store your sugar? Toss any of that too. And clean out everything else. Wipe down all the counters and cupboard shelves and outsides of any other containers you have with a bleach solution. Vacuum thoroughly...use the hose attachment to vacuum inside the cabinets and under fridge and stove, etc, to remove any stray ants and food crumbs they may thrive on. If you have carpet in the kitchen, now is a good time to do a thorough steam cleaning (the ants could have a trail through carpet that you can't see).
Then, get jars with the rubber seals (like old-fashioned canning jars, but you can find plastic cannisters like that too). Since you already have an existing problem, I'd go for double sealing any dry foods, including sugar and flour. Put a ziploc type bag inside the jar, seal the sugar (or other food) inside that, then seal the jar (or you can do it the other way around...seal the jar inside a ziploc bag if you have a large enough bag to do it that way). Whenever you do anything in the kitchen, you'll have to be meticulous about cleaning up after yourself, making sure nothing is left spilled on the counters that can nourish returning or missed ants.
rewebster's point of spraying the baseboards and foundation is good too, as well as inside window and door frames (easy places for ants to sneak in), some of the ground around the house, and around the places where any water or gas lines come in through the walls. If there are gaps around the water lines, get some of that foam sealer spray stuff (comes in a can) and squirt it in there to seal the spaces off. These are the most common ways that "critters" find their way into kitchens. If that doesn't resolve the problem, you may need to hire an exterminator with stronger insecticides and who can inject it into walls or other places they are coming in (that may require cleaning out the entire kitchen to allow an exterminator to spray the whole place and do a thorough job without contaminating food, plates, etc., and if you need to go to that extreme, you'll probably need to plan a few days stay someplace other than your home while the pesticides air out, and then another day to clean the surfaces in your kitchen of residue before you put anything back...at that point, I'd throw away anything that's not canned food so you don't bring back any stow aways to repopulate.)