19

I tried to apply patch to my file with following command

patch -p0 < foo.patch

I got the following output

bash: patch: command not found

I have Centos 5.x server.

Please guide what to do in this case

2 Answers2

34

All you need to do is

sudo yum install patch
user9517
  • 117,122
Tom O'Connor
  • 27,578
4
sudo yum install patch

If you have your yum repo configured correctly.

otherwise, find an rpm on the internet for your OS and do

rpm -ihv $urloftherpm
user9517
  • 117,122
johnshen64
  • 6,035