The reason for installing yum server is if you are not using internet at your lab or home and you want to install certain things without using internet from your installation dvd, Because your centos installation dvd contains 3000 packages in it.
You can utilize that dvd for basic package installation:-
For that you have to configure yum server so that it can fetch the packages from inside system:-
Note:- You have to install full desktop of Centos 6 and if you dont wont graphical mode to operate then you can disable graphical mode and operate it through terminal mode.
* YUM- YellowDog Updated Manager:-
* YUM provides:-
1. Resolve Dependencies
2. Can locate RPM from any location
3. Central Repository
Minimum requirement to install yum-server:-
1. IP configuration
2. Vsftpd-Server
How to install Yum-Server ?
1. First give the ip address:-
* Become root:-
# su
# system-config-network-tui
2. Mount the dvd:-
Put centos dvd into your dvd drive and type the following :-
# mount /dev/cdrom /mnt -----> This will mount your dvd to the system
# cd /mnt ------> You can check by going to that directory
# ls ------> To check the content
Note:-
If you have an iso file then copy that iso file of the dvd to the system and mount that iso to the /mnt folder:-
# mount -o loop CentOS-6.2-i386-bin-DVD1.iso /mnt/
3. Now we have to install vsftpd server:-
Go to :-
# cd /mnt
# cd Packages
# rpm -ivh vsftpd-2.2.2-6.el6_0.1.i686.rpm
It will ask you for dependency package of python-lib so please install it with this :-
# rpm -ivh python ---> whatever your package name is :-
Again try to install vsftpd package
# rpm -ivh vsftpd-2.2.2-6.el6_0.1.i686.rpm
After vsftpd is installed start the service:-
# chkconfig vsftpd on
# service vsftpd restart
4. Now we have to copy the whole dvd which we previously mounted to /mnt to pub directory like this:-
# cp -av /mnt/* /var/ftp/pub
5. Now we have to install createrepo package:-
# cd /mnt/Packages
# rpm -ivh createrepo-0.9.8-4.el6.noarch.rpm
* If createrepo package might require some dependency file so please manually install it. the packages is available under " Packages" directory.
6. We have to create repo of the each packages like this:-
# createrepo -v /var/ftp/pub/Packages/ ---> It will take sometime to create it.
If you want to check the packages list in your ftp directory then open firefox and do the following:--
7. Now we have to create one test.repo file :-
# vi /etc/yum.repos.d/test.repo
[Packages]
name=Packages RPM
baseurl=ftp://192.168.100.159/pub/Packages
enable=1
gpgcheck=0
8. Save it by hitting Esc key and after that press "wq!" to save it.
9. Rename the directory inside /etc/yum.repos.d/ with .old like this:-
# mv CentOS-Base.repo CentOS-Base.repo.old
# mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo.old
# mv CentOS-Media.repo CentOS-Media.repo.old
Only test.repo should be remain as it is with .repo extension.
10. Restart the services to take effect
# service network restart
# service vsftpd restart
11. Now disable the firewall
# setsebool -p ftpd_disable_trans=1
# service vsftpd restart
12. Try to update:-
# yum clean all
# yum update all
* If error comes while update command then run this command :-
# restorecon -r /var/ftp/pub
# yum clean all
# yum update all
If you want all your network computer to use this repository then just copy the test.repo file to client computer inside /etc/yum.repos.d/
Rename the three directory inside /etc/yum.repos.d/ in the client system.
# mv CentOS-Base.repo CentOS-Base.repo.old
# mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo.old
# mv CentOS-Media.repo CentOS-Media.repo.old
* Allow ftp traffic through firewall
* Try to update:-
# yum clean all
# yum update all
That's it please enjoy yum-server.
Subscribe by Email
Follow Updates Articles from This Blog via Email
No Comments