LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 01-21-2011, 10:50 PM   #1
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian, OS X
Posts: 1,266

Rep: Reputation: 99
Question How to Apply a patch


Hi All,

I have a Squid + Dansguardian setup on my CentOS 5.5 boxes.

I have downloaded a antivirus plugin for the DansGuardian from here which is actually a patch file dansguardian-2.8.0.6-antivirus-6.5.0.0.patch.bz2.

Now, I need to apply this patch.

I tried searching it on google and tried:

# patch < dansguardian-2.8.0.6-antivirus-6.5.0.0.patch
Quote:
can't find file to patch at input line 4
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urN dansguardian-2.8.0.6/autoconf/acconfig.h av/dansguardian-2.8.0.6-antivirus-6.5.0.0/autoconf/acconfig.h
|--- dansguardian-2.8.0.6/autoconf/acconfig.h 2005-08-13 20:47:57.000000000 -0300
|+++ av/dansguardian-2.8.0.6-antivirus-6.5.0.0/autoconf/acconfig.h 2005-09-03 20:29:36.000000000 -0300
--------------------------
File to patch: dansguardian.conf
patching file dansguardian.conf
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file dansguardian.conf.rej
can't find file to patch at input line 14
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff -urN dansguardian-2.8.0.6/autoconf/configure.in av/dansguardian-2.8.0.6-antivirus-6.5.0.0/autoconf/configure.in
|--- dansguardian-2.8.0.6/autoconf/configure.in 2005-08-13 20:47:57.000000000 -0300
|+++ av/dansguardian-2.8.0.6-antivirus-6.5.0.0/autoconf/configure.in 2005-09-03 20:29:36.000000000 -0300
--------------------------
File to patch:
It is asking which file to patch, ideally I believe it should be /etc/dansguardian/dansguardian.conf

Need help to apply this patch.
 
Old 01-21-2011, 11:46 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
It's been a while since I've had to patch a file, but since nobody else has responded yet... I think the error message is correct, you need -p to strip the 'av/' from the file name inside the patch. Try this:
Code:
patch -p1 < dansguardian-2.8.0.6-antivirus-6.5.0.0.patch
 
Old 01-22-2011, 08:58 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,635

Rep: Reputation: 2531Reputation: 2531Reputation: 2531Reputation: 2531Reputation: 2531Reputation: 2531Reputation: 2531Reputation: 2531Reputation: 2531Reputation: 2531Reputation: 2531
Actually, the patch is meant for the dansguardian 2.8.0.6 source code.
(( http://dansguardian.org/downloads/2/....source.tar.gz ))

The patch is quite huge, 31939 lines. Size = 1.2 MB.
( The dansguardian 2.8.0.6 source code = 1 MB.)

Dansguardian + patch : Fails compiling on CentOS 5.5.


Other info : Some more solutions are listed here
http://www.openantivirus.org/projects.php
..
 
Old 01-22-2011, 01:15 PM   #4
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian, OS X
Posts: 1,266

Original Poster
Rep: Reputation: 99
Thumbs up DONE

Many thanks gilead and knudfl.

This worked for me.
Code:
cd /usr/local/src
tar -xzvf dansguardian-2.8.0.6.source.tar.gz
cd /usr/local/src/dansguardian-2.8.0.6
cp -v /root/dansguardian-2.8.0.6-antivirus-6.5.0.0.patch /usr/local/src/dansguardian-2.8.0.6
patch -p1 < dansguardian-2.8.0.6-antivirus-6.5.0.0.patch
But, knudfl told this does not get along well with CentOS 5.5. I had some errors. Anyways, I learnt how to patch.

Do we always or generally apply patches to source files only ?

Also, could you please help me out with this issue of SQUID+ClamAV+DansGuardian

Last edited by vikas027; 01-22-2011 at 01:50 PM. Reason: Added some info.
 
Old 01-23-2011, 04:07 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,635

Rep: Reputation: 2531Reputation: 2531Reputation: 2531Reputation: 2531Reputation: 2531Reputation: 2531Reputation: 2531Reputation: 2531Reputation: 2531Reputation: 2531Reputation: 2531
Quote:
Do we always or generally apply patches to source files only ?
Yes, a file *.diff or *.patch is usually for source code.


There are no <patch>.rpm for Fedora / CentOS. AFAIK.
Like for the most OS, the whole 'package' is replaced by an update or change.
( I think, Suse has some <patch>.rpm for updating packages.)
..
 
Old 01-27-2011, 08:32 AM   #6
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian, OS X
Posts: 1,266

Original Poster
Rep: Reputation: 99
Thanks knudfl, for the useful info.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to apply patch kool_kid Red Hat 4 08-25-2007 04:09 PM
Apply Patch culin Linux - General 1 02-21-2007 08:02 AM
how to apply a patch? ashlesha Linux - Software 4 12-07-2006 02:09 PM
Ho Do I Apply The CK Patch? AFI_Flame Linux - Software 1 11-14-2004 10:49 PM
How to Apply patch for Mass Storage device to work? (uss725-2.4.20-rc2.patch) cevjr Linux - Hardware 3 04-20-2004 11:14 PM


All times are GMT -5. The time now is 06:58 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration