Tag Archives: linux

Failed to find Qt component “Widgets“ [How to Solve]

In the project, QT6 is used 2.1 after installing QT, this error is reported when QtCreator is used:

but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
  FOUND.  Reason given by package:

  Failed to find Qt component "Widgets" config file at ""

The reason is that although QT has been installed, some other libraries QT depends on have not been installed:

I use Ubuntu system: use the following command to install (OpenGL installation)

sudo apt-get install build-essential libgl1-mesa-dev

[Solved] Docker Staratup Error: Failed to start Docker Application Container Engineadsafdsad.

I’ve been learning k8s recently. The docker container needs to be installed in it. It can’t be started after installation. Record the solution

Because the docker here is in the form of compressed package, and it is not installed by yum. The solution is not necessarily universal

When I execute: systemctl restart docker, it will report an error

Then I followed the prompt that he reported an error: journalctl – Xe

He didn’t find the executable file in usr/bin. In the docker folder I unzipped, I directly moved the docker folder to /usr/bin/ directory. As a result,

Solution: remove the folder in the outer layer of docker and copy the executable file directly to the /usr/bin directory.

SSH Connect Service Error: Could not connect to ‘xxx.xxx.xx.xx‘ (port 22): Connection failed.

It was strange to report an error when connecting to SSH service this morning

I have searched a lot of information from Baidu. Now I collect and sort out some useful solutions for you

1. Restart CentOS
2 Restart VMware
3 Firewall problem:
solution:
(1) check the firewall: Service iptables status
(2) close the firewall first: /etc/init.d/iptables stop
(3) open firewall: Service iptables start
Start: systemctl start firewalld (centos7 user)
Close: systemctl stop firewalld (centos7 user)
4 Query whether port 22 is enabled

Query all open port commands

  firewall-cmd --zone=public --list-ports

Permanently open port 22

  firewall-cmd --zone=public --add-port=80/tcp --permanent 

Reload

firewall-cmd --reload

5. Query whether SSH is installed on the Linux server

yum install openssh-server

6. Query whether SELinux is started
modify the file in /etc/selinux/config and set SELINUX = disabled:

Failed to Connect NVIDIA Driver: NVIDIA-SMI has failed because it couldn‘t communicate with the NVIDIA driver

nvidia-smi
error
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver

Reason: the Ubuntu kernel has been updated, which is inconsistent with the kernel when the graphics card driver was installed

Solution 1
reduce the system kernel, select low kernel in the boot preference, or change the configuration file to automatically select low version kernel by default boot. Refer to the link for the method

Solution 2
update the graphics card driver

view the installed driver version

ls /usr/src

Display my graphics driver for nvidis-470 reinstall updated graphics driver

sudo apt install --reinstall nvidia-driver-470

After the update is successful, restart the computer

nvidia-smi

It can be displayed normally

Thu Mar 24 10:18:37 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.103.01   Driver Version: 470.103.01   CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   37C    P0    N/A/ N/A |    439MiB/ 4046MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      3149      G   /usr/lib/xorg/Xorg                193MiB |
|    0   N/A  N/A      3314      G   /usr/bin/gnome-shell               70MiB |
|    0   N/A  N/A      4010      G   /usr/lib/firefox/firefox          171MiB |
+-----------------------------------------------------------------------------+

buildroot SIGSTKSZ Error: make[5]: *** [Makefile:1915: c-stack.o] Error 1

Project scenario:

Error when compiling builderoot:

Problem description:

Error when compiling builderoot:

PATH="/home/dlxy/sambashare/LicheepiNano/buildroot-2018.02.5/output/host/bin:/home/dlxy/sambashare/LicheepiNano/buildroot-2018.02.5/output/host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi/bin" PKG_CONFIG="/home/dlxy/sambashare/LicheepiNano/buildroot-2018.02.5/output/host/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_LIBDIR="/home/dlxy/sambashare/LicheepiNano/buildroot-2018.02.5/output/host/lib/pkgconfig:/home/dlxy/sambashare/LicheepiNano/buildroot-2018.02.5/output/host/share/pkgconfig"  /usr/bin/make -j2  -C /home/dlxy/sambashare/LicheepiNano/buildroot-2018.02.5/output/build/host-m4-1.4.18/

/usr/bin/make  all-recursive

Making all in .

make[4]: Nothing to be done for 'all-am'.

Making all in examples

make[4]: Nothing to be done for 'all'.

Making all in lib

/usr/bin/make  all-am

  CC       c-stack.o

  CC       clean-temp.o

In file included from /usr/include/signal.h:328,

                 from ./signal.h:52,

                 from c-stack.c:49:

