redhat6 and redhat5 configure local mirroring and install memcache

  • First of all, when we can use the external network, we only need to change the local image source to Alibaba Cloud or Netease Cloud, and the image of Douban Cloud is fine.

** If we cannot connect to the public network in the intranet, we need to configure the local mirror cloud **

Configure local mirror source

  • Use df -h to check whether there is a local mirror source configured on the system
  • Configured local mirror source

Local mirror source is not configured:

  • We first use cat /etc/redhat-release centos to use cat /etc/centos-release to view the system version

  • Go to download the corresponding mirror version. If it is 5.5, you must download 5.5 and cannot use other versions.

  • Then upload the downloaded corresponding image to a directory on the system

  • Then start to mount it locally

  • My system is redhat-6.8 I uploaded the downloaded mirror to the /data directory

  • mount command

Mount -o rw,loop The location where your image is saved Create a directory on the system to save the mount point Generally, a cdroom is built under /media

My save image is under /data so my command is

mount -o rw,loop /data/rhel-server-6.8-x86_64-dvd.iso /media/cdrom/

At this time, go to /etc/yum.repos.d/ to back up the previous rhel-media.repo, and some mirrors are named yum.repo

At this time, go to /etc/yum.repos.d/ to back up the previous rhel-media.repo, and some mirrors are named yum.repo
cd /etc/yum.repos.d/
cp rhel-media.repo rhel-media.repo_bak
Vim cp rhel-media.repo


Mirror version 5 and version 6 are different here
Below are the modifications for version 5 of rhel-media

There is this difference between version 5 and version 6 when configuring parameters. Everyone must pay attention to it.

Execute the following:

yum clean all
yum makecache
yum -y install yum

Then you can download your corresponding template, such as gcc

yum install -y gcc

When unmounting the mount point is

umount /media/cdrom

Error when installing libevent:

configure: error: in `/data/libevent-1.4.14b-stable':
configure: error: no acceptable C compiler found in $PATH

This is the missing gcc module, you need to install the gcc module

Error when installing memcache

gcc -std=gnu99 -DHAVE_CONFIG_H -I.  -DNDEBUG   -g -O2 -pthread -pthread -Wall -Werror -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -fno-strict-aliasing -MT memcached-memcached.o -MD -MP -MF .deps/memcached-mem
cached.Tpo -c -o memcached-memcached.o `test -f 'memcached.c' || echo './'`memcached.ccc1: warnings being treated as errors
memcached.c:99: error: in'evutil_socket_t'declaration, the type defaults to'int'
memcached.c:99: mistake: expected ';', ',' or ')' before 'fd'
memcached.c:163: error: in'evutil_socket_t'declaration, the type defaults to'int'
memcached.c:163: mistake: expected ';', ',' or ')' before 'fd'
memcached.c: in function'conn_worker_readd'middle:
memcached.c:526: mistake:'event_handler'not declared(first use within this function)
memcached.c:526: mistake:(Each undeclared identifier in its
memcached.c:526: Error: Also reported only once within the function.)
memcached.c: in function'conn_new'middle:
memcached.c:707: mistake:'event_handler'not declared(first use within this function)
memcached.c: in function'update_event'middle:
memcached.c:2705: mistake:'event_handler'not declared(first use within this function)
memcached.c: in function'do_accept_new_conns'middle:
memcached.c:2751: error: implicitly declared function'maxconns_handler'
memcached.c: At the file level:
memcached.c:3581: error: in'evutil_socket_t'declaration, the type defaults to'int'
memcached.c:3581: mistake: expected ';', ',' or ')' before 'fd'
memcached.c:4013: error: in'evutil_socket_t'declaration, the type defaults to'int'
memcached.c:4013: mistake: expected ';', ',' or ')' before 'fd'
memcached.c: in function'main'middle:
memcached.c:6282: error: implicitly declared function'clock_handler'
If the error above the installation report may be that the version is too high, if the version used is not high, you can use the following solutions
 because when you finish make After that, a file will appear in your current unzip directory. Makefile document,
 We want to modify the content of the file CFLAGS in the parameter-Werror The parameters can be removed and then executed make install ,
  Remember not to do it again make  direct execution make install can be installed normally
 or execute first make clean Modify again Makefile re-execute make install
 it's ready to install
1: first memcache under the file Makefile file removal-Werroe parameter
2: then execute directly make install You can install it. Remember not to execute it again. make
 because Makefile was executed make appeared later
 when you./configure -prefix=/usr/After that just make the installation directory
 Then make That is, the compilation has been generated Makefile Appears in the root directory after the file is unzipped,
 At this time, execute it in your current directory make appears when Makefile

Tags: Linux

Posted by ace21 on Fri, 06 May 2022 03:50:48 +0300