Category Archives: Linux

Linux: How to Solve Git clone error

How to Solve Error: error: The requested URL returned error: 401 Unauthorized while accessing

Problem:

Error: error: The requested URL returned error: 401 Unauthorized while accessing
git version1.7.1

Solution 1: Assign a user
git clone https://github.com/org/project.git

change to
git clone https://[email protected]/org/project.git
or
git clone https://username:[email protected]/org/project.git

If it appears in push or pull, then you need to change the remote address
git remote set-url origin https://[email protected]/org/project.git

Solution 2: Remove validation
git config -global http.sslverify false

Solution 3: (recommended)
Upgrade git version ≥ 1.7.10

Solution 4:
Add ssh secret key

 

[Solved] Yum command error: could not retrieve mirrorlist http://mirrorlist.centos.org…

Yum command error reporting solution

Problem Description:

An error occurs when running the yum install gcc-c + + command on the VMware virtual machine

Error message:

could not retrieve mirrorlist http://mirrorlist.centos.org/release=6&arch=x86_64%repo=os error was 14: PYCURL ERROR 
6 - "Counldn't resolve host 'mirrorlist.centos.org'"

Possible cause analysis:

1. DNS is not set

2. The connection mode of the network adapter is incorrect. The NAT mode is used locally and the bridge mode is used for the router

3. IP is not in the same network segment

4. The virtual machine service is not turned on

Solution:

1. Open the virtual machine — > Virtual machine settings — > Network adapter — > Network connection, set to bridge mode

2. Open ifcfg eno16777736 under etc/sysconfig/network scripts (the file name may be different), and set:

TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=eno16777736
UUID=4875d5bc-07e0-4951-8cd3-3fa7570c6201
ONBOOT=yes
HWADDR=00:0C:29:12:7C:E7
PEERDNS=yes
PEERROUTES=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes

 

3. Open the resolv.conf file in the directory etc and set:

3.1 if the network cable is directly connected to the local route, make the following settings:

domain www.tendawifi.com            [loacal DNS]
search www.tendawifi.com            [loacal DNS]
nameserver 192.168.0.1                [loacal IP]

3.2 if WiFi is connected, set:

# this is google DNS
nameserver 8.8.8.8
nameserver 8.8.4.4

# localhost DNS
nameserver 168.192.1.1            [local default gateway]
nameserver 168.192.1.101 [local IPv4 address]
search localdomain [fixed, means search local DNS]

4. Restart the service, service network restart, Ping Google Ping www.google.com

[Solved] Centos7 redis.service Startup error: Failed to start Redis persistent key-value database.

Report error information

Execute systemctl start redis.service

Failed to start Redis persistent key-value database.

Processing process

Execute journalctl – ex

Reading the configuration file, at line 129
>>> 'deemonize yes'
Bad directive or wrong number of arguments

Error parameter

Problem solving

Modify related line parameters

 

Linux Server: How to Check ECC error check

Ipmitool tools are required

[root@Resource ~]# yum install ipmitool

First, check whether there are ECC errors

As shown below:

[root@Resource ~]# ipmitool sel list
   1 | 11/26/2016 | 05:21:07 | Event Logging Disabled #0x72 | Log area reset/cleared | Asserted
   2 | 11/26/2016 | 05:30:54 | OS Boot | C: boot completed | Asserted
   3 | 11/26/2016 | 05:30:54 | OEM record dc | 000137 | 00001e395800
   4 | 02/14/2017 | 16:58:06 | Physical Security #0x73 | General Chassis intrusion () | Asserted
   5 | 02/14/2017 | 16:58:11 | Physical Security #0x73 | General Chassis intrusion () | Deasserted
   6 | 02/14/2017 | 16:58:15 | Power Supply #0x74 | Redundancy Lost | Asserted
   7 | 02/14/2017 | 17:24:43 | Physical Security #0x73 | General Chassis intrusion () | Asserted
   8 | 02/14/2017 | 17:29:56 | Physical Security #0x73 | General Chassis intrusion () | Asserted
   9 | 02/14/2017 | 17:40:14 | Physical Security #0x73 | General Chassis intrusion () | Asserted
   a | 02/14/2017 | 17:40:40 | Unknown #0x2e |  | Asserted
   b | 02/14/2017 | 17:40:40 | Memory #0x02 | Uncorrectable ECC (UnCorrectable ECC |  DIMMB3) | Asserted
   c | 02/14/2017 | 17:40:40 | Unknown #0x2e |  | Asserted
   d | 02/14/2017 | 17:40:40 | Memory #0x02 | Uncorrectable ECC (UnCorrectable ECC |  DIMMB3) | Asserted
   e | 02/14/2017 | 17:42:26 | Physical Security #0x73 | General Chassis intrusion () | Asserted
   f | 02/14/2017 | 17:42:56 | Unknown #0x2e |  | Asserted
  10 | 02/14/2017 | 17:42:56 | Memory #0x02 | Uncorrectable ECC (UnCorrectable ECC |  DIMMB3) | Asserted
  11 | 02/14/2017 | 17:42:56 | Unknown #0x2e |  | Asserted
  12 | 02/14/2017 | 17:42:56 | Memory #0x02 | Uncorrectable ECC (UnCorrectable ECC |  DIMMB3) | Asserted
  13 | 02/14/2017 | 17:44:24 | Physical Security #0x73 | General Chassis intrusion () | Asserted
  14 | 02/14/2017 | 17:44:49 | Unknown #0x2e |  | Asserted
  15 | 02/14/2017 | 17:44:49 | Memory #0x02 | Uncorrectable ECC (UnCorrectable ECC |  DIMMB3) | Asserted
  16 | 02/14/2017 | 17:44:49 | Unknown #0x2e |  | Asserted
  17 | 02/14/2017 | 17:44:49 | Memory #0x02 | Uncorrectable ECC (UnCorrectable ECC |  DIMMB3) | Asserted
  18 | 02/14/2017 | 17:48:39 | Physical Security #0x73 | General Chassis intrusion () | Asserted
  19 | 02/15/2017 | 11:37:24 | Physical Security #0x73 | General Chassis intrusion () | Asserted
  1a | 02/15/2017 | 11:37:29 | Physical Security #0x73 | General Chassis intrusion () | Deasserted
  1b | 02/16/2017 | 01:41:13 | Drive Slot #0xa1 | Drive Present () | Deasserted
  1c | 02/16/2017 | 01:41:14 | Drive Slot #0xa3 | Drive Present () | Deasserted
  1d | 02/16/2017 | 01:41:15 | Drive Slot #0xa2 | Drive Present () | Deasserted
  1e | 02/16/2017 | 04:23:43 | Drive Slot #0xa1 | Drive Present () | Asserted
  1f | 02/16/2017 | 04:23:43 | Drive Slot #0xa3 | Drive Present () | Asserted
  20 | 02/16/2017 | 04:23:45 | Drive Slot #0xa0 | Drive Present () | Deasserted
  21 | 02/16/2017 | 04:23:45 | Drive Slot #0xa2 | Drive Present () | Asserted
  22 | 02/16/2017 | 04:25:49 | Drive Slot #0xa0 | Drive Present () | Asserted
  23 | 07/10/2017 | 07:27:14 | Temperature #0x04 | Upper Non-critical going high | Asserted
  24 | 07/10/2017 | 10:00:12 | Temperature #0x04 | Upper Non-critical going high | Deasserted
  25 | 07/10/2017 | 10:01:37 | Temperature #0x04 | Upper Non-critical going high | Asserted
  26 | 07/10/2017 | 10:26:07 | Temperature #0x04 | Upper Non-critical going high | Deasserted
  27 | 11/09/2017 | 06:09:42 | Physical Security #0x73 | General Chassis intrusion () | Asserted
  28 | 11/09/2017 | 06:12:32 | Physical Security #0x73 | General Chassis intrusion () | Deasserted

 