c-stack.c:55:26: error: missing binary operator before token "("

   55 | #elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384

      |                          ^~~~~~~~

make[5]: *** [Makefile:1915: c-stack.o] Error 1





Solution:

Locate c-stack.c file in the builderoot folder
line 55:

comment out the following contents, and the results are as follows:

stream copy error: reading from a closed fifo [How to Solve]

The docker service on the Linux server cannot be started after running for a period of time

Record a docker service problem encountered at the customer’s site

Problem description

After running the docker service for a period of time, some services are killed and cannot be restarted successfully through docker compose. Check the docker service log and report an error stream copy error: reading from a closed FIFO

Troubleshooting process:

1. The initial positioning is that there is not enough memory. Check with Free -g and find that the content is enough

2 After searching the Internet, some bloggers said that restarting docker could solve the problem. After restarting docker, they found that the error changed, and the service that didn’t get up before still couldn’t get up. The error became failed to allocate network resources for node *****
3 The network of docker service is the default. Regardless of the problem of docker network, changing the stack name and restarting still won’t work
4 Docker service PS ID/docker service logs ID check the service log that failed to start. It is found that the error log is still stream copy error: reading from a closed FIFO
5 Finally, before restarting the server, check the disk with the df -h command and find that the/dev/mapper/centosroot disk is full

Solution:

Go to cd /var/log to delete some useless log files, if the current log files are small, you can use du -sh in the root directory to view those folders occupy a lot of space, generally the /var folder and /root folder will occupy the root disk, you need to delete the contents of these two folders

[rospack] Error: no such package beginner_tutorials

[rospack] Error: no such package beginner_tutorials
I found this error during the process, and after pouring in the path, I couldn’t solve it, so I checked the workspace and found the beginner_tutorials file, so the problem is in the execution

catkin_create_pkg beginner_tutorials std_msgs rospy roscpp

The CD is not inside the src.
So if you find this problem, you can check the location of beginner_tutorials.
Solution: Just delete the beginner_tutorials and re-execute it.

ERROR conda.core.link:_execute(699): An error occurred while installing package ‘‘Rolling back trans

Problem description

CONDA install the package error: ERROR conda.core.link:_execute(699): An error occurred while installing package ‘conda-forge::cudatoolkit-11.1.1-h6406543_8’. Rolling back transaction: done [Errno 12] Cannot allocate memory ()
similar errors will also be encountered during PIP installation: SystemError: deallocated bytearray object has exported buffers

 

Solution:

Clean up CONDA cache

conda clean -a

insmod Error: Invalid module format [How to Solve]

Compiling kernel modules

$ make M=/home/liyongjun/project/c/linux-4.4.1/net/mac80211/ modules

Installation error

$ sudo insmod net/mac80211/mac80211.ko 
insmod: ERROR: could not insert module net/mac80211/mac80211.ko: Invalid module format

dmesg

$ dmesg
...
[ 3187.509374] mac80211: no symbol version for module_layout

Solution:

Add the -C /lib/modules/`uname -r`/build option

$ make -C /lib/modules/`uname -r`/build M=/home/liyongjun/project/c/linux-4.4.1/net/mac80211/ modules

[Solved] Yum Install Software Error: Invalid configuration value: failovermethod=priority…

Error 1:

Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Linux-BaseOS.repo; Configuration: OptionBinding with id "failovermethod" does not exist
CentOS Linux 8 - AppStream                                                 6.3 kB/s | 2.3 kB     00:00    
Errors during downloading metadata for repository 'appstream':
  - Status code: 404 for http://mirrors.cloud.aliyuncs.com/centos/8/AppStream/x86_64/os/repodata/repomd.xml (IP: 100.100.2.148)
Error: Failed to download metadata for repo 'appstream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

The current environment is:

[root@iZ2vc5xk901ftf2vfscwc1Z yum.repos.d]# uname -srm
Linux 4.18.0-348.2.1.el8_5.x86_64 x86_64

CentOS version:

[root@iZ2vc5xk901ftf2vfscwc1Z yum.repos.d]# cat /etc/redhat-release
CentOS Linux release 8.5.2111

Solution:

1. Find CentOS related directory, backup CentOS-AppStream, CentOS-Base files, generally CentOS directory is under /etc/yum.repos.d folder, as follows:

Backup:

cp CentOS-Linux-AppStream.repo CentOS-Linux-AppStream.repo1
cp CentOS-Linux-BaseOS.repo CentOS-Linux-BaseOS.repo1

2. Edit the files CentOS-Linux-AppStream.repo,CentOS-Linux-BaseOS.repo for string replacement:

