Tag Archives: centos7

[Solved] Centos7 Execute Script Error: syntax error near unexpected token `fi’

When the script written on the window computer is executed on Linux and always reports an error, as shown below

syntax error near unexpected token `fi'

Solution:

Open the file with vim and enter it in command line mode

:set ff

If it shows fileformat=dos
Now set our code mode with the command: set ff=unix
Execute: wq!
Check again to see that the code is programmed for unix


Via cat – V * * SH check that the code is normal.

In this way, there will be no errors when executing the code again.

[Solved] CentOS7 clickhouse Install error: Missing the Dependecy libicudata.so.50

The following error occurred when installing Clickhouse under CentOS 7

root@localhost 7]# rpm -ivh clickhouse-common-static-18.14.13-1.el7.x86_64.rpm
Error: Dependency detection failed.
libicudata.so.50()(64bit) is required by clickhouse-common-static-18.14.13-1.el7.x86_64
libicui18n.so.50()(64bit) Required by clickhouse-common-static-18.14.13-1.el7.x86_64
libicuuc.so.50()(64bit) required by clickhouse-common-static-18.14.13-1.el7.x86_64

use

yum install libicu.x86_64

 

Solution:

It doesn’t work for CentOS 8

Please check for details

https://centos.pkgs.org/7/centos-x86_64/libicu-50.2-4.el7_7.x86_64.rpm.html

Error message after installing docker in CentOS 7

Start docker

 

$ sudo systemctl start docker

report errors.

View status:

$ systemctl status docker.service -l

If you add – L, some lines of information are very long and will be omitted during printing. If you add this parameter, all lines will be displayed.

 

 

Error message:

Error starting daemon: SELinux is not supported with the overlay2 graph driver on this kernel. Either boot into a newer kernel or disable selinux in docker (–selinux-enabled=false)

This means that SELinux in the Linux kernel does not support the overlay 2 graph driver. There are two solutions: either start a new kernel or disable SELinux in the docker, — SELinux enabled = false

 

Re edit the docker configuration file:

vi /etc/sysconfig/docker

 

Replace with:

 

Restart docker:

 

 

View status:

$ systemctl status docker.service -l

Done!!

Handling of various error reports of installing vmtools on CentOS 7

Basically, if an error occurs when installing vmtools, first record the error information

For example, what I met this time is

/TMP/modconfig-8md7iy/vmhgfs only/page. C: 1625:23: error: supplied to function ‘wait’_on_Too many arguments for bit ‘
task_UNINTERRUPTIBLE);

This error report is different due to specific circumstances, and the handling method is basically the same

First run uname – A to see the kernel version of CentOS

Linux localhost.localdomain 3.10.0-514.2.2.el7.x86_64 #1 SMP Tue Dec 6 23:06:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

You can see that my current is 3.10.0

Then go to the installation directory of vmtools and find the vmhgfs.tar compressed package

Decompress

In the extracted vmhgfs only folder, find the corresponding error file. In this case, it is line 1625 of page. C

Change its previous judgment from 3,17,0 to its own kernel. Here is 3,10,0

Then run the installation again

 

When other error reporting information is different, you should see the error reporting content clearly. Some of the error reporting contents have prompt error reporting reasons, which should be handled according to the error reporting reasons

 

In vmware10, centos7 mounts the shared folder of windows host, and prompts: error: cannot mount filesystem: no such device

1. Set sharing permissions

Write picture description here

2. Install VMware tools

Write picture description here

  • Click on the virtual machine
  • Click to install VMware tools
  • Copy VMwareTools-9.6.2-1688356.tar.gz in the /run/media/zhaojq/VMware\ Tools directory to the home directory
  • Generate vmware-tools-distrib after decompression
  1. [zhaojq @localhost vmware-tools-distrib] $ ls
  2. bin doc etc FILES INSTALL installer lib vmware-install.pl

Run ./vmware-install.pl

[zhaojq@localhost vmware-tools-distrib]$ ./vmware-install.pl 

Keep enter

  1. The path “” is not valid path to the gcc binary.
  2. Would you like to change it? [yes] no
  3. Enter no
  4. At The path “” IS not A! Valid path to at The 3.10 .0 – 514.26 .2.el7.x86_64 Kernel
  5. headers.
  6. Would you like to change it? [yes] no
  7. Enter no

Return after successful installation

  1. Enjoy ,
  2. – – at The VMware Team

2. Mount the shared folder of the Windows host

mnt/hgfs directory

  1. [zhaojq @localhost ~] cd /mnt/hgfs/
  2. [zhaojq @localhost hgfs] pwd
  3. /mnt/hgfs

vmware-hgfsclient command to view the current shared directory

  1. [zhaojq @localhost hgfs] $ vmware-hgfsclient
  2. E

mount error

  1. [zhaojq @localhost hgfs] $ sudo mount -t vmhgfs. host:/ E /mnt/hgfs
  2. Error : cannot mount filesystem: No such device

 

vmhgfs-fuse, need to install toolkit

  1. [zhaojq @localhost hgfs] $ yum install open-vm-tools-devel -y
  2. [zhaojq @localhost hgfs] $ vmhgfs-fuse. host:/ E /mnt/hgfs

 

3. View the mount

Note: Root privileges are required to view.

Disk E of the Windows host

Write picture description here

