In Answer Set Programming it is not possible to deduce any conclusion from an inconsistent program (ie: a program that has no model). The same issue occurs in classical logic where there exist some techniques to handle this inconsistency. In this work, we propose to manage inconsistent logic programs in a similar way as possibilistic logic does for classical logic. We compute a consistent subprogram keeping the most important rules of the original program. This importance is described by a necessity degree assigned to each rule.