With any camera, the first thing you want to do is set the ISO to the lowest setting - this will not only yield the cleanest, most noise-free results, but will also force even an auto mode camera to take a longer exposure to absorb more light. If you happen to have a camera with a manual or Priority mode, use that instead - in Aperture Priority, you'll want to start off with a fairly small aperture such as F8, and the lowest ISO setting, and let the camera choose the necessary shutter speed.

Using a small aperture on a compact camera is not necessary, and can possibly be detrimental. A wider aperture won't affect the depth of field in a cityscape, but F/8.0 is often the smallest available aperture on compacts, and may exhibit more diffraction and a less sharp image.

Fair point - thank you. I haven't used a compact in a while so I forgot that many of them have F8 as their smallest aperture. Certainly something in the middle range of a given camera's aperture range should be fine. I only mentioned a smaller aperture for compact cameras that might not have a full manual mode, or a shutter priority mode - just enough to force a longer shutter speed.