Tag Archives: Linux Error

[Solved] Linux error E: dpkg is broken, you must manually run ‘sudo dpkg –configure -a’ to resolve this issue

Executes the Linux commandsudo apt install curland reports an error:

E: dpkg is interrupted. You must manually run ‘sudo dpkg — configure – a’ to solve this problem

System version: Ubuntu 20.04 LTS

Solution: three-step command line

sudo rm /var/lib/dpkg/updates/*
sudo apt-get update
sudo apt-get upgrade

[Solved] fatal error: cannot write PCH file: required memory segment unavailable

Error Message:

fatal error: cannot write PCH file: required memory segment unavailable
make[4]: *** [Makefile:1904: arm-eabi/bits/extc++.h.gch/O2g.gch] Error 1
make[4]: Leaving directory ‘/d/gnu/gcc-12.2.0-build/arm-eabi/libstdc+±v3/include’
make[3]: *** [Makefile:576: all-recursive] Error 1
make[3]: Leaving directory ‘/d/gnu/gcc-12.2.0-build/arm-eabi/libstdc+±v3’
make[2]: *** [Makefile:501: all] Error 2
make[2]: Leaving directory ‘/d/gnu/gcc-12.2.0-build/arm-eabi/libstdc+±v3’
make[1]: *** [Makefile:12620: all-target-libstdc+±v3] Error 2

 

 

Solution:

Downgrade your GCC pack, because there are some bugs in your current gcc-12.2.0. you can go to the official website or the following link to download it:

http://ftp.gnu.org/gnu/gcc/

[Solved] Linux Error: Failed to start bean ‘webServerStartStop‘; nested exception is org.springframework.

💛 Environment: windows10, centos7.5.1804

linux_debug:Failed to start bean ‘webServerStartStop’; nested exception is org. springframework. boot.

1. Error information

2022-07-08 18:12:25.088 ERROR 33600 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat server
	at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:181) ~[spring-context-5.3.21.jar!/:5.3.21]
	at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54) ~[spring-context-5.3.21.jar!/:5.3.21]
	at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356) ~[spring-context-5.3.21.jar!/:5.3.21]
	at java.lang.Iterable.forEach(Iterable.java:75) ~[na:1.8.0_333]
	at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:155) ~[spring-context-5.3.21.jar!/:5.3.21]
	at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:123) ~[spring-context-5.3.21.jar!/:5.3.21]

2. Problem description

When running the jar package made by springboot project on Linux;

If the above problem occurs, port 8080 is occupied;

3. Solutions

Close the occupied 8080 port;

3.1 windows

Enter in CMD

# Find the corresponding pid
netstat -ano | findstr 8080

## out:TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 6148

Close the PID number corresponding to the port, assuming that port 8080 corresponds to the process number with process number 123

taskkill /pid 6148 -t -f

3.2 linux

Enter in CMD

# Find the corresponding pid
netstat -ano | grep 8080

## out:TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 6148

Close the PID number corresponding to the port, assuming that port 8080 corresponds to the process number with process number 123

kill -9 PID 123

Linux Error: CMake Error in CMakeLists.txt: No CMAKE_CXX_COMPILER could be found.

– The C compiler identification is GNU 7.5.0
– The CXX compiler identification is unknown
– Check for working C compiler: /usr/bin/cc
– Check for working C compiler: /usr/bin/cc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info – done
– Detecting C compile features
– Detecting C compile features – done
CMake Error in CMakeLists.txt:
No CMAKE_CXX_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable “CXX” or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
– Configuring incomplete, errors occurred!
See also “/home/dragon/Desktop/v1.0.3/onboard-api/build/CMakeFiles/CMakeOutput.log”.
See also “/home/dragon/Desktop/v1.0.3/onboard-api/build/CMakeFiles/CMakeError.log”.

Solution:

sudo apt install -y build-essential

[Solved] Linux Error: mipsel-linux-gcc: fatal error: no input files

Error: “:mipsel-linux-gcc -DON_BGIAD_CLIENT -DINET_6 -I./…/include -I./…/common_modules/target/h -I./…/common_modules/gkgeneral/h -I./…/common_modules/gkconfig -I./…/common_modules -I./…/common_modules/msgexchange -I./…/common_modules/libntp/h -I./…/common_modules/libdhcp/h -I./…/common_modules/libppp/h -I./…/common_modules/libipv6/h -I./…/common_modules/libunixcomm -I./…/common_modules/gkmemoryshare -I./…/common_modules/dllist -I./…/app/uart_func -I./…/common_modules/libmqtt -DMY_DEF -D__DEVICE_IAD__ -D_MG6002W_L_ -DMT7628 -DDTU -g -fPIC -fno-builtin -Wall -c -D_GNU_SOURCE -c -o modbus_top.o
mipsel-linux-gcc: fatal error: no input files

Reason: make dep execution report error
Solution:
Re-make dep to check the error
Found that uart_config.h is missing half of the parentheses

Linux Error: bind error: Address already in use [How to Solve]

About network programming, the server-client bind error: address already in use:

reason:

1. You used the port number, but the process did not exist.

2. At the end of the process:

crtl +c   And crtl + Z are different. The former ends the process and the latter suspends the process

If you use the latter, the process will hang and not be killed

 

Solution:

1. Kill the process

PS – Aue view PID   , Then kill + process PID and kill the process

2. Change the port number

3. Wait half a minute until the port is released

4. External parameter transmission

It is more convenient to directly change the new port number than 2

5. Use the setsockopt() function to cancel the port number binding restriction

int on=1;
setsockopt(fd,SOL_ SOCKET,SO_ REUSEADDR,& on,sizeof(on));

[Solved] Linux error: SSH_exchange_identification: read: Connection reset by peer

Linux error SSH_exchange_identification: read: Connection reset by peer

Problem Description:

ssh_ exchange_ identification: read: Connection reset by peer

 

Cause of the problem:

check whether SSH connection restriction is enabled
VIM/etc/hosts. Allow
VIM/etc/hosts. Deny

 

resolvent:

if SSH connection restriction is enabled, add the IP of the source address to hosts.allow
effective in real time, no need to restart the service

Error: XZ compression not available

 In the test server for docker learning, some centos7 software installation and their own server is not compatible so lead to yun download software when the error: Error: xz compression not available

For the error solution.
rm -fr /var/cache/yum/x86_64/6/epel/
rm -rf /etc/yum.repos.d/epel*


Reinstall epel and base

wget -O/etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repohttp://mirrors.aliyun.com/repo/epel-7.repo
yum repolist