LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 09-26-2006, 07:28 AM   #1
gary4gar
Member
 
Registered: Aug 2006
Location: India
Distribution: Arch Linux x86_64 KDEmod 4.1
Posts: 52

Rep: Reputation: 15
Question config of fc5 offline


i am planning to install fedora core five but i do not have net but my friend has a fast connection so i can have the latest soft, i also made him install fc5 along with me. i want a way by which he downloads packages & we both can use. b'cos in ur FAQ there is only yum and with package is not saved
 
Old 09-26-2006, 10:53 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Well, you can do "yum update --download-only" which does save packages but unfortunately this won't help unless you both install the exact same packages. You could rsync a distro's mirror (or maybe yum-arch) so you have all updated packages locally, but that still wouldn't make updated package selection easier. So I think it would be best to split stuff: have one yum.conf, yum cache dir and rpm db dir for his box and one for yours, and switch between those to be able to do "yum update --download-only" for both configurations separately. Since you're using sneakernet you will need to carry along a copy of your yum configs and cache and /var/lib/rpm to put in place each time before updating at your friends house and before installing on your box.
 
Old 09-27-2006, 12:13 AM   #3
gary4gar
Member
 
Registered: Aug 2006
Location: India
Distribution: Arch Linux x86_64 KDEmod 4.1
Posts: 52

Original Poster
Rep: Reputation: 15
i dont know linux that much, could u pls tell me
what is rsync a distro's mirror??
what is sneakernet??

Quote:
Originally Posted by unSpawn
So I think it would be best to split stuff: have one yum.conf, yum cache dir and rpm db dir for his box and one for yours, and switch between those to be able to do "yum update --download-only" for both configurations separately. Since you're using sneakernet you will need to carry along a copy of your yum configs and cache and /var/lib/rpm to put in place each time before updating at your friends house and before installing on your box.
if i correctly got u
i have to write my yum.conf,yum cache dir & rpm db dir in a cd and take it to my friends house. then how to seprate it, i mean diffrent config files on my friends pc. so that he can use just my yum install packagename & i by download only & then write to CD to istall in my pc. mostly there will be RPM then are they installed my this method??
Code:
rpm -ivh <fn>.rpm
and what is i,v,h??

also some packages will be same like java,flash,mp3 support, system updates and various things in mentioned in FAQ's.

so downloading a rpm and installing with the the above command will work??
 
Old 09-28-2006, 10:19 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
i dont know linux that much
Me neither. Who is this Linux Stallman anyway?


what is rsync a distro's mirror??
Rsync synchronises contents of directories. Once you have downloaded a copy of the remote directory it will only transfer changes (in this case new packages) which is efficient.


what is sneakernet??
See http://catb.org/jargon/html/S/sneakernet.html


i have to write my yum.conf,yum cache dir & rpm db dir in a cd and take it to my friends house.
I'd prefer a removable storage like an external USB harddisk, USB stick or Flash Card, but yes, that's the idea.


then how to separate it, i mean different config files on my friends pc.
Make sure your hostname is set to something less generic than "localhost". Now, on your box:
Code:
HOST=$(hostname -s)
mv /etc/yum.conf /etc/yum-${HOST}.conf
mv /var/cache/yum /var/cache/yum-${HOST}
mv /var/lib/rpm /var/lib/rpm-${HOST}
ln -sf /etc/yum-${HOST}.conf /etc/yum.conf
ln -sf  /var/cache/yum-${HOST} /var/cache/yum
ln -sf  /var/lib/rpm-${HOST} /var/lib/rpm
tar -cjf /tmp/yum-${HOST}.tar.bz2 /etc/yum.conf /var/cache/yum /var/lib/rpm
now copy the /tmp/yum-${HOST}.tar.bz2 to the media of choice.

