Tag Archives: cents

[Solved] Linux – error: cannot open Packages database in /var/lib/rpm

Error Message:

[root@VM_0_17_centos rabbitmq]# yum install xxx.rpm
error: rpmdb: BDB0113 Thread/process 27590/140471762446144 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

Solution:

[root@VM_0_17_centos]# cd /var/lib/rpm
[root@VM_0_17_centos rpm]# ls
Basenames  Conflictname  __db.001  __db.002  __db.003  Dirnames  Group  Installtid  Name  Obsoletename  Packages  Providename  Requirename  Sha1header  Sigmd5  Triggername
[root@VM_0_17_centos rpm]# rm -rf __db*
[root@VM_0_17_centos rpm]# rpm --rebuilddb

Error response from daemon: failed to parse mydockerfile-centos: ENV must have two arguments

This problem occurred when I was trying to create my own dockerfile ready to execute build

Error response from daemon: failed to parse mydockerfile-centos: ENV must have two arguments

The question is shown in the figure. This question means  

  At this time, we found that our env must require two parameters. Let’s take a look at our screenshot

As shown in the figure, there is only one parameter in my env. At this time, I found that I forgot the space

Make the following modifications

Obviously, I changed the env parameter to two parameters

  In the newly built dockerfile we created ourselves

It’s a success!

 

 

[Solved] error: rpmdb: BDB0113 Thread/process

The following error is reported when executing the yum command:

error: rpmdb: BDB0113 Thread/process 1309432/139989604449152 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
Error: Error: rpmdb open failed

Solution:

cd /var/lib/rpm
rm -rf __db*
rpm --rebuilddb

OSError libespeak.so.1 error: no such file or directory [How to Solve]

Traceback (most recent call last):
File “/home/summergao/.local/lib/python3.8/site-packages/pyttsx3/__init__.py”, line 20, in init
eng = _activeEngines[driverName]
File “/usr/lib/python3.8/weakref.py”, line 131, in __getitem__
o = self.data[key]()
KeyError: None
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “mqttToTts.py”, line 23, in <module>
tts = Tts()
File “mqttToTts.py”, line 7, in __init__
self.engine = pyttsx3.init()
File “/home/summergao/.local/lib/python3.8/site-packages/pyttsx3/__init__.py”, line 22, in init
eng = Engine(driverName, debug)
File “/home/summergao/.local/lib/python3.8/site-packages/pyttsx3/engine.py”, line 30, in __init__
self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
File “/home/summergao/.local/lib/python3.8/site-packages/pyttsx3/driver.py”, line 50, in __init__
self._module = importlib.import_module(name)
File “/usr/lib/python3.8/importlib/__init__.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “<frozen importlib._bootstrap>”, line 1014, in _gcd_import
File “<frozen importlib._bootstrap>”, line 991, in _find_and_load
File “<frozen importlib._bootstrap>”, line 975, in _find_and_load_unlocked
File “<frozen importlib._bootstrap>”, line 671, in _load_unlocked
File “<frozen importlib._bootstrap_external>”, line 783, in exec_module
File “<frozen importlib._bootstrap>”, line 219, in _call_with_frames_removed
File “/home/summergao/.local/lib/python3.8/site-packages/pyttsx3/drivers/espeak.py”, line 9, in <module>
from . import _espeak, toUtf8, fromUtf8
File “/home/summergao/.local/lib/python3.8/site-packages/pyttsx3/drivers/_espeak.py”, line 18, in <module>
dll = cdll.LoadLibrary(‘libespeak.so.1’)
File “/usr/lib/python3.8/ctypes/__init__.py”, line 451, in LoadLibrary
return self._dlltype(name)
File “/usr/lib/python3.8/ctypes/__init__.py”, line 373, in __init__
self._handle = _dlopen(self._name, mode)
OSError: libespeak.so.1: cannot open shared object file: No such file or directory

When using python3 to do text-to-speech, I installed pyttsx3 and ran the program with the above error
The reason is that before installing pyttsx3, I need to install a speech environment: “espeak”
Installation command:

sudo apt-get update && sudo apt-get install espeak

