yum configuration in linux

Keywords: yum CentOS SELinux vsftpd

yum configuration using

Network yum Library Service Building

  • Environment: use centos 7 as the server and CentOS 6 as the client
    First, build a local yum with the image
  • Configure / etc/yum.repo.d/bash.repo configuration file
[root@centos7 yum.repos.d]# ls
bak  base.repo
  • Without this file, you can create a suffix as long as it is. repo's
  • We are now editing base.repo file
[base]  library id
name=base library name
baseurl=file:///run/media/root/CentOS\ 7\ x86_64/  rpm Package path, must be repodata.File's parent directory path
gpgcheck=0 Package inspection
enabled = 1 Enable or not
  • Now we install the vsftpd service
[root@centos7 yum.repos.d]# yum install vsftpd
  • The file path of FTP share is / var/ftp/pub. Let's go in and create centos/6/os/x86_64/
[root@centos7 pub]# mkdir -p centos/6/os/x86_64/
[root@centos7 pub]# ll
total 0
drwxr-xr-x. 3 root root 15 Nov 30 19:27 centos
  • The directory created above is a shared directory. Now we copy the rpm package needed to this directory. Because I use a virtual machine, I mount the 6 CD-ROM to this directory
[root@centos7 pub]# mount /dev/sr0 centos/6/os/x86_64/
mount: /dev/sr0 is write-protected, mounting read-only
[root@centos7 pub]# 
  • Now let's start the ftp service
systemctl start vsftpd Open service
systemctl enable vsftpd Start up vsftpd service
centos7 Turn off the firewall
systemctl stop  firewalld Turn off firewall
systemctl disable firwalld Setting on starting
centos6 Turn off the firewall
chkconfig iptables off
service iptables top
//Check if it is empty: iptables -nVL 
---------------------------------
[root@centos7 ~]# systemctl stop firewalld
[root@centos7 ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
----------------------------------------
//We are modifying the selinux file
//Path / etc/selinux/config
[root@centos7 ~]# sed -i.bak 's@SELINUX=enforcing@SELINUX=permissive@'  /etc/selinux/config    
[root@centos7 ~]# setenforce 0  
//In this way, we can access our centos7 address on the browser by ftp://172.168.1.1 You can see the contents of the CD.

Centos 6 client configuration
-We only need to configure yum warehouse

[root@centos6 ~]# vim /etc/yum.repos.d/baes.repo
[base]
name=guo
baseurl=ftp://192.168.27.129/pub/centos/$releasever/os/$basearch/
gpgcheck=0
  • The above variables represent the meaning
    • $releaser: the major release number of the current OS version
    • $basearch: infrastructure x86_ Sixty-four
  • Now we can check the warehouse name with yum repolist. No
[root@centos6 ~]# yum repolist
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
base                                                      | 4.0 kB     00:00     
base/primary_db                                           | 4.7 MB     00:00     
repo id                                repo name                           status
base                                   guo                                 6,706
repolist: 6,706
  • Now we use yum to install a software
[root@centos6 ~]# yum repolist
 So it worked.

About yum troubleshooting errors

  • First, check whether the computers can be interconnected
  • Then check whether the yum configuration is correct (you can clear the cache with yum clean all)
  • See if the firewall and SELinux configurations are turned off.

Posted by ArizonaJohn on Sun, 31 May 2020 10:54:41 -0700