The error message is a TXT file, as shown below

[root@Resource ~]# ipmitool sel save SN12345.txt
1 | 11/26/2016 | 05:21:07 | Event Logging Disabled #0x72 | Log area reset/cleared | Asserted
2 | 11/26/2016 | 05:30:54 | OS Boot | C: boot completed | Asserted
3 | 11/26/2016 | 05:30:54 | OEM record dc | 000137 | 00001e395800
4 | 02/14/2017 | 16:58:06 | Physical Security #0x73 | General Chassis intrusion () | Asserted
5 | 02/14/2017 | 16:58:11 | Physical Security #0x73 | General Chassis intrusion () | Deasserted
6 | 02/14/2017 | 16:58:15 | Power Supply #0x74 | Redundancy Lost | Asserted
7 | 02/14/2017 | 17:24:43 | Physical Security #0x73 | General Chassis intrusion () | Asserted
8 | 02/14/2017 | 17:29:56 | Physical Security #0x73 | General Chassis intrusion () | Asserted
9 | 02/14/2017 | 17:40:14 | Physical Security #0x73 | General Chassis intrusion () | Asserted
a | 02/14/2017 | 17:40:40 | Unknown #0x2e | | Asserted
b | 02/14/2017 | 17:40:40 | Memory #0x02 | Uncorrectable ECC (UnCorrectable ECC | DIMMB3) | Asserted
c | 02/14/2017 | 17:40:40 | Unknown #0x2e | | Asserted
d | 02/14/2017 | 17:40:40 | Memory #0x02 | Uncorrectable ECC (UnCorrectable ECC | DIMMB3) | Asserted
e | 02/14/2017 | 17:42:26 | Physical Security #0x73 | General Chassis intrusion () | Asserted
f | 02/14/2017 | 17:42:56 | Unknown #0x2e | | Asserted
10 | 02/14/2017 | 17:42:56 | Memory #0x02 | Uncorrectable ECC (UnCorrectable ECC | DIMMB3) | Asserted
11 | 02/14/2017 | 17:42:56 | Unknown #0x2e | | Asserted
12 | 02/14/2017 | 17:42:56 | Memory #0x02 | Uncorrectable ECC (UnCorrectable ECC | DIMMB3) | Asserted
13 | 02/14/2017 | 17:44:24 | Physical Security #0x73 | General Chassis intrusion () | Asserted
14 | 02/14/2017 | 17:44:49 | Unknown #0x2e | | Asserted
15 | 02/14/2017 | 17:44:49 | Memory #0x02 | Uncorrectable ECC (UnCorrectable ECC | DIMMB3) | Asserted
16 | 02/14/2017 | 17:44:49 | Unknown #0x2e | | Asserted
17 | 02/14/2017 | 17:44:49 | Memory #0x02 | Uncorrectable ECC (UnCorrectable ECC | DIMMB3) | Asserted
18 | 02/14/2017 | 17:48:39 | Physical Security #0x73 | General Chassis intrusion () | Asserted
19 | 02/15/2017 | 11:37:24 | Physical Security #0x73 | General Chassis intrusion () | Asserted
1a | 02/15/2017 | 11:37:29 | Physical Security #0x73 | General Chassis intrusion () | Deasserted
1b | 02/16/2017 | 01:41:13 | Drive Slot #0xa1 | Drive Present () | Deasserted
1c | 02/16/2017 | 01:41:14 | Drive Slot #0xa3 | Drive Present () | Deasserted
1d | 02/16/2017 | 01:41:15 | Drive Slot #0xa2 | Drive Present () | Deasserted
1e | 02/16/2017 | 04:23:43 | Drive Slot #0xa1 | Drive Present () | Asserted
1f | 02/16/2017 | 04:23:43 | Drive Slot #0xa3 | Drive Present () | Asserted
20 | 02/16/2017 | 04:23:45 | Drive Slot #0xa0 | Drive Present () | Deasserted
21 | 02/16/2017 | 04:23:45 | Drive Slot #0xa2 | Drive Present () | Asserted
22 | 02/16/2017 | 04:25:49 | Drive Slot #0xa0 | Drive Present () | Asserted
23 | 07/10/2017 | 07:27:14 | Temperature #0x04 | Upper Non-critical going high | Asserted
24 | 07/10/2017 | 10:00:12 | Temperature #0x04 | Upper Non-critical going high | Deasserted
25 | 07/10/2017 | 10:01:37 | Temperature #0x04 | Upper Non-critical going high | Asserted
26 | 07/10/2017 | 10:26:07 | Temperature #0x04 | Upper Non-critical going high | Deasserted
27 | 11/09/2017 | 06:09:42 | Physical Security #0x73 | General Chassis intrusion () | Asserted
28 | 11/09/2017 | 06:12:32 | Physical Security #0x73 | General Chassis intrusion () | Deasserted
[root@Resource ~]# ll
total 64-rw-r--r--. 1 root root 3220 Nov 17 14:32 SN12345.txt

