Tag Archives: linux

Debian9 g++ Compile Error: error: ‘EDOM’ was not declared in this scope

In file included from /usr/include/c++/6/bits/basic_string.h:5417:0,
                 from /usr/include/c++/6/string:52,
                 from ../../../linux/../Include/I2Str.h:3,
                 from ../../../linux/../Include/trk_CfgMgr.h:11,
                 from ../../../linux/../Include/trk_svc_policy.h:10,
                 from trk_svc_tk_policy_sync.cpp:9:
/usr/include/c++/6/ext/string_conversions.h: In function ‘_Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, std::size_t*, _Base ...)’:
/usr/include/c++/6/ext/string_conversions.h:72:25: error: ‘ERANGE’ was not declared in this scope
       else if (errno == ERANGE
                         ^~~~~~
In file included from /usr/include/c++/6/system_error:39:0,
                 from /usr/include/c++/6/bits/ios_base.h:46,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from ../../../linux/../Include/I2Str.h:4,
                 from ../../../linux/../Include/trk_CfgMgr.h:11,
                 from ../../../linux/../Include/trk_svc_policy.h:10,
                 from trk_svc_tk_policy_sync.cpp:9:
/usr/include/x86_64-linux-gnu/c++/6/bits/error_constants.h: At global scope:
/usr/include/x86_64-linux-gnu/c++/6/bits/error_constants.h:47:35: error: ‘EDOM’ was not declared in this scope
       argument_out_of_domain =    EDOM,
                                   ^~~~
/usr/include/x86_64-linux-gnu/c++/6/bits/error_constants.h:75:34: error: ‘EILSEQ’ was not declared in this scope
       illegal_byte_sequence =    EILSEQ,
                                  ^~~~~~
/usr/include/x86_64-linux-gnu/c++/6/bits/error_constants.h:148:32: error: ‘ERANGE’ was not declared in this scope
       result_out_of_range =    ERANGE,

 

Solution:
Add #include <errno.h>

[Solved] Linux wget Error: ERROR: cannot verify Issued certificate has expire

Linux wget download Tomact error.

The following error appears:

wget https://dlcdn.apache.org/tomcat/tomcat-8/v8.5.78/bin/apache-tomcat-8.5.78.tar.gz --2022-04-06 21:54:57-- https://dlcdn.apache.org/tomcat/tomcat-8/v8.5.78/bin/apache-tomcat-8.5.78.tar.gz Resolving dlcdn.apache.org (dlcdn.apache.org)… 191.101.2.132, 2a04:4e42::644 Connecting to dlcdn.apache.org (dlcdn.apache.org)|191.101.2.132|:443… connected. ERROR: cannot verify dlcdn.apache.org’s certificate, issued by ‘/C=US/O=Let’s Encrypt/CN=R3’: Issued certificate has expired. To connect to dlcdn.apache.org insecurely, use `–no-check-certificate’.

 

Solution:

Add parameters in wget: –no-check-certificate

「wget –no-check-certificate https://dlcdn.apache.org/tomcat/tomcat-8/v8.5.78/bin/apache-tomcat-8.5.78.tar.gz」

Done!!!

[Solved]unpacking of archive failed: cpio: lstat failed – Not a directory

A strange CPIO error was reported when installing the RPM package on the company server today. (most errors can be solved by reinstalling CPIO or downloading RPM package again)

unpacking of archive failed: cpio: lstat failed - Not a directory

 

Solution:

After learning CPIO, I found a solution:

Step 1: check the directory required by the RPM package

 rpm2cpio XXXX.rpm | cpio -idmv

Step 2: check the corresponding directory, and you will find that it really exists, and it is not a directory…

Step 3: delete this directory and reinstall successfully!!!!

Reference: https://access.redhat.com/solutions/6189481

[Solved] NVIDIA-SMI has failed because it couldn‘t communicate with the NVIDIA driver

environment

– notebook model: Dell precision 5520
– graphics card model: M1200
– system: Ubuntu 20.04

 

Question

After installing the N card driver, execute NVIDIA SMI , and an error is reported:

NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

 

Solution:

Method 1

Cause: the system kernel is upgraded, resulting in the mismatch between the new version of kernel and the original graphics card driver
solution: use DKMS to generate the corresponding kernel file

View driver version

ls /usr/src | grep nvidia

For example, my result is nvidia-470.103.01

matching

sudo apt-get install dkms
sudo dkms install -m nvidia -v 470.103.01

Method 2

Reason: the same as scheme 1
solution: log in using the kernel. Then set the default to start with the kernel.

Method 3 (work for me)

Reason: the secure boot of the BIOS is in the enable state
Solution: enter the BIOS (generally press F2 when starting up) and turn off secure boot
it is strongly recommended that even if your secure boot is already in disable, it is recommended to execute it once: enable, restart, disable, and then restart. (this is my situation, so confused!!)

[Solved] Centos error: collect2: fatal error: cannot find ‘ld‘

When executing a compiled file in Linux (. /configure) with collect2: fatal error: cannot find ‘ld’, which is also preceded by gcc: error: unrecognized command line option -V and configure: error: C compiler cannot create executables. When you find that your gcc and the corresponding dependency packages are installed, you still get the error. At this point you look under /usr/bin/ to see if there is an ld. which ld is not found, but you find a file called ld.gold under /usr/bin by running ls -l |grep ld.

Solution:

Copy ld.gold under /usr/bin/ (do not delete the original file) and rename it to ld. You can also create a soft connection.

Re-execute the compilation

Problem found solved!

Brief description.

gcc compiles the source code to .o, then linker links the .o to .so or executable, linker can use ld.bfd, ld.gold or lld.

kernel module insert error: ERROR: could not insert module …../file.ko : File exits

When inserting the kernel module, I was prompted that the file already exists, but before that, when I inserted the kernel module, I was prompted that I could not insert normally. In order to avoid problems with the module, I decided to delete the original module and insert it again. Here is a method for you.

Check the current modules

lsmod

You can see that there are running modules in it. If you find the module you want to insert, delete it

sudo rmmod openvswitch

Then re insert it

sudo insmod datapath/linux/openvswitch.ko

Then you can insert the module normally.

./configure Command Execute error (Centos7 Install erlang)

Windows uploads Erlang installation package to virtual machine

Install the file upload program:

# yum install -y lrzsz

Upload file:

# rz

Unzip package:

# tar -zxvf otp_src_24.3.2.tar.gz

Enter the decompression Directory:

# cd /-My_PATH-/otp_src_24.3.2/

Execute “./configure –prefix=/usr/local/erlang” command error:

[root@localhost otp_src_24.3.2]# ./configure --prefix=/usr/local/erlang
=== Running configure in /usr/local/software/otp_src_24.3.2/erts ===
./configure '--prefix=/usr/local/erlang' --disable-option-checking --cache-file=/dev/null --srcdir="/usr/local/software/otp_src_24.3.2/erts"
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/usr/local/software/otp_src_24.3.2/erts':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
ERROR: /usr/local/software/otp_src_24.3.2/erts/configure failed!
Killed

Solution:

Install C + + compilation environment: sudo yum install gcc-c++

[root@localhost otp_src_24.3.2]# sudo yum install gcc-c++
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.sjtu.edu.cn
 * extras: mirrors.nju.edu.cn
 * updates: mirrors.nju.edu.cn
Resolving Dependencies

--------------------------省略!!------------------------

Installed:
  gcc-c++.x86_64 0:4.8.5-44.el7                                                                            

Dependency Installed:
  cpp.x86_64 0:4.8.5-44.el7                               gcc.x86_64 0:4.8.5-44.el7                       
  glibc-devel.x86_64 0:2.17-325.el7_9                     glibc-headers.x86_64 0:2.17-325.el7_9           
  kernel-headers.x86_64 0:3.10.0-1160.59.1.el7            libmpc.x86_64 0:1.0.1-3.el7                     
  libstdc++-devel.x86_64 0:4.8.5-44.el7                   mpfr.x86_64 0:3.1.1-4.el7                       

Dependency Updated:
  glibc.x86_64 0:2.17-325.el7_9                    glibc-common.x86_64 0:2.17-325.el7_9                   

Complete!

After installation, re-execute . /configure command again and found a new problem.

configure: error: Perl version 5 is required to build the emulator!
ERROR: /usr/local/otp_src_24.3.2/erts/configure failed!
Killed

Then we install another one

# yum install perl

Then there are new problems:

configure: error: No curses library functions found
ERROR: /usr/local/otp_src_24.3.2/erts/configure failed!
Killed

At this time, you need to install the log Library:

# yum -y install ncurses-devel

Then re-execute ./configure command, no exception~

Set environment variables:

# vi /etc/profile

Press Enter to go to the bottom, then press keyboard i to enter edit mode and configure the environment variables.

#set erlang environment
export PATH=$PATH:/usr/local/erlang/bin

After the configuration is completed, press ESC to exit the editing mode and enter the Save command:

:wq

Refresh the profile to take effect:

# source /etc/profile

Check whether Erlang is successfully installed:

[root@localhost otp_src_24.3.2]# erl -version
Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 12.3

Done!

How to Solve Hbase JAVA import Package Error

Elsipe connects to Hbase
When programming with the hbase API, importing many packages may cause errors
Since it is too tedious to add dependencies manually, we finally chose to create a new maven project, which makes it possible to add the dependencies we need automatically.

Create a new maven project
I’m using the latest version of eclipse 2021-12, so I skipped this step.

Create a new project





Modify pom.xml
In the new maven project, find the pom.xml and modify it

Add the following, and make sure that the version is consistent with your own hbase version.
Check your own hbase version with “hbase version” command

<dependency>
    	<groupId>org.apache.hbase</groupId>
    	<artifactId>hbase-client</artifactId>
    	<version>2.4.10</version>
</dependency>

Wait for automatic compilation to complete

The imported packages will not report errors

[Solved] zookeeper Startup Error: already running as process

1. Problem description

Zookeeper has been able to start normally before, but an error is reported in a startup. Already running as process

2. Problem description

Enter the command JPS to check whether it is really started. It is found that it is not started (the process name of zookeeper is QuorumPeerMain)

This is usually caused by the machine abnormally closing the residual PID file in the cache directory (forced shutdown for the closing process, etc.)
just clean up the cache directory

3. Problem handling

Enter the file directory (this directory is the dataDir directory when setting zoo.cfg(cd /export/server/zookeeper-3.4.9/conf)):

(base) [ root@node2 zkdatas]# cd /export/server/apache-zookeeper-3.5.6-bin/zkdatas

(base) [ root@node2 zkdatas]# ll

Clean up cache files

(base) [root@node2 zkdatas]# rm -rf zookeeper_server.pid

Restart andyou can start normally

(base) [root@node2 apache-zookeeper-3.5.6-bin]# bin/zkServer.sh start

Linux Error: error:Failed dependencies [How to Solve]

1. problem description

When I tried to install the RPM package of vscode in Ubuntu, the following error occurred:

[root@localhost src]# rpm -ivh code-insider-1.66.0-1647322605.el7.x86_64.rpm
error: Failed dependencies:
	code-insider conflicts with (installed) code-insider-1.66.0-1647322605.el7.x86_64

 

2. solution

Add two parameters –nodeps --force or –force --nodeps after the installation package, and ignore the error message for installation. For example:

– force means mandatory installation
– nodeps means that dependencies are not checked during installation

Enter the following code:

rpm -ivh –nodeps --force code-insider-1.66.0-1647322605.el7.x86_64.rpm

Problem-solving.

yum: Error: Failed to download metadata for repo ‘aliyun-AppStream‘: Cannot download repomd.xml

preface

centos8 stopped the service of source on December 31, 2021

The current system is CentOS

[root@localhost ~]# cat /etc/centos-release
CentOS Linux release 8.5.2111
[root@localhost ~]# 

Yum error message

[root@localhost ~]# yum install ipmitool
CentOS-8 - AppStream                                                                                                                                                                   439  B/s | 2.3 kB     00:05    
Errors during downloading metadata for repository 'aliyun-AppStream':
  - Status code: 404 for https://mirrors.aliyun.com/centos-Vault/8.5.2111/BaseOS/x86_64/os/repodata/repomd.xml (IP: 182.105.147.113)
Error: Failed to download metadata for repo 'aliyun-AppStream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
[root@localhost ~]# 

Solution

1. Execute the following commands

[root@localhost ~]#cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# ls -lh        
total 24K
-rwxr-xr-x. 1 root root  288 Mar 22 20:07 CentOS-AppStream.repo
-rwxr-xr-x. 1 root root  276 Mar 22 20:07 CentOS-BaseOS.repo
-rwxr-xr-x. 1 root root 3.0K Mar 22 20:07 CentOS-Base.repo
-rwxr-xr-x. 1 root root  279 Mar 22 20:07 CentOS-Extras.repo
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
[root@localhost yum.repos.d]# sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# yum update -y
Repository base is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository AppStream is listed more than once in the configuration
CentOS-8 - AppStream                                                                                                                                                             437  B/s | 2.3 kB     00:05    
Errors during downloading metadata for repository 'aliyun-AppStream':
  - Status code: 404 for https://mirrors.aliyun.com/centos-Vault/8.5.2111/BaseOS/x86_64/os/repodata/repomd.xml (IP: 124.225.134.244)
Error: Failed to download metadata for repo 'aliyun-AppStream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

2. If the problem is not solved, do the following:

[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
--2022-03-22 20:08:42--  https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 124.225.134.241, 124.225.134.239, 124.225.134.243, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|124.225.134.241|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2495 (2.4K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’

/etc/yum.repos.d/CentOS-Base.repo                    100%[===================================================================================================================>]   2.44K  --.-KB/s    in 0s      

2022-03-22 20:08:47 (49.0 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [2495/2495]

[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# yum clean all
Repository base is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository AppStream is listed more than once in the configuration
18 files removed
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# yum makecache
Repository base is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository AppStream is listed more than once in the configuration
CentOS-8 - AppStream                                                                                                                                                             428  B/s | 2.3 kB     00:05    
Errors during downloading metadata for repository 'aliyun-AppStream':
  - Status code: 404 for https://mirrors.aliyun.com/centos-Vault/8.5.2111/BaseOS/x86_64/os/repodata/repomd.xml (IP: 119.41.210.242)
Error: Failed to download metadata for repo 'aliyun-AppStream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
[root@localhost yum.repos.d]# 

3. Then perform the following operations

[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# ls -lh        
total 24K
-rwxr-xr-x. 1 root root  288 Mar 22 20:07 CentOS-AppStream.repo
-rwxr-xr-x. 1 root root  276 Mar 22 20:07 CentOS-BaseOS.repo
-rwxr-xr-x. 1 root root 3.0K Mar 22 20:07 CentOS-Base.repo
-rwxr-xr-x. 1 root root  279 Mar 22 20:07 CentOS-Extras.repo
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# mkdir bak
[root@localhost yum.repos.d]# mv  *.repo  bak
[root@localhost yum.repos.d]# ls
bak
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
--2022-03-22 20:10:10--  https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 124.225.134.239, 124.225.134.241, 124.225.134.243, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|124.225.134.239|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2495 (2.4K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’

/etc/yum.repos.d/CentOS-Base.repo   100%[==================================================================>]   2.44K  --.-KB/s    in 0s      

2022-03-22 20:10:15 (98.3 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [2495/2495]

[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# yum clean all
0 files removed
[root@localhost yum.repos.d]# yum makecache
CentOS-8.5.2111 - Base - mirrors.aliyun.com                                                                                     454 kB/s | 4.6 MB     00:10    
CentOS-8.5.2111 - Extras - mirrors.aliyun.com                                                                                                                                    1.0 kB/s |  10 kB     00:10    
CentOS-8.5.2111 - AppStream - mirrors.aliyun.com                                                                                                                                 571 kB/s | 8.4 MB     00:15    
Metadata cache created.
[root@localhost yum.repos.d]# ls 
bak  CentOS-Base.repo
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# yum install ipmitool
Last metadata expiration check: 0:00:27 ago on Tue 22 Mar 2022 08:10:54 PM CST.
Dependencies resolved.
=================================================================================================================================================================================================================
 Package                                          Architecture                                   Version                                                 Repository                                         Size
=================================================================================================================================================================================================================
Installing:
 ipmitool                                         x86_64                                         1.8.18-18.el8                                           AppStream                                         395 k

Transaction Summary
=================================================================================================================================================================================================================
Install  1 Package

Total download size: 395 k
Installed size: 1.1 M
Is this ok [y/N]: y
Downloading Packages:
ipmitool-1.8.18-18.el8.x86_64.rpm                                                                                                                                                 71 kB/s | 395 kB     00:05    
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                             71 kB/s | 395 kB     00:05     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                         1/1 
  Installing       : ipmitool-1.8.18-18.el8.x86_64                                                                                                                                                           1/1 
  Running scriptlet: ipmitool-1.8.18-18.el8.x86_64                                                                                                                                                           1/1 
  Verifying        : ipmitool-1.8.18-18.el8.x86_64                                                                                                                                                           1/1 

Installed:
  ipmitool-1.8.18-18.el8.x86_64                                                                                                                                                                                  

Complete!
[root@localhost yum.repos.d]#

At this point, you can use the yum install command.