LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-20-2006, 10:47 PM   #1
westman
LQ Newbie
 
Registered: Jan 2006
Distribution: SLES, RH9
Posts: 15

Rep: Reputation: 0
Patching in linux.....


Hi,

How to patch a file/package? What is the command used to patch? I have encountered a 'zcat' command, is this one of the way to apply patches? Can someone list down the command?

Thanks..
 
Old 02-20-2006, 10:49 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
You use the patch command to patch source code files. Patches are generally delivered as a diff. If the patch is big, it is sometimes gzipped so it must be unzipped before use. A handy way to do this is:

zcat <patchfile> | patch

This decompresses the file and passes the decompressed result to the patch command. The patch command has a number of options. I suggest you read its man page (type "man patch" with no quotes at the command line) for more details.
 
Old 02-20-2006, 11:27 PM   #3
westman
LQ Newbie
 
Registered: Jan 2006
Distribution: SLES, RH9
Posts: 15

Original Poster
Rep: Reputation: 0
Hi,
Thanks for the reply, btmiller. According to the manual, it didn't mention anything about zcat. So, does this mean that there are other ways to patch beside using zcat command? For example, just using
patch -p patch-name.gz
Is this correct?

You said that the patch maybe available in gzipped(gz) if it too big. So how do I apply patch for some source file using a patch file zipped in bz2 extension?
 
Old 02-21-2006, 12:17 AM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
The zcat command has nothing to do with the patching process, it's just a convenient way to feed a gzipped file to the patch program (via a pipe |). If the patch had a bz2 extension you would have to use bzcat.
 
  


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
patching linux kernel-2.4.20-8 with kdb enthusiast_abdul Programming 1 11-08-2005 10:11 AM
HELP on GFS - patching linux kernel antonioxcom Linux - General 1 07-06-2004 02:20 PM
patching ybaws Linux - Software 3 04-02-2004 05:52 PM
Patching Straterra Slackware 18 03-17-2004 01:58 PM
patching janu Linux - Software 1 01-06-2003 06:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:27 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration