In this paper, a deadlock prevention policy for robotic manufacturing cells with uncontrollable and unobservable events is proposed based on a Petri net formalism. First, a Petri net for the deadlock control of such systems is defined. Its admissible markings and first-met inadmissible markings (FIMs) are introduced. Next, place invariants are designed via an integer linear program (ILP) to survive all admissible markings and prohibit all FIMs, keeping the underlying system from reaching deadlocks, livelocks, bad markings, and the markings that may evolve into them by firing uncontrollable transitions. ILP also ensures that the obtained deadlock-free supervisor does not observe any unobservable transition. In addition, the supervisor is guaranteed to be admissible and structurally minimal in terms of both control places and added arcs. The condition under which the supervisor is maximally permissive in behavior is given. Finally, experimental results with the proposed method and existing ones are given to show its effectiveness.