View saved file information

 

[root@Resource ~]# cat SN12345.txt 
0x04 0x10 0x72 0x6f 0x02 0xff 0xff # Event Logging Disabled #0x72 Log area reset/cleared
0x04 0x1f 0x00 0x6f 0x01 0xff 0xff # OS Boot #0x00 C: boot completed
0x37 0x00 0x00 0x1e 0x39 0x58 0x00 # Reserved #0x00 Unknown
0x04 0x05 0x73 0x6f 0x80 0x02 0xff # Physical Security #0x73 General Chassis intrusion ()
0x04 0x05 0x73 0xef 0x80 0x02 0xff # Physical Security #0x73 General Chassis intrusion ()
0x04 0x08 0x74 0x0b 0x01 0xff 0xff # Power Supply #0x74 Redundancy Lost
0x04 0x05 0x73 0x6f 0x80 0x02 0xff # Physical Security #0x73 General Chassis intrusion ()
0x04 0x05 0x73 0x6f 0x80 0x02 0xff # Physical Security #0x73 General Chassis intrusion ()
0x04 0x05 0x73 0x6f 0x80 0x02 0xff # Physical Security #0x73 General Chassis intrusion ()
0x04 0xc1 0x2e 0x72 0xa2 0x04 0x00 # Unknown #0x2e Unknown
0x04 0x0c 0x02 0x6f 0xa1 0xc1 0x40 # Memory #0x02 Uncorrectable ECC (UnCorrectable ECC | DIMMB3)
0x04 0xc1 0x2e 0x72 0xa2 0x04 0x00 # Unknown #0x2e Unknown
0x04 0x0c 0x02 0x6f 0xa1 0xc1 0x40 # Memory #0x02 Uncorrectable ECC (UnCorrectable ECC | DIMMB3)
0x04 0x05 0x73 0x6f 0x80 0x02 0xff # Physical Security #0x73 General Chassis intrusion ()
0x04 0xc1 0x2e 0x72 0xa2 0x04 0x00 # Unknown #0x2e Unknown
0x04 0x0c 0x02 0x6f 0xa1 0xc1 0x40 # Memory #0x02 Uncorrectable ECC (UnCorrectable ECC | DIMMB3)
0x04 0xc1 0x2e 0x72 0xa2 0x04 0x00 # Unknown #0x2e Unknown
0x04 0x0c 0x02 0x6f 0xa1 0xc1 0x40 # Memory #0x02 Uncorrectable ECC (UnCorrectable ECC | DIMMB3)
0x04 0x05 0x73 0x6f 0x80 0x02 0xff # Physical Security #0x73 General Chassis intrusion ()
0x04 0xc1 0x2e 0x72 0xa2 0x04 0x00 # Unknown #0x2e Unknown
0x04 0x0c 0x02 0x6f 0xa1 0xc1 0x40 # Memory #0x02 Uncorrectable ECC (UnCorrectable ECC | DIMMB3)
0x04 0xc1 0x2e 0x72 0xa2 0x04 0x00 # Unknown #0x2e Unknown
0x04 0x0c 0x02 0x6f 0xa1 0xc1 0x40 # Memory #0x02 Uncorrectable ECC (UnCorrectable ECC | DIMMB3)
0x04 0x05 0x73 0x6f 0x80 0x02 0xff # Physical Security #0x73 General Chassis intrusion ()
0x04 0x05 0x73 0x6f 0x80 0x02 0xff # Physical Security #0x73 General Chassis intrusion ()
0x04 0x05 0x73 0xef 0x80 0x02 0xff # Physical Security #0x73 General Chassis intrusion ()
0x04 0x0d 0xa1 0xef 0xa0 0x01 0x01 # Drive Slot #0xa1 Drive Present ()
0x04 0x0d 0xa3 0xef 0xa0 0x01 0x03 # Drive Slot #0xa3 Drive Present ()
0x04 0x0d 0xa2 0xef 0xa0 0x01 0x02 # Drive Slot #0xa2 Drive Present ()
0x04 0x0d 0xa1 0x6f 0xa0 0x01 0x01 # Drive Slot #0xa1 Drive Present ()
0x04 0x0d 0xa3 0x6f 0xa0 0x01 0x03 # Drive Slot #0xa3 Drive Present ()
0x04 0x0d 0xa0 0xef 0xa0 0x01 0x00 # Drive Slot #0xa0 Drive Present ()
0x04 0x0d 0xa2 0x6f 0xa0 0x01 0x02 # Drive Slot #0xa2 Drive Present ()
0x04 0x0d 0xa0 0x6f 0xa0 0x01 0x00 # Drive Slot #0xa0 Drive Present ()
0x04 0x01 0x04 0x01 0x57 0xaa 0xaa # Temperature #0x04 Upper Non-critical going high
0x04 0x01 0x04 0x81 0x57 0xa7 0xaa # Temperature #0x04 Upper Non-critical going high
0x04 0x01 0x04 0x01 0x57 0xaa 0xaa # Temperature #0x04 Upper Non-critical going high
0x04 0x01 0x04 0x81 0x57 0xa7 0xaa # Temperature #0x04 Upper Non-critical going high
0x04 0x05 0x73 0x6f 0x80 0x02 0xff # Physical Security #0x73 General Chassis intrusion ()
0x04 0x05 0x73 0xef 0x80 0x01 0xff # Physical Security #0x73 General Chassis intrusion ()

