Top Banner
I'd like to share my notes with all on how I create local yum repositories. By local I mean that the rpm files are on a computer here at home, not somewhere out in cyberspace. I've done this since Fedora 9 with both the "Fedora" repository and the install DVD. This how to was written with Fedora 14 in mind but should work equally as well with any earlier release. The installation DVD files Note: For all terminal commands I'll be using the su -c command. To use this command you will need to know the root password and use it when prompted. I'll also be using the vi text editor. Of course, feel free to substitute with the editor of choice. I'll be using the Fedora 14 x86_64 installation DVD. This method will work equally as well with the 32 Bit installation DVD. I've seen a few threads here where members have asked about creating a yum repository of all the files contained on the installation DVD. Here's what to do. Step 1. Create a folder to hold the files. Start by opening a terminal and deciding where to keep the rpm files. You can put them almost anywhere you want. For this example I've created a folder under / called fedora64. su -c 'mkdir /fedora64' Step 2. Get the files. Now that you have a place to keep your rpm files let's actually put some files in there. Insert your installation DVD and wait for it to mount. This should happen automatically and Nautilus will probably open up showing you the disk's contents. Close it. Now type mount The output should include information on the mounted DVD disk. Here's that output on my computer.  /dev/sr0 on /media/Fedora 14 x86_64 DVD type iso9660 (ro,nosuid,nodev,uhelper=udisks,uid=500,gid=500,io charset=utf8,mode=0400,dmode=0500) We'll use this information to copy the files, using tab completion to complete a path that contains spaces. The rpm files are kept in a folder on the installation DVD called Packages. Let's copy the files. In the terminal type
9

Yum in Fedora 14

Apr 05, 2018

Download

Documents

Sujeet Singh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Yum in Fedora 14

7/31/2019 Yum in Fedora 14

http://slidepdf.com/reader/full/yum-in-fedora-14 1/9

I'd like to share my notes with all on how I create local yum repositories. By local I mean that therpm files are on a computer here at home, not somewhere out in cyberspace. I've done this sinceFedora 9 with both the "Fedora" repository and the install DVD.

This how to was written with Fedora 14 in mind but should work equally as well with any earlier

release.

The installation DVD files

Note: For all terminal commands I'll be using the su -c command. To use this command you willneed to know the root password and use it when prompted.

I'll also be using the vi text editor. Of course, feel free to substitute with the editor of choice.

I'll be using the Fedora 14 x86_64 installation DVD. This method will work equally as well with

the 32 Bit installation DVD.

I've seen a few threads here where members have asked about creating a yum repository of allthe files contained on the installation DVD. Here's what to do.

Step 1. Create a folder to hold the files.

Start by opening a terminal and deciding where to keep the rpm files. You can put them almostanywhere you want. For this example I've created a folder under / called fedora64.

su -c 'mkdir /fedora64'

Step 2. Get the files.

Now that you have a place to keep your rpm files let's actually put some files in there. Insert yourinstallation DVD and wait for it to mount. This should happen automatically and Nautilus willprobably open up showing you the disk's contents. Close it.

Now typemountThe output should include information on the mounted DVD disk. Here's that output on mycomputer. /dev/sr0 on /media/Fedora 14 x86_64 DVD type iso9660(ro,nosuid,nodev,uhelper=udisks,uid=500,gid=500,io charset=utf8,mode=0400,dmode=0500)

We'll use this information to copy the files, using tab completion to complete a path that containsspaces. The rpm files are kept in a folder on the installation DVD called Packages. Let's copy thefiles. In the terminal type

Page 2: Yum in Fedora 14

7/31/2019 Yum in Fedora 14

http://slidepdf.com/reader/full/yum-in-fedora-14 2/9

su<password>cp /media/Fed<tab>P<tab> /fedora64/ 

By using the tab key the path will be filled in for you automatically. The end result is the

following command.cp /media/Fedora\ 14\ x86_64\ DVD/Packages/ /fedora64/ 

Keep in mind that this copy operation will likely take several minutes as there are some 2500+files in the Packages folder.