vi CentOS-Linux-BaseOS.repo
# esc 键盘 : 命令模式下执行:
%s/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g 
# 继续执行:
%s/$releasever/$releasever-stream/g

vi CentOS-Linux-AppStream.repo
# esc 键盘 : 命令模式下执行:
%s/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g 
# 继续执行:
%s/$releasever/$releasever-stream/g

3. Execute the order:

yum makecache
yum update

Command execution effect:

[root@iZ2vc5xk901ftf2vfscwc1Z yum.repos.d]# yum update
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Linux-epel.repo; Configuration: OptionBinding with id "failovermethod" does not exist
Last metadata expiration check: 0:01:22 ago on Wed 09 Mar 2022 10:20:01 AM CST.
Error: 
 Problem: package centos-stream-release-8.6-1.el8.noarch requires centos-stream-repos, but none of the providers can be installed
  - package centos-linux-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-stream-repos-8-2.el8.noarch
  - package centos-stream-repos-8-2.el8.noarch conflicts with centos-repos(8) provided by centos-linux-repos-8-3.el8.noarch
  - package centos-linux-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-stream-repos-8-3.el8.noarch
  - package centos-stream-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-linux-repos-8-3.el8.noarch
  - package centos-linux-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-stream-repos-8-4.el8.noarch
  - package centos-stream-repos-8-4.el8.noarch conflicts with centos-repos(8) provided by centos-linux-repos-8-3.el8.noarch
  - cannot install the best update candidate for package centos-linux-release-8.5-1.2111.el8.noarch
  - problem with installed package centos-linux-repos-8-3.el8.noarch
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

Execute the command Yum install * expect * again, and the results are as follows:

[root@iZ2vc5xk901ftf2vfscwc1Z yum.repos.d]# yum install *expect*
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Linux-epel.repo; Configuration: OptionBinding with id "failovermethod" does not exist
Last metadata expiration check: 0:07:00 ago on Wed 09 Mar 2022 10:20:01 AM CST.
Package python3-pexpect-4.3.1-3.el8.noarch is already installed.
Dependencies resolved.
===========================================================================================================
 Package                       Architecture         Version                     Repository            Size
===========================================================================================================
Installing:
 expect                        x86_64               5.45.4-5.el8                baseos               267 k
 python3-aexpect               noarch               1.6.2-1.el8                 epel                  93 k
Installing dependencies:
 tcl                           x86_64               1:8.6.8-2.el8               baseos               1.1 M

Transaction Summary
===========================================================================================================
Install  3 Packages

Total download size: 1.5 M
Installed size: 5.2 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): python3-aexpect-1.6.2-1.el8.noarch.rpm                              467 kB/s |  93 kB     00:00    
(2/3): expect-5.45.4-5.el8.x86_64.rpm                                      282 kB/s | 267 kB     00:00    
(3/3): tcl-8.6.8-2.el8.x86_64.rpm                                          351 kB/s | 1.1 MB     00:03    
-----------------------------------------------------------------------------------------------------------
Total                                                                      461 kB/s | 1.5 MB     00:03     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                   1/1 
  Installing       : tcl-1:8.6.8-2.el8.x86_64                                                          1/3 
  Running scriptlet: tcl-1:8.6.8-2.el8.x86_64                                                          1/3 
  Installing       : expect-5.45.4-5.el8.x86_64                                                        2/3 
  Installing       : python3-aexpect-1.6.2-1.el8.noarch                                                3/3 
  Running scriptlet: python3-aexpect-1.6.2-1.el8.noarch                                                3/3 
  Verifying        : expect-5.45.4-5.el8.x86_64                                                        1/3 
  Verifying        : tcl-1:8.6.8-2.el8.x86_64                                                          2/3 
  Verifying        : python3-aexpect-1.6.2-1.el8.noarch                                                3/3 

Installed:
  expect-5.45.4-5.el8.x86_64       python3-aexpect-1.6.2-1.el8.noarch       tcl-1:8.6.8-2.el8.x86_64      

Complete!

OK, you can install yum

Note: in actual use, if there is no CentOS-AppStream.repo related files, do not operate on them

Eg: install git:

[root@iZ2vc5xk901ftf2vfscwc1Z yum.repos.d]# yum -y install git
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Linux-epel.repo; Configuration: OptionBinding with id "failovermethod" does not exist
Last metadata expiration check: 0:07:51 ago on Wed 09 Mar 2022 10:20:01 AM CST.
Dependencies resolved.
===========================================================================================================
 Package                      Architecture       Version                       Repository             Size
===========================================================================================================
Installing:
 git                          x86_64             2.31.1-2.el8                  appstream             161 k