Mount situation under Centos virtual machine

  1. [root@localhost hgfs] # ls
  2. jashkenas-coffeescript- 1.12 . 6- 0-gf0e9837 .tar .gz LeaRun agile background development framework_6 . 3 .4 $RECYCLE .BIN System Volume Information
  3. LeaRun_6 . 3 .4 .zip node-v6 . 11 .1-linux-x64 .tar .xz redis- 3.2 . 9 .tar .gz

 

Mounted successfully

Centos7 vmware Install Error: C header files matching your running kernel were not found.

C header files matching your running kernel were not found when installing VMware in centos7

02 OCT 2015 06:48:45jcxch number of readings: 3812

When installing VMware 11.0 in CentOS 7

1. Install gcc compiler first, because some files need to be compiled when installing VMware. If the system does not install GCC, you will be prompted to install GCC. Just use Yum install GCC

2. C header files matching your running kernel were not found. Refer to your distribution’s documentation for installation instruction. The general meaning is that there are no C header files and other files found in the current kernel. If there is such a problem that the development package of the corresponding kernel is not installed, you need to solve it by Yum install kernel devel or download the corresponding RPM package for installation

Centos7 Install MYSQL Error: Could NOT find Curses (missing CURSES_LIBRARY CURSES_INCLUDE_PATH)

Today, when installing mysql 5.7, I had the following problem when compiling.

[root@localhost software]# cd mysql-5.7.21

[root@localhost mysql-5.7.21]# cmake .

The following error message appears.

— Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:82 (MESSAGE):
Curses library not found. Please install appropriate package,

remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
cmake/readline.cmake:126 (FIND_CURSES)
cmake/readline.cmake:216 (MYSQL_USE_BUNDLED_LIBEDIT)
CMakeLists.txt:250 (MYSQL_CHECK_READLINE)

— Configuring incomplete, errors occurred!

 

Solution:

[root@xxxxxxx mysql-5.7.21]# rm CMakeCache.txt

[root@xxxxxxx mysql-5.7.21]# yum install ncurses-devel

[root@xxxxxxx mysql-5.7.21]# yum install bison

[[email protected]]# make && make install

Done!

Centos7 Compile Error: ./configure: No such file or directory

Generally, look at the readme and install files in the directory, which will tell you how to install the software

Now I know that there may be two situations:

1. When there is no configure in the directory, but there is configure.am or configure.in, you need to use Autoconf command to generate configure. The code is as follows:

$CD (software name) – (version number)
$Autoconf

2. This software or library is not installed in the following way

$CD (software name) – (version number)
$./configure
$make
$sudomakeinstall

You need to carefully read the relevant files under the folder, readme, and so on, according to the way written inside to install

Install a docker container in centos7 that can log in SSH

Recently, I’ve been working on docker, which really excited me for a few days. Let’s share the installation process

Because docker requires a higher version of Linux kernel, I installed centos7 in VBox. As for how to install CentOS 7, I don’t need to worry about it. Here is the minimal installation

First, configure the network card to ensure that the virtual machine can access the network normally, because the installation of docker requires networking. I am usually used to setting up two network cards when installing virtual machine. One uses NAT to connect and is responsible for surfing the Internet; A host only connection is used to connect the host to the virtual machine. Then enable the two network cards, the simplest way is to enter dhclient mode, the system will automatically assign IP to the network card

First of all, the command to install docker:
is used

#yum-yinstalldocker

After the installation, you can use the following command to view the available images:

#dockerimages
REPOSITORYTAGIMAGEIDCREATEDVIRTUALSIZE

At this time, no image is available and the container cannot be started, so we need to download the image. In this step, we can choose to download images of different systems. Here, we still choose the most familiar CentOS. In this step, docker will download image files online

#dockerpullcentos

Wait until the image download is completed, and then use the docker images command to see several CentOS images:

#dockerimages
REPOSITORYTAGIMAGEIDCREATEDVIRTUALSIZE

 

First, build a docker container that can be accessed through SSH

1. Start a docker container:

#dockerrun-i-tcentos/bin/bash

This creates a new docker container and enters the bash of the container

2. Install sshd:

#yum-yinstallopenssh-server

3. Start sshd. Use absolute path here. To view the path of a command, use where is or which:

#/usr/sbin/sshd-D

The following error occurs when starting sshd under centos.

Could not load host key: /etc/ssh/ssh_host_rsa_key

Could not load host key: /etc/ssh/ssh_host_dsa_key

Simply execute the following commands in sequence.

ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key #just enter

ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key #just enter

ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N “”

Press and start the sshd service again, it should be fine. 4.

4. After finishing, edit the sshd_config configuration file, find the paragraph UsePAM yes, change it to UsePAM no

#UsePAMno
UsePAMyes
to
UsePAMno
#UsePAMyes

If you don’t modify this paragraph, you will exit immediately when you log in to the container using SSH

5. Install passwd and change the password of root

#yum-yinstallpasswd
#passwroot
Changingpasswordforuserroot.
Newpassword:

6. After changing the password, execute the exit command to exit. At this time, you will return to the shell of the host machine and execute the following command to submit the container to the image:

#dockercommitcontaineridimagename

Here, containerid is the ID of the container, and imagename is the name of the image at the time of submission. It’s better to use a new name when submitting for the first time, instead of covering the original clean CentOS image

The container ID can be viewed through the docker PS – L command. After starting the container, the default host name is actually the container ID

7. Start a new container through docker run. The parameter – D means running in the background and – P means mapping the docker to the host port

#dockerrun-d-p10022:22imagename/usr/sbin/sshd-D

If there is no problem starting, you can log in to the container:

#sshroot@localhost-p10022

After logging in, we can install all kinds of software and build all kinds of environments