When the copy operation is complete you need to run createrepo on this new folder. For anexplanation of what createrepo does hit this (http://createrepo.baseurl.org/) link or simple typeman createrepo.

If you don't have createrepo installed then install it now with the command

su -c 'yum install createrepo'

Step 3. Create the metadata.

Run the following command to create the metadata.su -c 'createrepo fedora64'

This will be another fairly lengthy operation. When it has finished there will be 4 files in /fedora64/repodata, as described in the preceding link. The command completes without error,displaying the following output.

2766/2766 - hunspell-te-0.20050929-5.fc14.noarch.rpmSaving Primary metadataSaving file lists metadataSaving other metadata

That should be all we need to do to set up the repository folder. It is now time to move on tocreating the actual .repo file.

Step 4. Create a repository file.

Create an empty file in the folder /etc/yum.repos.d. I'm going to call my file fedora64.repo so Itypesu -c 'vi /etc/yum.repos.d/fedora64.repo'

In this file we need to add a minimum of 4 lines.[fedora64]Name=Fedora $releasever $basearch local repository

Page 3: Yum in Fedora 14

7/31/2019 Yum in Fedora 14

http://slidepdf.com/reader/full/yum-in-fedora-14 3/9

baseurl=file:///fedora64enabled=1

Save the file and exit the editor.

Step 5. Test the repository.

Now it's time to test the new repository. Typeyum repolist

The output on my computer.repo id repo name statusadobe-linux-i386 Adobe Systems Incorporated 18f14-dvd Fedora 14 x86_64 networked DVD repository 2,679+87fedora Fedora 14 - x86_64 22,031+130

fedora64 Fedora64 2,679+87flash flash 1+3google-chrome google-chrome 3google64 Google - x86_64 4rpmfusion-free RPM Fusion for Fedora 14 - Free 411rpmfusion-free-updates RPM Fusion for Fedora 14 - Free - Updates 131rpmfusion-nonfree RPM Fusion for Fedora 14 - Nonfree 181rpmfusion-nonfree-updates RPM Fusion for Fedora 14 - Nonfree - Updates 45updates Fedora 14 - x86_64 - Updates 4,180+122

Hopefully, if we did everything right, there will be no errors and you will see your newrepository listed amongst the normal Fedora repositories. Your new repository is now ready foruse.

This completes this section on how to create a local yum repository for the installation DVD rpmfiles.glennzo14th December 2010, 06:32 PMThis how to was written with Fedora 14 in mind but should work equally as well with any earlierrelease.

The Fedora repository files.

This will essentially be a local copy of the "Fedora" repository that is part of a basic Fedorainstallation.

Note: For all terminal commands I'll be using the su -c command. To use this command you willneed to know the root password and use it when prompted.

I'll also be using the vi text editor. Of course, feel free to substitute with the editor of choice.

Page 4: Yum in Fedora 14

7/31/2019 Yum in Fedora 14

http://slidepdf.com/reader/full/yum-in-fedora-14 4/9

 Step 1. Make a folder.

Start by opening a terminal and deciding where to keep the rpm files. You can put them almostanywhere you want. For this example I've created a folder under / called fedora.

su -c 'mkdir /fedora'

Step 2. Fetch the files.

Now we need to get some rpm files to load up your new folder. For this task we will usereposync. For information on reposync hit this (http://linux.die.net/man/1/reposync) link orsimply type man reposync.

Reposync is part of the yum-utils package. If reposync is not installed on your system install itnow with the command

su -c 'yum install yum-utils'

We need to specify which repository we want reposync to fetch the files from and where wewant it to put the files so we'll use the --repoid switch and the --download_path switch.

Keep in mind that if you continue with this process you will be downloading more than 17,000files. This will take some time. In some cases it will take several hours.

Typesu -c 'reposync --repoid=fedora --download_path=/fedora'

Go do something constructive and come back later. ;)

Step 3. Create the metadata.

Now we need to create the metadata that yum will use for this repository. We will usecreaterepo. If you don't have createrepo installed on your system install it now by running thecommandsu -c 'yum install createrepo'

Once the installation is complete run the following command to actually create the data.su -c 'createrepo fedora'

Again, due to the large number of files in this folder the operation will take considerable time tocomplete.

Step 4. Create the .repo file.

While createrepo is working you can open another terminal and create the actual .repo file. As an

Page 5: Yum in Fedora 14

7/31/2019 Yum in Fedora 14

http://slidepdf.com/reader/full/yum-in-fedora-14 5/9

alternative to opening another terminal you can just open a tab in the existing terminal.

Create an empty file in the folder /etc/yum.repos.d. I'm going to name my file fedora-local.repo.

su -c 'vi /etc/yum.repos.d/fedora-local.repo'

In this file we need to add a minimum of 4 lines.

[fedora-local]Name=Fedora $releasever $basearch local repositorybaseurl=file:///fedoraenabled=1

Step 5. Test the repository.

You need to make sure createrepo has finished before you can test your new repository. Once it

has finished run the command

yum repolist

Hopefully, if we did everything right, there will be no errors and you will see your newrepository listed amongst the normal Fedora repositories. Your new repository is now ready foruse.

This completes this section on how to create a local "fedora" repository.

How to Login as Root in Fedora 14

(Laughlin)

This brief tutorial will show you how to logon to Fedora as root. Even thoughit’s not recommended, you can still enable the root account and login as such.The recommended way to use Fedora is to login as a normal user and run ‘su – 

c’ to execute commands or edit restricted files. If that is too much for you, thenenable the root account and login as such.

Getting started: 

Page 9: Yum in Fedora 14

7/31/2019 Yum in Fedora 14

http://slidepdf.com/reader/full/yum-in-fedora-14 9/9

2.  Activate Trial version ….I activated my trial version of RHEL. 

You have to run command : /usr/sbin/rhn_register and then follow the instructions in wizard.