fatal error: Python.h: No such file or directory

fatal error: Python.h: No such file or directory

Process: through PIP install a library, an error occurred and the python. H header file could not be found

Solution

Search stackoverflow. My environment is CentOS, so execute sudo Yum install python3 devel and then go to the PIP install library. It’s all OK

For apt (Ubuntu, Debian…):

sudo apt-get install python-dev   # for python2.x installs
sudo apt-get install python3-dev  # for python3.x installs

For yum (CentOS, RHEL…):

sudo yum install python-devel    # for python2.x installs
sudo yum install python3-devel   # for python3.x installs

For dnf (Fedora…):

sudo dnf install python2-devel  # for python2.x installs
sudo dnf install python3-devel  # for python3.x installs

For zippers (openSUSE):

sudo zypper in python-devel   # for python2.x installs
sudo zypper in python3-devel  # for python3.x installs

For apk (Alpine…):
This is a departure from the normal Alpine naming
scheme, which uses py2- and py3- prefixes

sudo apk add python2-dev  # for python2.x installs
sudo apk add python3-dev  # for python3.x installs

For apt-cyg (Cygwin…):

apt-cyg install python-devel   # for python2.x installs
apt-cyg install python3-devel  # for python3.x installs

[Solved] Postgres Start Error: Job for postgresql.service failed because the control process exited with error code.

error message

Job for postgresql.service failed because the control process exited with error code. See "systemctl status postgresql.service" and "journalctl -xe" for details.

Execute systemctl status postgresql.service as prompted

Open this file

vim /usr/lib/systemd/system/postgresql.service
Found not modified to their own initialization of the specified path, modify can

Gitlab nginx wont start to work. [down: nginx: 1s, normally up, want up; run: log: (pid 20128)xxx]

conclusion
I got this problem as well. and now I’ve solved it.
solution
I’ve modified the /etc/gitlab/gitlab.rb file, changed into
nginx[‘redirect_http_to_https_port’] = 80
nginx[‘listen_port’] = 443
and sudo gitlab-ctl reconfigure + sudo gitlab-ctl restart, and it works.
process
in the past, the reason i could connect to gitlab server is because that my colleague have set something in the /var/opt/gitlab/nginx/conf/gitlab-http.conf file.

Redirects all HTTP traffic to the HTTPS host
server {
  listen *:80;

  server_name gitlab.xxxxx.com;
  server_tokens off; ## Don't show the nginx version number, a security best practice


  location/{
    return 301 https://gitlab.xxxxxx.com:443$request_uri;
  }

  # health checks configuration
  include /var/opt/gitlab/nginx/conf/gitlab-health.conf;

  access_log  /var/log/gitlab/nginx/gitlab_access.log gitlab_access;
  error_log   /var/log/gitlab/nginx/gitlab_error.log;
}

