LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 09: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, 09:49 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
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, 10: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-20-2006, 11:17 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
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 09:11 AM
HELP on GFS - patching linux kernel antonioxcom Linux - General 1 07-06-2004 01:20 PM
patching ybaws Linux - Software 3 04-02-2004 04:52 PM
Patching Straterra Slackware 18 03-17-2004 12:58 PM
patching janu Linux - Software 1 01-06-2003 05:17 PM

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

All times are GMT -5. The time now is 03:13 AM.

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
Open Source Consulting | Domain Registration