According to the error message with ECC in red, the previous code

0x04 0x0c 0x02 0x6f 0xa1 0xc1 0x40 # Memory #0x02 Uncorrectable ECC (UnCorrectable ECC | DIMMB3)

 

Determine the location of the memory according to these hexadecimal codes and replace the memory

This location is subject to the requirements of the technical documents given by the server manufacturer, because the location of each model is different~

npm ERR! missing script: dev [How to Solve]

NPM run dev error: missing script: dev

Today, when you run the Vue project, you are running NPM   Run dev reports an error, as shown in the following figure:

Open the package.js folder and find that the scripts in the folder have dev, as shown in the following figure:

But I can’t find it. Why?Finally, the path is wrong. When Vue init webpack my project, he creates another folder and can’t get dev.js in the corresponding package.js

CD to the corresponding folder and re run NPM run dev

Also, the scripts in package.js do not have dev

Enter Vue init webpack    Download the missing in package.json again:

” dev”: “webpack-dev-server –inline –progress –config build/webpack.dev.conf.js”,
” start”: “npm run dev”,
” build”: “node build/build.js”

Then install the dependency in NPM intall, and finally NPM run dev

It is also applicable to solve the loss of start and build

 

How to Solve Failed to load SELinux policy. Freezing Error (System Restart)

The system cannot start normally due to setting selinux error

reason

