Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Mkdir /dump
cd /etc/yum.repos.d/
Rm rf /etc/yum.repos.d/*
Step 4: Create new file and add below content as per below.
[local]
name=rhel-5.8
baseurl=file:///dump
enabled=1
gpgcheck=0
Whether you perform network installation or create yum repository file you need dump of
RHEL CD. It is generally created on server in RHCE exam. Candidate is given a location
ofthis dump to perform network installation. We will create dump of RHEL CD on
/var/ftp/pub and use this for network installation or to create yum repository files.
Check how many space is available on /var partition mimimun 4 GB space is required
Now mount RHEL dvd on mnt and copy entire disk on /var/ftp/pub
If you have more than 1 yum local repo, in this case if you want to install package default from
specific repo then you can use below command
# yum repolist
Using above command you can find all repos which are available. Then disable all and enable which
is your require.
Which returns available packages that are only in that particular repo
936 clear
937 history
total 16
[prasad.repo]
name=prasad.repo
baseurl=file:///dump1
gpgcheck=0
enabled=1
[prasadlocal.repo]
name=prasadlocal.repo
baseurl=file:///var/ftp/pub/dump
gpgcheck=0
enabled=1
we assume that you have completed these pre quest of yum server
Once you have completed these pre quests follow this guide.
change directory to /var/ftp/pub/Server
yum and createrepo rpm are required for yum server install them
During the process of creating repository two hidden directory with named .olddata is
created automatically remove them
Now check hostname and change directory to /etc/yum.repos.d. copy sample repository file
to the file with hostname And open it
Remove defaults line and set new location of Sever and VT as shown here
Save file with :wq and exit
Now remove all temporary data file with yum clean all command
1. Through RPM,
YUM(Yellow-dog Updater and Modifier) is another and advanced way of installing the
packages in Linux distro's such as Red-hat, Fedora and CenOS.
In RHEL4 installing packages is a tedious process, some times its headache to install all the
dependencies. So Red-hat come with a solution to overcome this dependencies problem in
most situations, the solution for this is nothing but YUM implementation. This will resolve
this dependency issue and other known issues. Here we are going to present some basic way
how to use YUM utility to install packages locally(there are so many ways to install packages
from different sources either local or remote such as ftp, http).
Example :
Note :
1. From second cd too Server content in to our /var/ftp/pub/Server/ folder as shown below.
2. Here please take destination folder as /var/ftp/pub so that we can implement FTP server to
share our repository.
3. If you have RHEL5 DVD then execute below command once.
Step2 : Now change the directory to /var/ftp/pub/Server and install the createrepo package
server1#cd /var/ftp/pub/Server
server1#rpm -ivh createrepo*
server1#createrep -v .
server1#cd /etc/yum.repos.d/
server1#vi testing.repo
Note : The directory /etc/yum.repos.d/ contaions two .repo files which should be removed or
moved to other directory, so that YUM server will check default .repo file it self.Q. What if I
don't move or remove the default .repo files from /etc/yum.repos.d/ folder?A: Every time
when you try to install packages through YUM, your yum will check all these files for
repositories for getting packages which will or will not work and most probably delay is
increased in getting those packages from online servers.
After entering these entries save and exit from the file.
baseurl ==> This is the server and path of the repo(here its a local repo so the base url is just
a file:///
For example you are creating YUM client through FTP then base url should be like this
baseurl=ftp://station1.example.com/pub/Server
gpgcheck ==> This is to check the authentication of the repository, which is disabled in this
case.
Local YUM repository is created, now you can install any package you want with yum
command. In order to know more about YUM, Please see man pages for YUM.
Note:In-order to use yum repository we have to clean the yum meta data, so before installing
any package first time use yum clean all command as shown below.
Let us see how to configure client to access this repository. Before doing client configuration
we have to share this repository through FTP or HTTP.
server1#chkconfig vsftpd on
That's it on the server side every thing configured properly, Now move on to client machine.
[server1.linuxnix.com]
comment ="test"
baseurl=ftp://server1.example.com/pub/Server
gpgcheck=0
Save and exit the file Now start using yum to install packages, as follows.
client1#yum clean all
client1#yum install packagename
Example :
Rhn.redhat.com
Trying 209.132.183.42...
Connected to rhn.redhat.com.
^]
telnet> quit
Connection closed.
# rhn_register
# rhnreg_ks --username=<RHN or Satellite login> --password=<RHN or
Satellite password> --force
Or
/etc/sysconfig/rhn
[root@altipayapp rhn]# ls
rhnlib-2.5.22-15.el6.noarch
yum-rhn-plugin-0.9.1-49.el6.noarch
rhn-setup-1.0.0.1-16.el6.noarch
rhn-client-tools-1.0.0.1-16.el6.noarch
rhn-setup-gnome-1.0.0.1-16.el6.noarch
rhn-check-1.0.0.1-16.el6.noarch
rhnsd-4.9.3-2.el6.x86_64
Unregistering a system
Raw
more /etc/sysconfig/rhn/systemid
<name>profile_name</name>
<value><string>altipayweb.altimetrik.com</string></value>
</member>
<member>
<name>system_id</name>
<value><string>ID-1027843310</string></value>
Subscription-manager has specific options available for each command, depending on what
operation is being performed. Subscription Manager com-
1. register
2. unregister
3. attach
4. auto-attach
5.remove
6. release
7. service-level
8. import
9. redeem
10. list
11. refresh
12. environments
13. repos
14. orgs
15. plugins
16. identity
17. facts
18. clean
19. config
20. version
21. status
+-------------------------------------------+
WARNING
This system has already been registered with Red Hat using RHN Classic.
Your system is being registered again using Red Hat Subscription Management. Red Hat
recommends that customers only register once.
To learn how to unregister from either service please consult this Knowledge Base Article:
https://access.redhat.com/kb/docs/DOC-45563
[root@altipayweb ~]#
Install Plugin
Type the following command:
# yum install yum-security
Type the following command to download and install all the available security updates:
# yum update --security
In Enterprise Linux, it is often desirable to minimize the number of updates to install. Many
admins just want to apply security-related updates. This is easily done using yum security
plugin. First, install the plugin:
===========================================================================
========
Package Arch Version Repository
Size
===========================================================================
========
Updating:
mysql x86_64 5.1.69-1.el6_4 rhel-x86_64-server-6
907 k
mysql-libs x86_64 5.1.69-1.el6_4 rhel-x86_64-server-6
1.2 M
mysql-server x86_64 5.1.69-1.el6_4 rhel-x86_64-server-6
8.7 M
Transaction Summary
===========================================================================
========
Thats it. But there are many other things you can do. For example, yum updateinfo has
some handy options. Try the following:
The second command will display the advisory info such as:
RHSA-2013:0772 Important/Sec. mysql-5.1.69-1.el6_4.x86_64
sl-fastbugs. The sl-security repo contains security-related packages plus their dependencies
and is shipped enabled by default. The sl-fastbugs repository is for non-security updates
which is shipped disabled. Thus, applying security only updates is the default behavior.
Downgrade
2.6.32-573.el6.i686
Resolving Dependencies
================================================================================
================================================================================
Downgrading:
Transaction Summary
================================================================================
Downgrade 1 Package(s)
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction
Removed:
centos-release.i686 0:6-7.el6.centos.12.3
Installed:
centos-release.i686 0:6-5.el6.centos.11.1
Complete!
List packages recently added into the repositories. This is often not helpful,
but what you may really want to use is "yum list-updateinfo new" from the secu-
To make permanent changes, edit the /etc/yum.conf file and following entries to it:
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exclude=kernel* redhat-release*
NOTE: If there are multiple package to be excluded then separate them using a single space
or comma. Also, do not add multiple exclude= lines in the configuration file
because yum only considers the last exclude entry.
exclude=*.i?86 *.i686