You can put 2x4 blocking between it and the wall and screw together. You can screw through the adjoining face frames and screw them together (as all cabinets are supposed to be connected anyway). You can screw 1x3 strapping across the top of all of your cabinets that will then be covered by your counter (assuming you are talking about base and not wall cabinets for this one). If it is base cabinet then anything will do just to hold it into place until you get your counter on and then you can screw up through into the underside of the counter (don't go all the way through) or just use adhesive calking between cabs and counter. If a wall cabinet you could also put screws through to the ceiling or soffit if the top butted to it. For base cabinets, primarily people shim under nice and level and screw through the face frames or carcasses.