We consider collisional studies of linear polyatomic ions immersed in ultracold atomic gases and investigate the intermolecular interactions and chemical reactions of several molecular anions (OH − , CN − , NCO − , C2H − , C4H − ) with alkali-metal (Li, Na, K, Rb, Cs) and alkaline-earth-metal (Mg, Ca, Sr, Ba) atoms. State-of-the-art ab initio techniques are applied to compute the potential energy surfaces (PESs) for these systems. The coupled cluster method restricted to single, double, and noniterative triple excitations, CCSD(T), is employed and the scalar relativistic effects in heavier metal atoms are modeled within the small-core energy-consistent pseudopotentials. The leading long-range isotropic and anisotropic induction and dispersion interaction coefficients are obtained within the perturbation theory. The PESs are characterized in detail and their universal similarities typical for systems dominated by the induction interaction are discussed. The two-dimensional PESs are provided for selected systems and can be employed in scattering calculations. The possible channels of chemical reactions and their control are analyzed based on the energetics of reactants. The present study of the electronic structure is the first step towards the evaluation of prospects for sympathetic cooling and controlled chemistry of linear polyatomic ions with ultracold atoms.