FedoraForum.org - Fedora Support Forums and Community
Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2006
    Location
    Melbourne
    Age
    55
    Posts
    611
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile A simple guide to create your own local repository for future re-installation backup

    This guide has now been updated on my own website. Thanks

    http://poppleit.com/how-to-create-a-...ra-09-05-2011/

    A simple guide to create your own local repository for later re-installation or backup

    I created my own local repository so i could do a complete offline installation on other computers. If you want to get all your fedora extras and 3rd party repositories and their dependencies in your repository you will need to start with a clean installation.

    1. The first step is open a terminal and type the following:
    .
    Code:
    gedit /etc/yum.conf
    change:

    Code:
    keepcache=0
    to
    Code:
    keepcache=1
    This way my downloads with will not be deleted as would normally occur. The other option to this is to use 'yum-downloadonly' as described later. Yum-downloadonly is for downloading only and is useful if i wanted to obtain rpms and their dependencies without installing them. It is also necessary for the --downloaddir option which is needed for choosing my local repository directory.

    2. The second step is to create a local folder to store all my rpms. I started off like this:

    Code:
    mkdir /home/jonathon/jonrepo
    I like my repository folder in my home directory for easy access.

    3. Next i installed the following programs:

    Code:
    su
    yum -y install yum-downloadonly
    Code:
    yum -y install createrepo --downloaddir /home/jonathon/jonrepo
    yum -y install yum-utils --downloaddir  /home/jonathon/jonrepo
    Yum-downloadonly will give the '--downloaddir' option. Now i can download the next two programs into my repository. If I want to add yum-downloadonly to my repository I can move the rpm from /var/cache/yum/updates/packages to my repository. To do this i use the move command:

    Code:
    mv /var/cache/yum/updates/packages/* /home/jonathon/jonrepo
    NOTE the syntax /packages/* will move all the contents of my /var/cache/yum/updates/packages folder to my repository folder (thanks Leigh123 for helping me with this ). If i want to delete the contents of the folder but not the folder itself i use the remove command:

    Code:
    rm -rf /var/cache/yum/updates/packages/*
    Also if i want to include the rpm packages from the fedora installation disc in my local repository i simply copy the rpm packages to my local repository.

    4. The next step is to finish creating my local repository:

    Code:
    gedit /etc/yum.repos.d/jonrepo.repo
    Code:
    [jonathon]
    name=Fedora Core $releasever - $basearch
    baseurl=file:///home/jonathon/jonrepo
    enabled=0
    gpgcheck=0
    The name of my repository is actually 'jonathon' not 'jonrepo' as far as yum is concerned. If i want the title of my local repository to be 'jonrepo' i use the following layout:

    Code:
    [jonrepo]
    instead of
    Code:
    [jonathon]
    As you will have noticed my repository is not yet enabled.

    Code:
    enabled=0
    I prefer to enable my repository later once i have created my repository 'repodata' to avoid any update problems.

    5. The next step is to download a program into my repository as i did earlier on. I do this with the following command:

    Code:
    su
    yum -y install kshutdown --downloaddir /home/jonathon/jonrepo
    The command will download the rpm to my repository and install it in one hit. So easy!

    If i want to enable a 3rd party repository such as 'freshrpms' i would use the following command:

    Code:
    yum -y --enablerepo freshrpms install mplayer mplayer-skins mplayer-fonts mplayer-docs mplayerplug-in  --downloaddir /home/jonathon/jonrepo
    As you can see this command will download and install mplayer along with all of the needed dependencies to my local repository.

    If I want to use yum-downloadonly i would use the following layout:

    Code:
    yum -y --downloadonly --enablerepo freshrpms install mplayer mplayer-skins mplayer-fonts mplayer-docs mplayerplug-in  --downloaddir /home/jonathon/jonrepo
    6. The next step is to create my 'repodata' so that yum can read my local repository:

    [jonathon@localhost ~]$
    Code:
    su
    Password:
    [root@localhost jonathon]#
    Code:
    createrepo /home/jonathon/jonrepo
    1/1 - kshutdown-1.0-3.fc7.i386.rpm
    Saving Primary metadata
    Saving file lists metadata
    Saving other metadata

    7. The next step is to enable my repository.
    Code:
    gedit /etc/yum.repos.d/jonrepo.repo
    set

    Code:
    enabled=1
    save and close

    8. Now i need to disable the fedora repositories as my local repository is unlikely to work properly even with internet access. For offline installation I need to disable other repositories that are configured for automatic updates.

    Code:
    gedit /etc/yum.repos.d/fedora.repo
    set:

    Code:
    enabled=0
    save and exit

    Do the same for fedora-updates:
    Code:
    gedit /etc/yum.repos.d/fedora-updates.repo
    Other repositories that you may have enabled for automatic updates will have to be disabled as well:

    Code:
    gedit /etc/yum.repos.d/adobe-linux-i386.repo
    gedit /etc/yum.repos.d/dries.repo
    gedit /etc/yum.repos.d/livna.repo
    gedit /etc/yum.repos.d/freshrpms.repo
    NOTE Strangely enough i need to reboot my computer each time i update my repository 'repodata'.

    Reboot and test your repository. Open a terminal and type at the prompt:

    [jonathon@localhost ~]$
    Code:
    su
    Password:
    [root@localhost jonathon]#
    Code:
    yum install kshutdown
    Loading "installonlyn" plugin
    Loading "downloadonly" plugin
    Setting up Install Process
    Parsing package install arguments
    jonathon 100% |=========================| 951 B 00:00
    primary.xml.gz 100% |=========================| 1.0 kB 00:00
    jonathon : ################################################## 1/1
    Resolving Dependencies
    --> Running transaction check
    ---> Package kshutdown.i386 0:1.0-3.fc7 set to be updated

    Dependencies Resolved

    ================================================== ===========================
    Package Arch Version Repository Size
    ================================================== ===========================
    Installing:
    kshutdown i386 1.0-3.fc7 jonathon 291 k

    Transaction Summary
    ================================================== ===========================
    Install 1 Package(s)
    Update 0 Package(s)
    Remove 0 Package(s)

    Total download size: 291 k
    Is this ok [y/N]: y
    Downloading Packages:
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
    Installing: kshutdown ######################### [1/1]

    Installed: kshutdown.i386 0:1.0-3.fc7
    Complete!
    [root@localhost jonathon]#


    I could also leave my local repository disabled and enable it with the following command:

    Code:
    su
    yum --enablerepo jonathon install kshutdown
    As you can see my repository works fine.
    If you decided to install 1.5 GIG of programs i would suggest doing a bit a time especially if you use 'yumex' which is really slow. For yum the command line is the fastest option but not that fast. It took 5 hours to install everything since i did one gigantic installation.

    To update my repository 'repodata' after fresh updates i open a terminal and type at the prompt:

    NOTE the location of the repodata in your local repository

    Code:
    su
    rm -rf /home/jonathon/jonrepo/repodata
    createrepo /home/jonathon/jonrepo
    Beware rm -rf ! I accidentally deleted my home directory one night. Use this command with caution otherwise it can cost you dearly as it did me. I lost all of my newly updated installation notes. Luckily i had everything else backed up.

    Other useful command line updates that work:

    Code:
    yum -y groupupdate "Administration Tools" --downloaddir /home/jonathon/jonrepo
    yum -y groupupdate "System Tools" --downloaddir /home/jonathon/jonrepo
    yum -y groupupdate "Hardware Support" --downloaddir /home/jonathon/jonrepo
    yum -y groupupdate "Graphics" --downloaddir /home/jonathon/jonrepo
    yum -y groupupdate "gnome-desktop" --downloaddir /home/jonathon/jonrepo
    johnny
    Last edited by jonathonp; 9th May 2011 at 09:02 AM.

  2. #2
    Dunhausen Guest
    Supposing I don't want to do an offline backup--I just want to dump yum's list of packages, and tell it to go out and get those same packages the next time I reinstall--would know how I might go about doing that?

  3. #3
    Join Date
    Oct 2006
    Location
    Melbourne
    Age
    55
    Posts
    611
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile

    I'm not exactly sure what you mean. It would be easy to keep everything in your cache and then copy or move all your packages to another folder for backup.
    Code:
    gedit /etc/yum.conf
    add
    Code:
    keepcache=1

    If you want to reinstall the same version of fedora you just need to create a repository as described in my guide and then do an offline installation. By the way offline installation simply means disabling yum from connecting to any other repositories. If you upgrade to fedora 8 then your repository is not suitable and you will need to start again. I keep detailed notes of everything i install that way upgrading to the new version of fedora is easy. If you just need a list of rpm packages installed on your system then open a terminal and copy the following:

    Code:
    yum list installed|less
    johnny
    Last edited by jonathonp; 19th September 2007 at 08:37 AM.

  4. #4
    Dunhausen Guest
    Ah, thank you, that last command was what I needed. The extra version/installation information is non-ideal but I suppose I know enough programming to get rid of it.

    Basically, my plan upon upgrading is to take a diff of "yum list install" for my initial install and my "yum list install" when I want to go to FC8. Then after I load up FC8 I can tell yum to install those packages and I will again have all the custom packages I'd put on my system in FC7.

    A local rep, is good, but as you said, I would have start again for fedora 8, and that's pretty much the problem I want to resolve... usually the only time I need to reinstall packages is when I wipe and do the next fedora. Next time, it will be nice to not have to go back and manually install all my favorite applications from the repos.

  5. #5
    TheeJoey Guest
    Hey johnny, I got a problem.

    I'm not sure how to check for groups of installable software. You directed me here a few days ago, and my problem was that I wanted to install software on my USB-installed Fed10 live. I wanted the gui yum software to find my local repository, and install from there. If I want to install a program with its dependencies, I'm gonna need to know what those dependencies are, or else have some way of searching and finding dependency information. Either that or there's some way of directing yum to find some pre-created database of what depends on what. I know it exists in the online repositories, but supposedly a DVD has that same repository bundled in that one package.

    What do you suggest?


    (mmmm ... its gooey and yummy ... ... )

  6. #6
    Join Date
    Oct 2006
    Location
    Melbourne
    Age
    55
    Posts
    611
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In the past bandwidth has been very precious to me and downloads were not something to be wasted and as a result i can see where you are coming from.

    Basically start off with a with a fresh installation.


    Do this:

    Code:
    su
    gedit /etc/yum.conf
    Change to:

    keepcache=1


    Next, download updates and 3rd part programs. All RPMS and dependencies that are stored in the cache folder should now be saved to another location. You can add them to your USB stick and instruct yum to install from your local repository.

    How large is your flash stick?

    I not experienced with live usb so i'm no sure exactly what u want to do.

    I guess u want to customise your live USB. Is that right? Might be a bit of work there in learning how to customise your live fedora stick.

    Try running fedora USB live and seeing what happens when you update it. Make sure u save all newly downloaded rpms for later use.


    How big is your flash?
    Last edited by jonathonp; 4th April 2009 at 04:26 PM.

  7. #7
    TheeJoey Guest
    Thanks for your interest, suggestions, and questions.

    I have important software on a PC that I don't want to remove, and its dependent on WinXP. I have a Mac and have recently decided I dont like both Mac and Microsoft, and so I thought I'd give Linux a go. I am familiar with Unix already, since I studied CS in a Unix environment -though it would take a little extra maturity before I would pass anything at uni - with some distinctions. I have played with KDE in the past, tho I didn't know what it was and only recently realised that it was the K environment that has gained some popularity.

    I am a very quick learner, and so when I started learning about Linux/gnome on this recent stint I began a steep learning curve. I wanted to know what my options were, and found that I could install Linux on a USB stick with minimal software options, like openoffice.org and gimp, among other things. I now want to install further software (while also showing off a little that I can do something that was not originally intended ). The live install is only really intended as a try-out - if you want a proper installation, with all the bells and whistles, you gotta install the full version on an internal drive. heck, they even put an icon specially for that purpose on the desktop with the other main icons.

    The plus for a USB install is this - if you want to you can install further software on a persistent layer. It's very very nifty, because you can make various changes, creating/saving files, installing software and the like, plus it will be saved at the end of the session. This minimal use of the USB drive saves it from ruin (which I did not know was an issue until I found out about it in a Fedora Forum)

    I have done this - attached one USB stick (4GB with ruffly a 2.6GB persistent layer - this is apparently the maximum) to the computer, directed the BIOS to search for an operating system on that USB first, then when fully booted up, attached another USB stick to the system. That other USB stick has the repository I'm trying to load from, in a large iso. I have achieved full recognition of that mounted iso, and yum has found packages, but I find no groupings, which I'm guessing is the recognition of dependencies. That's the next thing for me to get. When that happens I will have reached the point I want - the ability to install software like in a proper, internal-hard-drive installed version of linux.

    The more I interact with this new system, the more I realise the enormity of what I am doing. I can, percievably, take my computer with me and start it up on some computer down at the library, at a friends place, or even at work. I may have some software on it that I'm not permitted to load up elseware because I don't have the software license to do it, etc. I mean, most people would not care about something like that, but the fact that an issue of that sort can be solved is incredible.

    A computer on a stick. That's what it is.

    For me it allows the use of the software on that PC I mentioned, while also using gimp to edit photos, OO.org to write and edit documents, and aby writer to make important notes. There are so many things besides, like the ability to change the look and feel of the system to mimic a mac system, which is the sweetest system on the planet at the moment (hey, I'm honest - and thankfully, so are the blokes in one of the Linux mags - a brit version - who agreed), and the opportunity to contribute something to the projects if I wish. And its totally up to me to contribute because its all open source. That my alterations or suggestions would be accepted is not a given, but just the idea that some thing can be added to and helped in that way is very encouraging - it gives someone the feeling of being a part of something much bigger than he is.

    And the other people involved are nerds like me .. sorry, geeks like me. Apparently, according to my group of friends, nerds are clever like geeks, but geeks also make money and get the girl in the end . Unless you believe the folks who made the Nerds movies. Which I've seen, but only on the insistence of a friend. Tho I did enjoy them .. which is scary.

    Hope that answers your questions.

    Now a question for you - can you suggest a way to encourage the gui version of yum to find dependencies? And if you don't know how to do this, can you suggest someone who might know?

  8. #8
    Join Date
    Oct 2006
    Location
    Melbourne
    Age
    55
    Posts
    611
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi theejoey. Thanks for your detailed notes. Fedora Usb Live sounds good.

    "That other USB stick has the repository I'm trying to load from, in a large iso"

    Your local repository can simply be a folder with all newly downloaded rpms. When you download anything with yum all dependencies will be download too. If dependencies are not satisfied eg a missing package, then yum will not install the package/s until the missing dependencie/s have been resolved.

    You local repository does not need to be in the iso format. It can be on any piece of hardware. You just need to tell yum the location of your repository.

    "The plus for a USB install is this - if you want to you can install further software on a persistent layer. It's very very nifty, because you can make various changes, creating/saving files, installing software and the like, plus it will be saved at the end of the session. This minimal use of the USB drive saves it from ruin (which I did not know was an issue until I found out about it in a Fedora Forum)"

    As far as i can tell from your description then you donlt really need a local repository since the USB live allows for customisation. Is this right?

    With regard to your other operating systems you should back up your data eg creating an image of each operating system and other partitions containing data because hardware failure is a real possibility.

    The only risky thing with reagrad to installing fedora on your computer is deleting or reformattiing your xp and mac partitions during the install. It's not a big deal really. Paritioning can be done easily using tools like gparted live. Just make some space and create three 3 partitions which will be your

    /
    /home
    swap.

    partitions.
    Last edited by jonathonp; 6th April 2009 at 07:40 AM.

  9. #9
    TheeJoey Guest
    Quote Originally Posted by johnnylinux
    ... When you download anything with yum all dependencies will be download too ...
    I downloaded a DVD image of the full Fed10 x86-64, and dont want to download it again to satisfy default conditions within yum. I've been aiming to redirect yum to find this mounted image and all it contains so that I don't have to re-download rufly 4GB.

    Quote Originally Posted by johnnylinux
    ... You just need to tell yum the location of your repository ...
    Already know how to do this . I got it in another thread here (gotta be careful with these sysops - they don't like new and interesting strains of forum caused by cross-polination of threads ... shhh) Maybe check out my profile to see the USB labelled threads I "subscribe" to. It's got a good description of what I found and what I did.

    Quote Originally Posted by johnnylinux
    ... As far as i can tell from your description, you don't really need a local repository since the USB live allows for customisation. Is this right? ...
    Yes and no. As in, yes to something, and no to something else. The Live USB install has basic software installed, and so theres something I want to add. A live install usually duznt allow further installations, as the concept of LiveOS is such that an unchangeable image is created to be loaded up again and again. The Fed10 LiveOS allows changes you make to be saved - in what they call a persistent layer. This means that, technically, I can install software on this LiveOS, or rather the persistent layer. This requires access to a repository. I have already got a copy of the repo in the DVD image, which looks exactly like the online repo. I've already successfully directed yum to look for and find the locally mounted repo. My issue now is that dependencies are not being found, it seems.

    Quote Originally Posted by johnnylinux
    ... With regard to your other operating systems you should back up your data eg creating an image of each operating system and other partitions containing data because hardware failure is a real possibility ...
    I accept what you say, but I think this might be overkill. If I take a LiveOS with me wherever I go and perform backups of whatever computer I stick the stick in - it might be impractical. With that in mind, I reckon I might chance it. Thanks for the suggestion tho, and I reckon I mite be on the look out, because I really didn't consider this a real threat.

    Quote Originally Posted by johnnylinux
    ... The only risky thing with regard to installing fedora on your computer is deleting or reformattiing your xp and mac partitions during the install ...
    That's fair enough too. As in, I understand that it might be simple to install some distro of Linux with minimal fuss, but fact is there is some fuss involved. To put an OS on a stick is ideal in so many situations. Example: I want to travel. If I take this stick with me, I could potentially have access to important files, internet bookmarks, any project I might be working on using quanta plus, and photo editing software, among other things. Assuming I have another stick with 8GB, and access to a friends computer including DVD burner wherever I go, I am going to need very little else. The alternative is to carry a few kilograms of hardware around, including a computer with all the bells and whistles.


    Having said all that, I reckon the concept of a LiveOS on a USB stick, with an added persistent layer to install as you please, is absolutely amazing. I am actually intending to travel soon, and this concept could shave a few precious kilograms off the total weight of baggage.

    Because I'm leaving for a short time its extremely practical. If I were leaving home for a long time I might consider taking my computer with me because, well, a geek without a computer?? It just is'nt cricket!!

Similar Threads

  1. Setting up a local yum repository from installation cds...
    By SHAH201 in forum Guides & Solutions (Not For Questions)
    Replies: 1
    Last Post: 19th September 2007, 01:48 AM
  2. Simple guide to setup multimedia (DVD Mp3) from 3rd party repositories
    By jonathonp in forum Guides & Solutions (Not For Questions)
    Replies: 6
    Last Post: 20th July 2007, 10:41 AM
  3. Simple guide for VLC skin installation
    By jonathonp in forum Using Fedora
    Replies: 5
    Last Post: 1st May 2007, 10:32 AM
  4. Replies: 16
    Last Post: 22nd September 2006, 01:33 PM
  5. how do I create a local repository???
    By yr2alex in forum Using Fedora
    Replies: 10
    Last Post: 4th September 2004, 03:01 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •