The $q$-voter model with both attractive (roughly speaking, ferromagnetic-like) and repulsive (antiferromagnetic-like) interactions on random graphs is investigated. In this model the agent, represented by a two-state spin located in a node of a graph, with probability $1-p$ changes his/her opinion under the influence of a clique of $q$ randomly chosen neighbors and with probability $p$ acts independently and changes opinion randomly. In the former case the agent changes opinion if opinions of all selected neighbors interacting with him/her attractively via the attached edges of the graph ("friends") are opposite and simultaneously opinions of all selected neighbors interacting with him/her repulsively ("disliked persons") are the same as the agent's one. The parameter $p$ measures the level of stochastic noise in the model. For $q\ge 4$ the model on graphs with large mean degree of nodes exhibits first-order ferromagnetic transition with decreasing $p$, with a clearly visible hysteresis loop. The width of this loop decreases with increasing fraction of the repulsive interactions and the transition can eventually become second-order. For $q<4$ the transition is always second-order. An extension of the pair approximation taking into account presence of the repulsive interactions predicts quantitatively well results of Monte Carlo simulations of the model in a broad range of parameters.