Aims. We aim to better understand the imprints that the nuclear activity in galaxies leaves in the molecular gas. Methods. We used the IRAM 30 m telescope to observe the frequency range ∼[86−116] GHz towards the central regions of the starburst galaxies M 83, M 82, and NGC 253, the galaxies hosting an active galactic nucleus (AGN) M 51, NGC 1068, and NGC 7469, and the ultra-luminous infrared galaxies (ULIRGs) Arp 220 and Mrk 231. Assuming local thermodynamic equilibrium (LTE), we calculated the column densities of 27 molecules and 10 isotopologues (or their upper limits in case of non-detections).Results. Among others, we report the first tentative detections of CH 3 CHO, HNCO, and NS in M 82 and, for the first time in the extragalactic medium, HC 5 N in NGC 253. Hα recombination lines were only found in M 82 and NGC 253. Vibrationally excited lines of HC 3 N were only detected in Arp 220. CH 3 CCH emission is only seen in the starburst-dominated galaxies. By comparison of the fractional abundances among the galaxies, we looked for the molecules that are best suited to characterise the chemistry of each group of galaxies (starbursts, AGNs and ULIRGs), as well as the differences among galaxies within the same group. Conclusions. Suitable species for characterising and comparing starburst galaxies are CH 3 OH and HNCO as tracers of large-scale shocks, which dominate early to intermediate starburst stages, and CH 3 CCH, c-C 3 H 2 , and HCO as tracers of UV fields, which control the intermediate-to-old or post starburst phases. M 83 shows signs of a shock-dominated environment. NGC 253 is characterised by both strong shocks and some UV fields. M 82 stands out for its bright photo-dissociated region tracers, which indicate an UV fielddominated environment. Regarding AGNs, the abundances of HCN and CN (previously claimed as enhanced in AGNs) in M 51 are similar to those in starburst galaxies, while the HCN/HCO + ratio is high in M 51 and NGC 1068, but not in NGC 7469. We did not find a correlation between the HCN/CS ratio (recently claimed as a possible starburst/AGN discriminator) and the AGN activity. However, a high enough spatial resolution to separate their circumnuclear disks from the surrounding star-forming regions is needed to find molecular abundance trends in AGNs. High abundances of H 13 CN and HC 3 N, as well as a similarity between the column densities of 13 CO and C 18 O, are representative of the molecular interstellar medium in the ULIRGs. Furthermore, the chemistry of Arp 220 points towards a more starburst-dominated environment, while that of Mrk 231 more resembles the AGNs of our sample.