"Homer and Apu" is the thirteenth episode of Season 5.
Apu loses his job at the Kwik-E-Mart after he sells Homer tainted meat. Homer feels bad and lets Apu live at the Simpsons' home while he is unemployed. In an attempt to get his job back, Apu travels to India with Homer to convince the head of the Kwik-E-Mart corporation. Meanwhile, James Woods fills in Apu's position.
Homer buys some spoiled ham from Apu in the Kwik-E-Mart, eats it, and gets food poisoning. After getting better, Homer goes to Kwik-E-Mart to complain about the spoiled meat, for which Apu gives Homer spoiled shrimp. Once again, Homer eats the shrimp and becomes sick again. This time however, Kent Brockman (who fronts the investigative news program Bite Back with Kent Brockman) gives Homer a giant novelty hat containing a spy camera to expose Apu for selling spoiled food. Caught in the act, Apu is immediately fired from Kwik-E-Mart. He protests that he didn't violate the company policy. The company executives agree but they explain that it's also the company policy to make a scapegoat in these situations. Apu's replacement is actor James Woods, who is researching a role for his next movie.
After getting fired, Apu does chores for Homer because he thinks that he is in debt to Homer for selling him spoiled food and that helping Homer will pay off his debt of karma. As time goes by, the family begins to love Apu and his traditions. However, Apu begins to miss his job at Kwik-E-Mart, so Homer chooses to help Apu by traveling with him to the Kwik-E-Mart head office in India to ask for his job back. The world's first convenience store happens to be inconveniently located on top of the Himalayas. Once they arrive, they meet up with the head of the Kwik-E-Mart, a man in a white building drinking a Squishee in front of a sign that reads "The Master Knows All (except combination to safe)." Unfortunately, Homer wastes all three questions by repeatedly asking if he really is the owner of the Kwik-E-Mart, and he does not help Apu with his problem, and Apu and Homer are forced to return home disappointed (with Apu strangling Homer in fury over the latter's role in ruining Apu's chance at returning to the Kwik-E-Mart, with Homer mistaking it for Apu apologizing due to Apu adopting a similar pose when formally apologizing to Homer after being fired).
Later on, Apu manages to save James Woods from being shot by a robber. The grateful Woods ensures that Apu gets his job back at the Kwik-E-Mart, while he goes off to battle aliens on a distant planet. The episode finishes with the Simpson family hugging Apu as he recovers in the hospital from the gunshot wound he received during the robbery.