How To Install YUM Server In Redhat(RHEL5)

0 comments

In linux you can install packages through many ways like.
1. Through RPM,
2. Through shell script
3. Through source tar balls etc.

YUM(Yellow-dog Updater and Modifier) is another and advanced way of installing the packages in Linux distros such as Red-hat, Fedora.

In RHEL4 installing packages is a tedious process, some times its headache to install all the dependencies. So Red-hat people come with a solution to overcome this problem in most situations, i.e. nothing but YUM implementation which will resolve this dependency issue. Here I am 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 such as ftp, http etc). You can get the full details about YUM in my google docs here. One Two Three Four Five Six Seven Eight Nine Ten

Basic YUM implementation locally:
Step1 :
Copy the entire OS cd's content to Hard-drive as below.

#cp -ar /media/cdrom/* /destinationfolder

Example : #cp -ar /media/cdrom/* /var/ftp/pub

Note :

1. From second cd on words no need to copy entire cd contents to drive just copy Server content in to drive.

2. Here please take destination folder as /var/ftp/pub so that we can implement FTP server to share our reposatory.

3. If you have RHEL5 DVD then just continue with second step.

#cp -ar /media/cdrom/Server/* /var/ftp/pub/Server/

Step2 : Now change the directory to /destinationfolder/Server and install the createrepo package #rpm -ivh createrepo.0.4.4-2 --aid

Step3 : Specify the reposatory location to YUM.

#createrep -v /destinationfolder/

Step4 : Create a file with repo as extention and specify the YUM details in /etc/yum.repos.d folder

#cd /etc/yum.repos.d/ #vi testing.repo

Note : The directory /etc/yum.repos.d/ contaions two .repo files which should be moved or removed to other directory, so that YUM server will check default .repo file it self. The new file which is created contains as follows

[station1.example.com]

comment ="test"

baseurl=file:///destinationfolder

gpgcheck=0

After entring these entries save and exit from the file.

Let me explain what acutally this four entries mean.

[station1.example.com] ==>This informs what is the reposatory name.

Comment ==> Its used to see the inforamtion about the repo.

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 server 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.

Basic YUM Server Reposatory through FTP server :
So what about Installing packages remotly by using this reposatory?

Let us see how to configure client to access this repository. Before doing client configuration we have to share this reposatory through FTP or HTTP.

Step1 : Install vsftpd server on server

#yum install vsftpd

Step2 : Start the ftp service and on it

#service vsftpd restart

#chkconfig vsftpd on

Thats it on the server side every thing configured properly, Now move on to client machine Confugration on client side :

Step3 : Remove/move the local reposatory file from /etc/yum.repo.d/ folder to some other location #mv /etc/yum.repo.d/* /safe-loc/

Step4 : Create server.repo file in /etc/yum.repo.d/ with following contents [station1.example.com]

comment ="test"

baseurl=ftp://station1.example.com/pub/Server

gpgcheck=0

Save and exit the file Now start using yum to install packages, as follows.

#yum install packagename

Example : #yum install httpd

To uninstall a package through YUM

#yum remove httpd

To see the info of a package

#yum info packagename

To see the package is already installed or not

#rpm -qa grep packagename

  • Like the post? Please Subscribe to free RSS feed to get updates
  • The Runlevels

    0 comments

    Many Windows users are familiar with different modes of execution of their operating system:
    a. Safe mode
    b. Command prompt only
    c. Safe mode with network support
    d. Safe mode with vga


    And other such options that are presented during the boot-up process. Similarly, Linux has different modes of executing as well, which are known as runlevels. But unlike Windows, we can change runlevels on a fly.


    Definition for runlevel : The term runlevel refers to a mode of operation in one of the computer operating system that implement Unix System V-style initialization. This system replaces the traditional /etc/rc and /etc/rc.local scripts used in BSD UNIX. Conventionally, seven runlevels exist, numbered from zero to six, plus an alias runlevel named 'S' and/or 's'.


    Runlevels control services started by the initialization process. The number of runlevels and services started on those runlevels varies with Linux distributions. Information about the runlevels of a particular distribution is listed in file /etc/inittab.


    The contents of the file include the following:


    Default runlevel. The runlevels used by RedHat are :

    # 0 - Halt (Do not set initdefault to this option.)

    # 1 - Single User Mode

    # 2 - Multi-user, without NFS (The same as 3, if you do not have networking)

    # 3 - Full Multi-user Mode

    # 4 - Unused

    # 5 - X11

    # 6 - Reboot (Do not set initdefault to this option.)

    id:3:initdefault: # System initialization. si::sysinit:/etc/rc.d/rc.sysinit

    l0:0:wait:/etc/rc.d/rc 0

    l1:1:wait:/etc/rc.d/rc 1

    l2:2:wait:/etc/rc.d/rc 2

    l3:3:wait:/etc/rc.d/rc 3

    l4:4:wait:/etc/rc.d/rc 4

    l5:5:wait:/etc/rc.d/rc 5

    l6:6:wait:/etc/rc.d/rc 6

    Runlevel 0 : Is halt mode. Telling init to enter runlevel 0 will cause all processes to be killed off, the filesystems unmounted, and the machine to be halted. This is a perfectly acceptable way to bring down the system. On many laptops and modern desktop computers, this will also cause the machine to be turned off. Different commands to go to runlevel 0.

    # halt

    # init 0

    # telinit 0

    # shutdown -h

    Now in the above command h is halting and now indicates shutdown the computer now it self no grace/trancision time for example you want to shutdown the command after 60 min so give the below command # shutdown -h +60.

    Runlevel 1 : Runlevels 1 and 2 are generally used for debugging purposed only, and are not used during normal operations. Most desktop linux distributions boot into runlevel 5, which starts up the Graphical Login Prompt. This allows the user to use the system with X-Windows server enabled. Most servers boot into runlevel 3, which starts the text based login prompt. Linux runlevels can be changed on the fly using the init tool. If you want to switch from text based operations to the Graphical Interface, you just have to type in 'telinit 5' in the root prompt. This will bring up the Graphical Interface in your system. Each runlevel can be configured by the system administrator. The "/etc/inittab" file has information on which runlevel to start the system at and lists the processes to be run at each runlevel. Each runlevel has its own directory structure where you can define the order in which the services start. These directories are located in the /etc/rc.d/ directory, under which you have rc1.d, rc2.d, rc3.d…. rc6.d. Directories where the number from 0 to 6 that corresponds to the runlevel. Inside each directory are symbolic links that point to master initscripts found in /etc/init.d or /etc/rc.d/init.d. You can also change the runlevel at boot time. If your system uses LILO as the boot manager, you can append the runlevel to the boot command : LILO: linux 3 or LILO: linux 5. If your system uses GRUB, you can change the boot runlevel by pressing the `e’ key to edit the boot configuration. Append the runlevel to the end of the boot command as shown : kernel /vmlinuz ro root=/dev/hda1 5 different linux/unix disterbution's runlevels


    Debian Linux :
    Debian, as well as most of the distributions based on it, like Ubuntu, does not make any distinction between runlevels 2 to 5. See also the Debian FAQ on booting.
    0 - Halt
    1 - Single
    2 - Full multi-user with display manager (GUI)
    3 - Full multi-user with display manager (GUI)
    4 - Full multi-user with display manager (GUI)
    5 - Full multi-user with display manager (GUI)
    6 - Reboot

    Red Hat Linux
    Red Hat as well as most of its derivatives uses runlevels like this.
    0 - Halt
    1 - Single
    2 - Not used/User definable
    3 - Full multi-user NO display manager
    4 - Not used/User definable
    5 - Full multi-user with display manager (GUI)
    6 - Reboot

    SUSE Linux
    SUSE uses a similar setup as Red Hat :
    0 - Halt
    1 - Single
    2 - Full multi-user with no networking
    3 - Full multi-user NO display manager
    4 - Not used/User definable
    5 - Full multi-user with display manager (GUI)
    6 - Reboot

    Slackware Linux
    Slackware Linux uses runlevel 1 for maintenance, as on other Linux distributions; runlevels 2, 3 and 5 identically configured for a console (with all services active); and runlevel 4 adds the X Window System.
    0 - Halt
    1 - Single
    2 - Full multi-user NO display manager
    3 - Full multi-user NO display manager
    4 - Full multi-user with display manager (GUI)
    5 - Not used/User definable
    6 - Reboot

    Gentoo Linux
    0 - Halt
    1 - Single
    2 - No network
    3 - Full multi-user with display manager
    4 - Full multi-user with display manager (Alias for runlevel 3)
    5 - Full multi-user with display manager (Alias for runlevel 3)
    6 - Reboot

    System V Releases 3 and 4
    0 - shut down system, power-off if hardware supports it (only available from the console)
    1 - single-user mode, all filesystems unmounted but root, all processes except console processes killed.
    2 - multi-user mode
    3 - multi-user mode with
    RFS (and NFS in release 4) filesystems exported
    4 - multi-user, user-defined
    5 - halt the operating system, go to firmware
    6 - halt the system, reboot to default runlevel
    s, S - identical to 1 except current terminal acts as the system console

    Solaris
    0 - operating system halted; (
    SPARC only) drop to OpenBoot prompt
    S - single-user with only root filesystem mounted (as read-only)
    1 - single-user mode with all local filesystems mounted (read-write)
    2 - multi-user with most daemons started.
    3 - multi-user, identical to 2 (runlevel 3 runs both /sbin/rc2 and /sbin/rc3), with filesystems exported, plus some other network services started.
    4 - alternative multi-user, user defined
    5 - shut down, power-off if hardware supports it
    6 - reboot

    HP-UX
    0 - system halted
    S - single-user, booted to system console only, with only root filesystem mounted (as read-only)
    s - single user, identical to S except the current terminal acts as the system console
    1 - single-user with local filesystems mounted (read-write)
    2 - multi-user with most
    daemons started and Common Desktop Environment launched
    3 - multi-user, nearly identical to runlevel 2 with NFS exported
    4 - multi-user with
    VUE started instead of CDE
    5 - user-defined
    6 - user-defined


    AIX
    AIX does not follow the System V R4 (SVR4) run level specification. It defines run levels from 0 to 9, 0 and 1 are reserved, 2 is the default normal multiuser mode and run levels from 3 to 9 are defined by administrator.
    AIX runlevels
    ID
    Name
    Description
    0
    reserved
    1
    reserved
    2
    Normal multiuser mode
    default mode
    On
    AIX you can check the current runlevel with the following command: $ who -r

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Login To Root User In UBUNTU

    0 comments

    This article totally deals with how to get access to root user in UBUNTU? So going in to topic, by default Ubuntu will not allow us to log in to root user because root user is super user and we can do any thing if we have root access.

    Actually be default in Ubuntu root user is disable(means there is root user with out password set). So if we try to login to root user it will not allow us because there is no password set to that user.

    So the solution to this problem is to set the password to root user so how to do that? A question arises?
    Ans : In order to change the root password we have to log in to run level1.
    if you are new to this run level concept you can get that one
    here. In order to go to run level.

    Step1 : Reboot your Ubuntu system if its on other wise start your ubuntu

    Step2 : Brake the timer when its displaying OS choice at the boot time. To brake the timer press any key. So now we will get 3 lines like below.

    ubuntu, kernel 2.6.18-generic
    ubuntu,kernel 2.6.18-generic(recovery mode)
    ubuntu,MeM test86+

    Like this you will find at the display. Select the first line by up/down arrows and then press "e" to edit that line. And here again you will get some 3 to 4 lines. Select the line with kernel at the starting and then press "e" again. Now press space bar and 1 at the end of that line and then enter. Then press b to boot. Now you will be in run level 1. Then type the below command to reset the root password
    #passwd root

    Then after resetting the password execute exit command. From now on words you will have a chance to log in as root user.

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Archive

    Translate this page

     

    The Linux Juggernaut | Copyright 2006-2009 Surendra Kumar Anne | Surendra's Home Page | Give us feedback how we are doing, Click here