Configure YUM server to install/update packages on remote server




In the previous post we learn how to create a YUM repository or YUM server on Redhat Enterprise Linux 6. Now if you want to use this YUM server to manage packages on other servers follow below mentioned steps.







1. Create the YUM server as described in previous post.

2. Install vsftpd using yum command.

# yum install vsftpd

3. Make changes in “/etc/vsftpd/vsftpd.conf” as below.

anonymous_enable=YES
anon_root=/mnt

3. Login to the client machine on which you want to install packages.

4. Create a .repo file in “/etc/yum.repos.d/” directory.

# vi /etc/yum.repos.d/RHEL6.repo

5. Add below mentioned entries in the file “/etc/yum.repos.d/RHEL6.repo”.

[RHEL6]
name= RHEL 6 remote repository
baseurl=file:///yum_server_ip/
enabled=1

6.  Run command yum clean all.

# yum clean all

6. You can now use yum commands to install, remove and query packages.

# yum info httpd
Loaded plugins: aliases, changelog, downloadonly, kabi, presto, product-id, refresh-packagekit, security, subscription-manager, tmprepo, verify,
              : versionlock
Updating certificate-based repositories.
Loading support for Red Hat kernel ABI
Installed Packages
Name           : httpd
Arch             : x86_64
Version        : 2.2.15
Release        : 15.el6
Size               : 2.9 M
Repo             : installed
From repo   : anaconda-RedHatEnterpriseLinux-201105101844.x86_64
Summary     : Apache HTTP Server
URL               : http://httpd.apache.org/
License         : ASL 2.0
Description : The Apache HTTP Server is a powerful, efficient, and extensible
                      : web server.


Read more >>

Configure YUM server in Redhat Enterprise Linux 6 (RHEL6)



Package management is one of the main objectives of RHCSA certification exam. Also as a system administrator you have to install, remove and update packages. In this post we will learn how to configure YUM server for package management on local machine as well as on remote machines. Yum server gives ease to package management in Linux. Using yum server you can query about installed packages, install or remove packages and upgrade or degrade packages as per your requirements. 

The main configuration file for yum server is “/etc/yum.conf”. YUM server gets you out of which we know as “Dependency Hell”. It resolves and installs all dependencies related to a package. YUM server creates a database of packages. In this database it stores information like: all installed packages, all available packages, updates, etc. In this post we will see:
  •  How to configure local YUM server for RHEL6 DVD iso.
  • How to create YUM server to update packages through FTP.
  • How to configure YUM clients.
  STEPS TO CONFIGURE YUM SERVER.

In this exercise we will use RHEL6 DVD.iso. You can mount and copy contents of DVD on local server or if you don’t have enough space you can mount and directly use it as a repository. For now we will mount RHEL6 DVD.iso and use it as our repository for packages.

1. Mount the RHEL6 DVD.iso on /mnt (you can mount it on any directory of your choice).

# mount -o loop rhel-server-6.2-x86_64-dvd.iso /mnt

2. Create a new file in directory “/etc/yum.repos.d/”.
    Note: “/etc/yum.repos.d/” directory is default configuration directory for yum. You have to create a file with extension “.repo”

# vi /etc/yum.repos.d/RHEL6.repo

3. Make below mentioned entries in “/etc/yum.repos.d/RHEL6.repo” file.

[RHEL6]
name= RHEL 6 local repository
baseurl=file:///mnt/
enabled=1

Where
[RHEL6]: Repository Name.
name: Information related to the repository.
baseurl: Path to the repository. Here we used repository path as file as we have the repository locally. If you want to use remote repository you can use ftp or http in baseurl.
enable=1: To enable this reporitory.

4. Run command yum clean all.

# yum clean all

6. You can now use yum commands to install, remove and query packages.

# yum info httpd
Loaded plugins: aliases, changelog, downloadonly, kabi, presto, product-id, refresh-packagekit, security, subscription-manager, tmprepo, verify,
              : versionlock
Updating certificate-based repositories.
Loading support for Red Hat kernel ABI
Installed Packages
Name           : httpd
Arch             : x86_64
Version        : 2.2.15
Release        : 15.el6
Size               : 2.9 M
Repo             : installed
From repo   : anaconda-RedHatEnterpriseLinux-201105101844.x86_64
Summary     : Apache HTTP Server
URL               : http://httpd.apache.org/
License         : ASL 2.0
Description : The Apache HTTP Server is a powerful, efficient, and extensible
                      : web server.
  

In the next post we will learn how to install/update packages on a remote server form yum server.
Read more >>
Related Posts Plugin for WordPress, Blogger...