In Chicago (aka Daleyville on the Lake) you can buy and own long guns, but you're supposed to register them.
Handguns may be owned, but they have to be registered. And Chicago stopped registering handguns decades ago, a deliberate Catch-22.
FWIW, when I lived there, Chicago's registration laws were probably ignored more than speed limits on the expressways. The state requires a "Firearms Owner's ID" card, with which you can buy a gun anywhere in the state, without violating state law. Suburban gunshops are common outside Chicago city limits. Need I say more?
Of course, you can always become an alderman. Then you'll be issued a permit to carry a concealed weapon in the city, since you won't be a mere member of the lowly proletariat any more.