server {
  listen *:443 ssl http2;


  server_name gitlab.xxxxxx.com;
  server_tokens off; ## Don't show the nginx version number, a security best practice

and once if I’ve use the command sudo gitlab-ctl reconfigure, and the file gitlab-http.conf would be covered by /etc/gitlab/gitlab.rb. and the nginx settings in /etc/gitlab/gitlab.rb would start to take position that makes me cannot visit gitlab server after using the command sudo gitlab-ctl reconfigure. and now I’ve set the nginx settings right in /etc/gitlab/gitlab.rb just like in the solution part. hope it could help. thx.

[Solved] Exception in replication between CentOS virtual machine and host

Exception in replication between CentOS virtual machine and host

Question:

Error copying file from host to virtual machine:

Error when getting information for file “//tmp/VMwareDnD/p6v6B6/.”: No such file or directory

It was found that there was a problem with vmtools

resolvent:

1. Uninstalled packages

yum remove open-vm-tools

Prompt after success:

Delete:
  open-vm-tools.x86_64 0:11.0.5-3.el7                                           

Deleted as a dependency:
  open-vm-tools-desktop.x86_64 0:11.0.5-3.el7                                   

Done!

2. Restart

3. Install VMware Tools
return to the main interface of VMware application and click the “install VMware Tools” menu item in the “virtual machine” menu
4. Mount the CD-ROM to the specified directory

Usually, the device directory/dev/CDROM is mounted to the/MNT/CDROM directory.
if the CDROM directory does not exist in the/MNT directory, it is created

Check for CDROM

[root@centos7 /]# ll /mnt/cdrom/
Total 56849
-r-xr-xr-x. 1 xxxx xxxx     1976 3月  25 2020 manifest.txt
-r-xr-xr-x. 1 xxxx xxxx     4943 3月  25 2020 run_upgrader.sh
-r--r--r--. 1 xxxx xxxx     56414224 3月  25 2020 VMwareTools-10.3.22-15902021.tar.gz
-r-xr-xr-x. 1 xxxx xxxx     872044 3月  25 2020 vmware-tools-upgrader-32
-r-xr-xr-x. 1 xxxx xxxx     918184 3月  25 2020 vmware-tools-upgrader-64

Create if/MNT/CDROM does not exist

[root@centos7 /]# mkdir /mnt/cdrom

Mount directory

[root@centos7 /]# mount -t auto /dev/cdrom /mnt/cdrom
mount: /dev/sr0 Write-protected, will mount as read-only
mount: /dev/sr0 is mounted or /mnt/cdrom is busy
       /dev/sr0 has been mounted on /run/media/xxxx/VMware Tools
       /dev/sr0 is already mounted on /mnt/cdrom

Copy the installation package to the user’s home directory

[root@centos7 /]# cp /mnt/cdrom/VMwareTools-10.3.22-15902021.tar.gz /

Unmount

[root@centos7 /]# umount /dev/cdrom

Unzip the installation package

[root@centos7 /]# tar -zxvf VMwareTools-10.3.22-15902021.tar.gz

Installing VMware Tools

Enter the unzipped source directory

[root@centos7 /]# cd vmware-tools-distrib

run vmware-install.pl 文件

[root@centos7 vmware-tools-distrib]# ./vmware-install.pl

Then enter all the way and 0 yes
the last successful prompt

Generating the key and certificate files.
Successfully generated the key and certificate files.
The configuration of VMware Tools 10.3.22 build-15902021 for Linux for this 
running kernel completed successfully.

You must restart your X session before any mouse or graphics changes take 
effect.

To enable advanced X features (e.g., guest resolution fit, drag and drop, and 
file and text copy/paste), you will need to do one (or more) of the following:
1. Manually start /usr/bin/vmware-user
2. Log out and log back into your desktop session
3. Restart your X session.

Found VMware Tools CDROM mounted at /run/media/tong/VMware Tools. Ejecting 
device /dev/sr0 ...
Enjoy,

--the VMware team

Centos7 Start Error: Entering emergency mode.Exit the shell to continue

Centos7 start error: Entering emergency mode.Exit the shell to continue

input journalctl

journalctl

Then keep pressing the space bar to jump to the last page to see the red part in the figure below. Check the content in brackets behind XFS to see whether it is sda2 or sda3

My name is sda2

Input: XFS_ repair -v -L /dev/sda2

xfs_repair -v -L /dev/sda2

After the repair, enter reboot to restart

reboot

[Solved] Python Import mmcv Warning: ImportError: libGL.so.1: cannot open shared object file: No such file or directory

ImportError: libGL.so.1: cannot open shared object file: No such file or directory
centos 7.5 Simply install the relevant dependencies.

 yum install mesa-libGL.x86_64
 
 Installed
  mesa-libGL.x86_64 0:18.3.4-12.el7_9

Installed as a dependency:
  libX11.x86_64 0:1.6.7-3.el7_9       libX11-common.noarch 0:1.6.7-3.el7_9         libXau.x86_64 0:1.0.8-2.1.el7
  libXdamage.x86_64 0:1.1.4-4.1.el7   libXext.x86_64 0:1.3.3-3.el7                 libXfixes.x86_64 0:5.0.3-1.el7
  libXxf86vm.x86_64 0:1.1.4-1.el7     libglvnd.x86_64 1:1.0.1-0.8.git5baa1e5.el7   libglvnd-glx.x86_64 1:1.0.1-0.8.git5baa1e5.el7
  libxcb.x86_64 0:1.13-1.el7          libxshmfence.x86_64 0:1.2-1.el7              mesa-libglapi.x86_64 0:18.3.4-12.el7_9

Done!

Ubuntu 20.04 installation:

(mmdet2) root@ubuntuserver:~# apt install libgl1-mesa-glx
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libdrm-amdgpu1 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libgl1 libgl1-mesa-dri libglapi-mesa libglvnd0 libglx-mesa0 libglx0
  libllvm12 libpciaccess0 libsensors-config libsensors5 libvulkan1 libwayland-client0 libx11-xcb1 libxcb-dri2-0 libxcb-dri3-0
  libxcb-glx0 libxcb-present0 libxcb-randr0 libxcb-shm0 libxcb-sync1 libxcb-xfixes0 libxfixes3 libxshmfence1 libxxf86vm1
  mesa-vulkan-drivers
Suggested packages:
  lm-sensors
The following NEW packages will be installed:
  libdrm-amdgpu1 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libgl1 libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libglvnd0
  libglx-mesa0 libglx0 libllvm12 libpciaccess0 libsensors-config libsensors5 libvulkan1 libwayland-client0 libx11-xcb1
  libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-randr0 libxcb-shm0 libxcb-sync1 libxcb-xfixes0 libxfixes3
  libxshmfence1 libxxf86vm1 mesa-vulkan-drivers
0 upgraded, 30 newly installed, 0 to remove and 127 not upgraded.
Need to get 34.3 MB/34.8 MB of archives.
After this operation, 458 MB of additional disk space will be used.
Do you want to continue?[Y/n] y
...
Setting up libgl1-mesa-glx:amd64 (21.0.3-0ubuntu0.1~20.04.1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...

Try importing again:

(mmdet) [root@node1 ~]# python
Python 3.8.10 (default, Jun  4 2021, 15:09:15)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mmcv
>>> exit

[Solved] error: Failed dependencies libcrypto.so.10()(64bit) is needed, libssl.so.10()(64bit) is needed

Premise: I install percona-server-shared-compat-8.0.23-14.1.el8.x86 in percona server for MySQL 8.0 bundle on CentOS 8_ 64. RPM package, even if the latest version of OpenSSL (version: 1:1.1.1g-15.el8) is installed_ 3) It doesn’t help

error:Failed Dependencies
		libcrypto.so.10()(64bit) is needed by percona-server-shared-compat-8.0.23-14.1.el8.x86_64.rpm
		libcrypto.so.10(libcrypto.so.10)(64bit) is needed by percona-server-shared-compat-8.0.23-14.1.el8.x86_64.rpm
		libssl.so.10()(64bit) is needed by percona-server-shared-compat-8.0.23-14.1.el8.x86_64.rpm
		libssl.so.10(libssl.so.10)(64bit) is needed by percona-server-shared-compat-8.0.23-14.1.el8.x86_64.rpm

Process : Found the library when googling
https://pkgs.org/download/libcrypto.so.10()(64bit)
I found compat-openssl10 and an explanation to the effect that compat-openssl10 contains only libraries and provides compatibility with earlier versions and software that does not support compilation with OpenSSL-1.1.

The OpenSSL toolkit provides support for secure communications between machines. This version of OpenSSL package contains only the libraries and is provided for compatibility with previous releases and software that does not support compilation with OpenSSL-1.1.

From stackoverflow, we can find that openssl provides libcrypto.so.10 without the module name, making the system think that the dependency is missing

In your case, openssl seems to provide only libcrypto.so.10 without any module name, making geramer-server believe that dependency is missing as it requires libcrypto.so.10 from module libcrypto.so.10.

https://stackoverflow.com/questions/20518183/dependency-resolution-fails-on-installed-library

Solution:
yum install compat-openssl10
or
yum install http://mirror.centos.org/centos/8/AppStream/x86_64/os/Packages/compat-openssl10-1.0.2o-3.el8.x86_64.rpm

Result: