Category Archives: Linux

[Solved] Xshelln Connect to Local VM linux Error: Could not connect to ‘XXX.168.122.1‘ (port 22): Connection failed

The error is shown in the following picture:

Solution:

Method 1:

Restart VMware, xsehell!

The second method:

1. Start SSH

service sshd start

2. Set SSH to start automatically

chkconfigsshd on

Note: if there is no SSH, install SSH first, and then perform the previous steps 1 and 2

yum install openssh-server

Finally, we go to xshell to test the connection

[Solved] Virtual Machine Error: FAILURE: Build failed with an exception.Flutter

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
   > Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven(http://storage.flutter-io.cn/download.flutter.io)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See https://docs.gradle.org/7.4/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details. 

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 50s
Exception: Gradle task assembleDebug failed with exit code 1

 

Solution:

Although there are many tutorials online, but there is no solution to this solution, the early my attention are in the first sentence, only to know that the original focus is the latter sentence, the main error is in the http and https protocol, Just modify HTTP to HTTPS of the system variable FLUTTER_STORAGE_BASE_URL variable value.

[Solved] ERROR: Linux route delete command failed: external program exited with error status: 2

Problem description

A set of environment of the company is accessed through VPN, which uses OpenVPN. At some time in the afternoon, some students reported that VPN login failed. Try it yourself, too. Log in to the server to view the VPN log information as follows

ERROR: Linux route delete command failed: external program exited with error status: 2

Solution: Remove the limit in the service startup file, and comment out the line LimitNPROC

vim /usr/lib/systemd/system/[email protected]

#LimitNPROC

Restart service

systemctl daemon-reload
systemctl restart [email protected]

 

nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)

nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied) This is because port 80 can only be started by the root user, so just let the non-root user use port 80.

The solution is as follows:

# Set CAP_NET_BIND_SERVICE capability for the specified program
$ setcap cap_net_bind_service=+eip /path/to/application
The tests are as follows:
# sudo setcap cap_net_bind_service=+eip /usr/local/nginx/sbin/nginx

It’s OK to start nginx again.

/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf

[Solved] Emacs27.1 cscope Error: process-kill-without-query

1. Background:

Using emacs27.1 and cscope on XUbuntu22.04, I get an error when looking for a function.

process-kill-without-query
process-kill-without-query is a compiled Lisp function in `subr.el'.

(process-kill-without-query PROCESS &optional FLAG)

This function is obsolete since 22.1;
use `process-query-on-exit-flag' or `set-process-query-on-exit-flag'.

Say no query needed if PROCESS is running when Emacs is exited.
Optional second argument if non-nil says to require a query.
Value is t if a query was formerly required. 

2. Solutions

Solution idea.
Replace all containing (process-kill-without-query xxx) with
as follows.

(process-query-on-exit-flag xxx)
or
(set-process-query-on-exit-flag xxx nil)

1. Replace all the files containing process-kill-without-query in /usr/share/dictionaries-common/site-elisp directory
debian-ispell.el flyspell.el ispell.el

2. replace all process-kill-without-query under ~/.emacs.d

3. delete all .elc files with process-kill-without-query

 

Linux Mint: linuxbrew Install and Boot Error [How to Solve]

Linux Mint installs linuxbrew and resolves the boot error

Errors are reported as follows

 

Solution:
Checking the **.profile file** in the user directory, I found that eval was linked to the previous line, presumably because of a bug in the installation of the jetbrains toolbox

change Eval to the next line and save it (with administrator permission)

[Solved] CUDA initialization: Unexpected error from cudaGetDeviceCount()

I recently used the rented server, and suddenly the torch cannot be used normally, and it prompts CUDA initialization: Unexpected error from cudaGetDeviceCount() error, as shown in the following figure

 

After several setbacks, the cause of the problem was found to be:

Because the nvidia-fabricmanager package has been updated for some reason, such as being updated during automatic system update or apt-get update, apt-get upgrade, etc. And this package must be consistent with the driver version before it can be used normally, because A100-80G is the nvswitch version, and this package can be installed to support nviswitch before it can be used normally.

My default nvidia-fabricmanager version is 510.47.03 and the driver version 510.47.03. As a result, the package version has been updated, resulting in a mismatch, so it cannot be used normally.

 

Solution:

Reinstall the corresponding compatible version of this package nvidia-fabricmanager (for example, I need to install version 510.47.03 here), and then disable automatic updates. In addition, to ensure that this service runs normally nvidia-fabricmanager, you can set it to start automatically at boot.

The installation and setup operations are as follows:

wget https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/x86_64/nvidia-fabricmanager-510_510.47.03-1_amd64.deb
apt-get remove nvidia-fabricmanager-510
apt-get install ./nvidia-fabricmanager-510_510.47.03-1_amd64.deb
systemctl enable nvidia-fabricmanager
systemctl restart nvidia-fabricmanager
systemctl status nvidia-fabricmanager

 

The result is as follows:  

 

Lessons learned : When using the A100-80G server, it is not necessary to use apt-get updates or turn on Ubuntu system updates.

[Solved] make menuconfig Error: recipe for target ‘menuconfig‘ failed

when using make menuconfig to configure Linux corl error: target ‘menuconfig’ failed to recipe.


Solution:

1. Check whether the libncurses5-dev library is installed

If it’s not installed, install with the command: sudo apt-get install libncurses5-dev

2. If it’s installed, it’s because the terminal window is too small. It’s solved by enlarging the window

 

[Solved] E xx: xxxx:xx ERR thread 0x536753929472 setscheduler failed Operation not permitted

E xx: xxxx:xx ERR thread 0x536753929472 setscheduler failed Operation not permitted

The “setscheduler failed Operation not permitted” error occurred when setting the thread priority via sched_setscheduler.

int ret = sched_setscheduler(pthread_gettid_np((pthread_t)pHandle), SCHED_RR, &prio);

 

Solution:
add the following contents to the process startup parameters:

capabilities SYS_NICE

init.target.rc

service xxxxxx /system/vendor/bin/xxxxxx
    class core
    user system
    group camera input graphics
    disabled
    onrestart restart evs_driver
    onrestart restart qcarcam_hal
    capabilities SYS_NICE

[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