Jump to content

How to create an offline CD repo?


Recommended Posts

What I used to do is move them to a new folder that I called RPMS. Then from a terminal I would go to that folder and as root run the command genhdlist

 

 

then burn that folder to a disc. Everytime you add to that folder re run genhdlist. Also you don't have to burn a disc, you can point urpmi to it, use the mcc add media tool and browse to the place you choose to keep your files.

Edited by grendal
Link to comment
Share on other sites

I have setup a custom HDD repository, to which I add or delete rpm packages stored on CD-R discs, as needed. What follows is a post submitted relatively recently to LinuxQuestions, Mandriva Forum, in response to a query similar to yours. I should add that I keep copies of downloaded rpm packages permanently on discs to avoid the need to download them again if a major catastrophe occurs; I think it is very prudent to do so. And I also want to add that I am enjoying Mandriva 2007.0 more than ever, and I will be keeping it around for a while longer.

 

==================================================

2008-01-05 LINUXQUESTIONS

==================================================

 

CREATING A CUSTOM REPOSITORY

 

As I promised, here are the essentials on how to create a custom Mandriva Linux repository on your HDD. I am running Mandriva 2007.0, kernel 2.6.17-5mdv, but the basic procedure I will outline should hold true for Mandriva 2008.0 as well. I will describe how my custom repository is set-up. Keep in mind there are other ways it can be done (meaning, slight modifications). Most importantly, I recommend using the CLI exclusively for initial set-up. URPMI is the backend for GURPMI, the GUI frontend known as Mandriva Linux Control Center/Software Management. Only knowing how to use the GUI will not save you in every case if something goes drastically wrong. Post if something here is not clear, or if you need more details.

 

1. Using Konsole, or your favorite CLI, create a directory <mkdir> where you will be storing the RPM packages that will comprise your custom repository. I use the directory:

 

/home/myUserID/rpms/

 

Substitute your UserID in the above. You can name the directory anything you wish. I chose this particular path to my repository because it is easily accessible.

 

2. Add the following subdirectory <mkdir>:

 

/home/myUserID/rpms/pubkey/

 

Then copy <cp> the Pubkeys file to the newly created subdirectory. My Pubkeys file is located in:

 

/var/lib/rpm/

 

You will need to be logged-in as root to do this, and remaining logged-in as root will make the remainder of all this easier. If your Pubkeys file is not there, do a file search. Note: I am assuming here that you already have URPMI configured for some on-line repositories. If not, then the Pubkeys file might not exist, in which case I would recommend discontinuing this procedure and first concentrate on setting up URPMI to use on-line repositories (mirrors). Repost if you need more help on configuring URPMI to use Mandriva Linux mirrors.

 

3. Copy <cp> or move <mv> the desired RPM packages to the newly created directory </home/myUserID/rpms>. I make sure that root has ownership of all my RPMs <chown root:root *.rpm> Also, my file permissions read as follows:

 

[myUserID@localhost rpms]$ ls -l

total 6917

-rw-rw-r-- 1 root root 6958028 Dec 28 08:56 fp-linux-ws.rpm

-rw-r--r-- 1 root root 5447 Jan 2 17:08 hdlist.cz

-rw-rw-r-- 1 root root 86069 Jan 2 13:16 libgdk-pixbuf2-0.22.0-10mdv2007.0.i586.rpm

drwxr-xr-x 2 root root 1024 Dec 28 10:37 pubkey/

-rw-r--r-- 1 root root 443 Jan 2 17:08 synthesis.hdlist.cz

 

If your's do not, do <chmod 664 *.rpm>.

 

4. Now do <genhdlist>. This will write hdlist.cz and synthesis.hdlist.cz to the directory. Whenever, RPMs are added or deleted, hdlist.cz and synthesis.hdlist.cz must be removed <rm>. Then, you must do <genhdlist> again.

 

5. Now you are ready to create a custom repository. My custom repository is named HD (harddrive). Name your's anything you wish ... HDD, CUSTOM, LOCAL, whatever. So, in my case, I did:

 

<urpmi.addmedia HD /home/myUserID/rpms/>

 

You should see output indicating that the custom repository is being created. If something ever goes wrong and you want to discard the custom repository, you can do:

 

<urpmi.removemedia HD>

 

6. Next, do:

 

<urpmi.update HD>

 

You will see output indicating that new configuration files are being written. You might want to copy all output displayed to a text file for later reference, particularly if you want to find where some configuration files are located in the future. You will need to update your custom repository whenever RPMs are added or deleted.

 

6. Now you can go to Mandriva Linux Control Center/Software Management (GUI). Click on "Select from where software packages are downloaded when updating the system". You should see HD, or whatever you named your custom repository, on the list. Check-mark the box to enable the custom media. Make sure the HD line is highlighted. Then, click "Manage keys ...". If you have on-line repositories configured, you will have some keys from which to choose. I have added the key for my on-line main repository to my custom repository. Click OK. Next, click "Update ...", again making sure that HD is highlighted. HD in the GUI also needs to be updated every time RPMs are added or deleted.

 

7. Finally, go back to the "... Software Management" screen and click "Look at installable software and install software packages." Search for a RPM package you know is in your custom repository. It should then appear in the box below, unchecked. Check it, then click <apply>. It will be immediately installed, if there are no other needed dependencies. Note: the key you added to your custom repository might not match the key included in the RPM package, causing URPMI to complain. Just go ahead with the install. The keys can be manually matched-up if the original source of the package has been noted and recorded, but doing so is just extra work.

 

8. Keep in mind that you might have RPMs stored on HDD that are also available from an on-line repository. Uncheck all on-line sources if you only want to install from local sources (custom repository, installation discs, etc.), and vice-versa, uncheck all local sources if you want to get everything only from on-line sources. Select your download sources to fit specific circumstances. URPMI is a powerful, indispensable tool for Mandriva Linux; it should never be ignored or by-passed.

 

9. It is also important to note that RPM packages downloaded and installed using URPMI are not kept permanently on HDD; they are automatically deleted from cache after installation. If you want to keep all supplemental RPM packages you have downloaded, another procedure will have to be used (I use <wget> to download and keep RPM packages on HDD, later archived to CD). Post to this forum with the topic "How to keep RPM packages", if you want to know how I do it.

 

A problem might arise where what you see listed as installed and uninstalled in Mandriva Linux Control Center/Software Management might not reflect reality. In this case, your RPM database has become corrupted and will need to be rebuilt. All that is another topic altogether, and I will not discuss it here at this time. It, all I have covered, and more, is contained in the "Tools/urpmi" pages available from Mandriva Community Wiki at Mandriva's official website. Also, read <man urpmi> and related man pages for some basics. I can guarantee that Mandriva Linux can become as easy to use as basic MS-DOS, if a user does not constantly switch from one Linux distribution to another, as some seem to do on an almost daily basis.

 

http://wiki.mandriva.com/en/Docs/Basic_tas...moving_software

 

--------------------------------------------------

Compaq Deskpro EN, Pentium III 933 MHz, 256 MB RAM, Nvidia Riva TNT2 AGP Card, Canon BJC-610 Printer, Best Data 56SX92 External Serial Modem, Mandriva 2007.0, kernel 2.6.17-5mdv, KDE 3.5.4

--------------------------------------------------

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...