I misunderstood the value when it was related to SELinux

The value of the “SELINUX” parameter in the configuration file /etc/selinux/config should be modified,
# SELINUX=enforcing the original configuration
SELINUX=disabled is correct

However, “SELINUXTYPE” was mistakenly regarded as “SELINUX”, and the SELINUXTYPE parameter was set:
#SELINUXTYPE=targeted The original configuration does not need to be modified.
SELINUXTYPE=disabled error

Solution

1. On the boot page when restarting, select the kernel you want to boot and press E to enter the grub edit page

2. Find the linux16 line. If you don’t see the interface, keep pressing the key until you find the value you need. After language, it is LANG=zh_CN.UTF-8, and space plus selinux=0 or enforcing=0  (Note: I am Add selinux=0 to take effect.)

3. Then ctrl+x to start the system

4. Re-modify the SELinux value after entering the system and close it correctly

[Solved] CentOS install docker error: package docker-ce-3:19.03.2-3.el7.x86_64 requires containerd.io >= 1.2.2-3…

Error Message:

package docker-ce-3:19.03.2-3.el7.x86_64 requires containerd.io >= 1.2.2-3, but none of the providers can be installed
– cannot install the best candidate for the job
– package containerd.io-1.2.2-3.3.el7.x86_64 is excluded
– package containerd.io-1.2.2-3.el7.x86_64 is excluded
– package containerd.io-1.2.4-3.1.el7.x86_64 is excluded
– package containerd.io-1.2.5-3.1.el7.x86_64 is excluded
– package containerd.io-1.2.6-3.3.el7.x86_64 is excluded
(try to add ‘–skip-broken’ to skip uninstallable packages or ‘–nobest’ to use not only best candidate packages)

Check that the containerd.io package is installed, but the version is 1.2.0; so the reason for this installation failure is that the containerd.io package version is too low

Solution:

1. Check the Docker version, install the low version, and do not install the new version of Docker (I won’t bother to introduce the installation process of the low version here)

[root@localhost ~]# yum list docker-ce –showduplicates | sort -r //check the corresponding package version

 

[root@localhost ~]# yum -y install  docker-ce-18.06.0.ce-3.el7     //安装低版本的软件包

2.安装新版的containerd.io软件包

containerd.io软件包下载地址:https://download.docker.com/linux/centos/7/x86_64/edge/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm

[root@localhost ~]#wget https://download.docker.com/linux/centos/7/x86_64/edge/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm    //下载相关软件包

[root@localhost ~]# yum -y install containerd.io-1.2.6-3.3.el7.x86_64.rpm    //升级containerd.io软件包

安装完成后重新安装Docker

[root@localhost ~]# yum -y install docker-ce    //安装Docker软件包

安装完成后启动Docker

[root@localhost ~]# systemctl  start docker      //CentOS7启动方法

[root@localhost ~]#server  docker start        //CentOS6启动方法

查看状态后发现已经启动成功

Ubuntu Error: libcublas.so.8.0 [How to Solve]

Error reporting when using Yolo in QT program:

./conjugateGradientPrecond: error while loading shared libraries: libcublas.so.8.0: cannot open shared object file: No such file or directory

solution:
first find libcublas. So. 8.0   Where is this file?It’s on my system ubuntu16.04. Where is the file  /Usr/local/cuda-8.0/lib64 /
then:

sudo gedit  /etc/ld.so.conf.d/cuda.conf

Add directory to document

 /usr/local/cuda-8.0/lib64/   

When finished, then:

sudo ldconfig
``` 
Remember to always use sudo, unless you are under root.

 

Docker-compose up -d nginx Error: Unable to find expected entry… [How to Solve]

When creating an nginx container on AliCloud ECS, the error is reported as above.

The solution:

In your Dockerfile, before running any apt commands, add the following line:

RUN printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list

This enables apt to run from the new sources.

It’s possible the debian:jesse Docker image will be updated to work correctly in the near future, but until then this will allow you to keep working