Before we create repository, we need to get all necessary RPM package files. As we know repository is operating system specific, we have to use the same disk which we used to install the operating system.
If Centos is installed then we have to use the Centos installation disk. Here UserName is the name of logged in user. Create a directory. Since this directory will be used to store all RPM package files from disk, make sure we have sufficient at least 4GB free disk space.
Yep, you got it right. Yum command uses repository configuration files to figure out the available repositories. By default yum is configured to use online repositories.
If repository server is compromised, a hacker may put some fake packages in repository or may change existing packages. If these packages are installed in system, the system may get hacked also. The GPG key is the counter measurement of this kind of security threat. The packages in repository are signed with GPG key.
The owners of packages also provide the GPG keys. With GPG key yum can check whether the package is in its original state or has been modified in repository. Since in our local repository we put all packages from original installation disk, there is no need to enable the GPG check feature. As output confirms that our repository name — rhcerepo and id - rhcerepo is ready to use.
Currently this repository contains packages. Now we have a working repository, in remaining part of this tutorial we will learn how to use the repository. The yum command is used to work with repository. To install, remove or update a package we first need to know the exact name of the package.
Since packages name contain a lot of information in name such as version, architecture, platform etc. We can use two sub commands to get the exact name of a package; search and provides. What's important is the fact that the user must not be given the responsibility of managing the overhead involved in the installation of the program. You would ask,what's the overhead involved in installing a program? Yes there are several overheads involved in installing a program in a computer Like the following.
An installer or program manager, must handle those overhead by itself by not harassing the user. Linux, by nature is the best operating system out there if you configured it the right way. The main issue with installing a program's in Linux distribution's is the fact that, different distribution's use different methods to install a program.
Here, in this post we will be discussing a very famous tool used to install program's in Red Hat Linux system's even fedora,centos and all red hat like system's. That's none other than the very famous YUM. Like all other program's in Linux, YUM is also an open source tool. It was initially used in Duke University, for managing package installation on their Red Hat based system's. These day's its been widely used by almost all Red Hat based system's. In fact its the default program installer and package management tool these days.
If you are interested in visiting the official home page of YUM, then i would recommend, visiting the below link of Duke university. A Linux software package is nothing but a compressed archive of files,consisting of a particular product information,program files,icons,libraries etc. All required files of an application is compiled in a single file format called with a file extension of. The Red Hat package manager tool, which is installed in all RPM based system, knows how to open and install these.
RPM itself is a vast topic, so we will be covering that in separate post, in great detail. RPM is the package manager tool which installs the package. YUM is a repository management tool which will fetch the appropriate package for your particular version of Linux along with all other required packages.
Repositories is an organized collection of packages that YUM uses. YUM can use these repositories to fetch the correct and exact version of a particular package compatible for your system. Previously before YUM or before the existence of such repository management tools , the user had to fetch the rpm package for installation, and if a dependency problem arises, the user had to fetch those dependencies from internet or some other sources.
You can in fact update all the installed applications on your system, with the help of a single YUM command yum will fetch different packages from appropriate different repositories. However all are not installed, when you install the operating system.
Later on if you need a particular package, its not at all advisable to insert the installation disk once again, and fetch that required. Again if you face dependency problems, you need to fetch that dependency package once again sometimes there are yet another dependency package required for installing your dependency package.
So it becomes a tedious job. Let's go through a step by step method of creating a local YUM repository. Step 1: Copy all the. Step 2: For showing you this example, i will be copying all the. If you see the above output there are around packages in the installation disk, i have not shown the whole output.
As i told before, a repository is nothing but a collection of packages in a directory. YUM was made, so that an operating system can use different repositories at the same time. It is not at all feasible for an operating system to download the entire repository because a repository is sometimes very large in the size of Gigabytes.
And YUM was designed to fetch and download only those packages that are required to install your required software on demand. For example, if i want to install a package called "Perl" , YUM must first have the list of all the package's in a repository note the fact that it only requires the list, not the package. YUM will download the total list of packages available in a repository the list will contain the package names in the repository,package details etc.
Not that it will download only the list of packages with details, not the packages. After downloading the list, If yum was able to fetch all the dependencies for your required package from that repository or other repositories yum will install it after confirming with you. Now lets make that file, which will be containing the package names and other repository details.
For this, there is another tool called "Createrepo". Let's see what createrepo does. After running "createrepo" for our repository directory you will have an extra directory along with the packages inside the repository.
You can clearly see there are four files inside that directory. Let's understand the contents of each and every file in detail. Let's see what's inside that compressed file with the help of "zcat". For explanation i have copied one line from the file "filelists. For this reason, this guide is no longer maintained. See Instead: This guide might still be useful as a reference, but may not work on other CentOS releases.
If available, we strongly recommend using a guide written for the version of CentOS you are using. Additional repositories sometimes hold newer versions of software packages than Official CentOS Repositories. It reads each YUM Repository configuration file to get the information required to download and install new software, resolves software dependencies and installs the required RPM package files.
Use your favorite console text editor and create a new YUM Repository configuration file with. To create a new file with "vi editor" run the following command from console:.
To create Custom YUM Repository we need to install additional software called "createrepo" on our cloud server. We can install "createrepo" by running the following command from console:. Createrepo command reads through Custom YUM Repository directory from "Step 2" and creates a new directory called "repodata" in it.
0コメント