Let him make a backup of the targetted files and directories. Then make sure he has his hostname set to something less generic than "localhost". Now, his box copy in your /tmp/yum-YOURHOSTNAME.tar.bz2 and:
Code:
HOST=$(hostname -s)
mv /etc/yum.conf /etc/yum-${HOST}.conf
mv /var/cache/yum /var/cache/yum-${HOST}
mv /var/lib/rpm /var/lib/rpm-${HOST}
tar -xjf /tmp/yum-YOURHOSTNAME.tar.bz2 -C /
ln -sf /etc/yum-${HOST}.conf /etc/yum.conf
ln -sf  /var/cache/yum-${HOST} /var/cache/yum
ln -sf  /var/lib/rpm-${HOST} /var/lib/rpm
Now all should be set. Save this to an executable file named /usr/local/bin/yum_switch. File owner/group is root and mode is 0750:
Code:
#!/bin/sh
# whoami: yum_switch
# Purpose: switch Yum cache
# Args: hostname
# Deps: Bash, GNU utils, yum, rpm
# Run from: manual or cron
 
# Prepstage functions
progn=${0//*\//} 
# set error mode when testing:
set -e 
 
case "$1" in 
 s) shift 1; expr index "$1" "-+=;\#\'\"\$\&\*/" >/dev/null || host="$1";
    test -f /etc/yum-${host}.conf && \
     ln -sf /etc/yum-${host}.conf /etc/yum.conf || \
      echo "${progn} [ERROR]: failed to link yum.conf." > /dev/stderr
    test -d /var/cache/yum-${host} && \ 
     ln -sf /var/cache/yum-${host} /var/cache/yum || \
      echo "${progn} [ERROR]: failed to link yum cache." > /dev/stderr
    test -d /var/lib/rpm=${host} && \
     ln -sf  /var/lib/rpm-${host} /var/lib/rpm || \
      echo "${progn} [ERROR]: failed to link rpm db." > /dev/stderr
    ;;
 *) echo "${progn} [-s hostname]"; exit 1
    ;;
esac

exit 0
Before he runs yum for *his* box he needs to do "yum_switch HISHOSTNAME". He may use all yum commands.
When you show up for updates, run "yum_switch YOURHOSTNAME". You should only use "yum update --download-only", that is: no clean, remove or install commands. Switch back with "yum_switch HISHOSTNAME" when you're done. Now your yum cache should have the downloaded updates for your box and you can tar /var/cache/yum-YOURHOSTNAME and /var/lib/rpm-YOURHOSTNAME up and sneakernet it back to your box. Remember: you always need to bring along your fresh copy of /var/cache/yum-YOURHOSTNAME and /var/lib/rpm-YOURHOSTNAME and return it. /etc/yum-YOURHOSTNAME.conf not if you don't change it.
BIG FAT WARNING. I know GNU/Linux is versatile, extendible and on and on and for that I am sure this will work. It may however not. Making backups is a good practice anyway.


rpm -ivh <fn>.rpm
and what is i,v,h??

The fun thing is the docs are on your system. Try running "man rpm". Now type -i and press return. See?


so downloading a rpm and installing with the the above command will work??
Yes.

Last edited by unSpawn; 09-28-2006 at 10:24 AM. Reason: Add a few dashes of YOURHOSTNAME, stir slowly.
 
Old 09-29-2006, 09:44 AM   #5
gary4gar
Member
 
Registered: Aug 2006
Location: India
Distribution: Arch Linux x86_64 KDEmod 4.1
Posts: 52

Original Poster
Rep: Reputation: 15
wow
thats really great
but how to change the hostname??
 
Old 09-29-2006, 10:28 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
but how to change the hostname??
RTFM, or "man hostname", to be more precisely.
 
  


Reply



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
apol does not load selinux config information - fc5 ? dansawyer Linux - Security 0 09-19-2006 07:52 AM
installing a guest FC5 on FC5 xen using NFS niverson Fedora 0 08-11-2006 03:27 PM
1. Noobie install FC5; 2. FC5 spits out garbage after 'starting udev' nja1 Linux - Newbie 2 07-16-2006 02:48 PM
Fedora FC5 SATA Offline uncorrectable/unreadable sectors detected ArchW Linux - Hardware 1 07-11-2006 07:15 AM
Boot failure after upgrading FC5 TR3 to FC5 Official Release fsb1284 Fedora 3 03-25-2006 09:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 04:01 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