Installing dependencies:
 git-core                     x86_64             2.31.1-2.el8                  appstream             4.7 M
 git-core-doc                 noarch             2.31.1-2.el8                  appstream             2.6 M
 perl-Error                   noarch             1:0.17025-2.el8               appstream              46 k
 perl-Git                     noarch             2.31.1-2.el8                  appstream              78 k
 perl-TermReadKey             x86_64             2.37-7.el8                    appstream              40 k

Transaction Summary
===========================================================================================================
Install  6 Packages

Total download size: 7.7 M
Installed size: 38 M
Downloading Packages:
(1/6): git-2.31.1-2.el8.x86_64.rpm                                         299 kB/s | 161 kB     00:00    
(2/6): perl-Error-0.17025-2.el8.noarch.rpm                                 185 kB/s |  46 kB     00:00    
(3/6): perl-Git-2.31.1-2.el8.noarch.rpm                                    290 kB/s |  78 kB     00:00    
(4/6): perl-TermReadKey-2.37-7.el8.x86_64.rpm                              148 kB/s |  40 kB     00:00    
(5/6): git-core-doc-2.31.1-2.el8.noarch.rpm                                385 kB/s | 2.6 MB     00:07    
(6/6): git-core-2.31.1-2.el8.x86_64.rpm                                    394 kB/s | 4.7 MB     00:12    
-----------------------------------------------------------------------------------------------------------
Total                                                                      640 kB/s | 7.7 MB     00:12     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                   1/1 
  Installing       : git-core-2.31.1-2.el8.x86_64                                                      1/6 
  Installing       : git-core-doc-2.31.1-2.el8.noarch                                                  2/6 
  Installing       : perl-TermReadKey-2.37-7.el8.x86_64                                                3/6 
  Installing       : perl-Error-1:0.17025-2.el8.noarch                                                 4/6 
  Installing       : perl-Git-2.31.1-2.el8.noarch                                                      5/6 
  Installing       : git-2.31.1-2.el8.x86_64                                                           6/6 
  Running scriptlet: git-2.31.1-2.el8.x86_64                                                           6/6 
  Verifying        : git-2.31.1-2.el8.x86_64                                                           1/6 
  Verifying        : git-core-2.31.1-2.el8.x86_64                                                      2/6 
  Verifying        : git-core-doc-2.31.1-2.el8.noarch                                                  3/6 
  Verifying        : perl-Error-1:0.17025-2.el8.noarch                                                 4/6 
  Verifying        : perl-Git-2.31.1-2.el8.noarch                                                      5/6 
  Verifying        : perl-TermReadKey-2.37-7.el8.x86_64                                                6/6 

Installed:
  git-2.31.1-2.el8.x86_64             git-core-2.31.1-2.el8.x86_64   git-core-doc-2.31.1-2.el8.noarch    
  perl-Error-1:0.17025-2.el8.noarch   perl-Git-2.31.1-2.el8.noarch   perl-TermReadKey-2.37-7.el8.x86_64  

Complete!
[root@iZ2vc5xk901ftf2vfscwc1Z yum.repos.d]# git --version
git version 2.31.1

Error 2:

Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Linux-epel.repo; Configuration: OptionBinding with id "failovermethod" does not exist
Repository extras is listed more than once in the configuration
CentOS Linux 8 - AppStream                                                 6.7 kB/s | 2.3 kB     00:00    
Errors during downloading metadata for repository 'appstream':
  - Status code: 404 for http://mirrors.cloud.aliyuncs.com/centos/8/AppStream/x86_64/os/repodata/repomd.xml (IP: xxx.xxx.xxx.xxx)
Error: Failed to download metadata for repo 'appstream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

Solution

Enter the file /etc/yum.repos.d/CentOS-Epel.repo, and comment out  failovermethod=priority :

OK, you can also install yum

How to Solve Yum Error: db5 error(30973)

Problem error: failed to open rpmdb. db5 error(30973)

error: rpmdb: BDB0113 Thread/process 8442/140713489532992 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 -  (-30973)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:

Error: rpmdb open failed
[root@VM-0-6-centos ~]# yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
error: rpmdb: BDB0113 Thread/process 8442/140713489532992 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 -  (-30973)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.cli:Yum Error: Error: rpmdb open failed

The reason why rpm is damaged: the database needs to be rebuilt.

Solution: clear the original link through the command and re-establish it.

[root@localhost ~]# rm -rf /var/lib/rpm/_db*  #Delete the original
[root@localhost ~]# rpm --rebuilddb # New
[root@localhost ~]# yum clean all # Clear all yum caches

It can be used normally at present