Category Archives: Linux

[Solved] Ubuntu: su Switch root Error: Authentication failure

[Ubuntu] solve the problem of error reporting when switching root with Su: authentication failure user authentication failure

Question:

Authentication failure occurs when Ubuntu uses Su to switch root. Authentication fails

Error reporting reason:

Because the Ubuntu system does not activate the root user by default, you need to activate it manually and then use the Su command

Solution:

Enter the following code to set the root password

sudo passwd root

[Solved] ubuntu Boot Error: /dev/nume0n1p2:clean

This is an error that cannot be reported in the graphical interface. Sometimes this problem occurs when the driver or program is updated.

Solution:
Ctrl + Alt + F2 enter the command line, enter the user name and password, and then enter the update library: sudo apt update

update kernel:
sudo apt upgrade

check for updates:
sudo apt install - f

delete old kernel:
sudo apt autoremove

Restart: reboot
Congratulations on your success!

[Solved] ImportError:lib***.so–cannot open shared object file: No such…(pycharm/clion Error but shell No Error)

Problem Description: after the compilation is successful (there is an executable file in the folder), an error is reported when running (Ubuntu) clip, and the error cannot be found So shared library (but shell can execute normally) solution (similar error reporting in pycharm)

/home/luoxinhao/Desktop/mywork/bin/Infantry: error while loading shared libraries: libopencv_features2d.so.4.5: cannot open shared object file: No such file or directory

Reason: the execution of clion may be different from the environment variables of our shell. The following is the solution

Method 1: each time you start the clion, use the terminal to enter the folder where the clion is located and input/clion.SH, it can be executed normally. (feasible but troublesome)

Method 2: soft link method (both shell error reporting and idle error reporting are feasible, but many libraries may need to be linked, one by one)

My clion was successfully modified in this way, but pycharm gave up seven or eight links without completing the chain

1.1 find files

find  / -name  lib**. So (missing DLL)

1.2 establishing soft links

ln -s  /path/to/lib**. so   /usr/lib

1.3 sudo ldconfig

Method 3: modify LD_LIBRARY_Path (for me, it can only solve the shell error, and the modified idle still reports an error)

sudo gedit ~/. bashrc

export LD_LIBRARY_PATH=/where/you/install/lib:$LD_LIBRARY_PATH

sudo source ~/.bashrc

Method 4: modify/etc/LD so.Conf (ibid.)

vim  /etc/ld.so.conf

add  /where/you/install/lib

sudo ldconfig

Method 5: add it to the environment variable (available, used to solve the error reported by idle, which may need to be used in conjunction with method 3, without separate attempt)

First, open pycharm and modify the environment variable of the running configuration in the upper right corner

If you already have an environment variable, type a semicolon after it and paste it.

Paste content is similar to method 3

For example, method 3 is as follows

export LD_LIBRARY_PATH="/opt/intel/openvino_2021.4.689/opencv/lib:$LD_LIBRARY_PATH"

Then add after the semicolon

LD_LIBRARY_PATH=/opt/intel/openvino_2021.4.689/opencv/lib

[Solved] VMware Create a Virtual Machine Error: unsuccessful

VMware encountered a classic error when creating a virtual machine:

Attempting to start up from:
EFI VMware Virtual SCSI Hard Drive (0.0) … unsuccessful.
EFI VMware Virtual SATA CDROM Drive (1.0) … unsuccessful.
EFI Network…

Solution:
1 Find the VMX file in the installation directory of the virtual machine
2 Delete firmware = “EFI”
3 Save and restart the virtual machine to install normally

Linux: How to Solve vim ~/.bashrc Execute Error

1. If you want to add environment variables under Linux, execute VIM ~/The bashrc command has the following error:

2. Execute sudo apt update first to see what happens

3. Execute sudo apt install — reinstall command not found

4. Finally, execute sudo sudo chmod -R o+r /var/lib/command-not-found/ to successfully solve the problem!

[Solved] ××: error while loading shared libraries: ××.so.19: cannot open shared object file: No such file or directory

××: error while loading shared libraries: ××. so. 19: cannot open shared object file: No such file or directory

When starting some programs, the corresponding link library could not find a solution

[root@feng1 build]# ttyd --help
ttyd: error while loading shared libraries: libwebsockets.so.19: cannot open shared object file: No such file or directory
[root@feng1 build]# ttyd --help
ttyd: error while loading shared libraries: libjson-c.so.5: cannot open shared object file: No such file or directory

This means that the program needs libwebsockets.so.19 and libjson-c.so.5 the functions in the two dynamic link libraries can not be found in the corresponding directory. The dynamic link library under Linux is composed of LD So is responsible for loading, and his configuration file is in etc/LD.so.conf , it is found that there is really no ××.So file under/usr/local/lib configured, we can manually add the specified path to solve the error problem

/environment/libwebsockets/build/lib		## libwebsockets.so.19
/cpack/json-c/build					## libjson-c.so.5

Then refresh the cache and run it again

[root@feng1 build]# sudo ldconfig		

[root@feng1 build]# ttyd --help
ttyd is a tool for sharing terminal over the web

USAGE:
    ttyd [options] <command> [<arguments...>]

VERSION:
    1.6.3-3e37e33

OPTIONS:
    -p, --port              Port to listen (default: 7681, use `0` for random port)
    -i, --interface         Network interface to bind (eg: eth0), or UNIX domain socket path (eg: /var/run/ttyd.sock)
    -c, --credential        Credential for basic authentication (format: username:password)
    -H, --auth-header       HTTP Header name for auth proxy, this will configure ttyd to let a HTTP reverse proxy handle authentication
    -u, --uid               User id to run with
    -g, --gid               Group id to run with
    -s, --signal            Signal to send to the command when exit it (default: 1, SIGHUP)
    -w, --cwd               Working directory to be set for the child program
    -a, --url-arg           Allow client to send command line arguments in URL (eg: http://localhost:7681?arg=foo&arg=bar)
    -R, --readonly          Do not allow clients to write to the TTY
    -t, --client-option     Send option to client (format: key=value), repeat to add more options
    -T, --terminal-type     Terminal type to report, default: xterm-256color
    -O, --check-origin      Do not allow websocket connection from different origin
    -m, --max-clients       Maximum clients to support (default: 0, no limit)
    -o, --once              Accept only one client and exit on disconnection
    -B, --browser           Open terminal with the default system browser
    -I, --index             Custom index.html path
    -b, --base-path         Expected base path for requests coming from a reverse proxy (eg: /mounted/here, max length: 128)
    -P, --ping-interval     Websocket ping interval(sec) (default: 5)
    -S, --ssl               Enable SSL
    -C, --ssl-cert          SSL certificate file path
    -K, --ssl-key           SSL key file path
    -A, --ssl-ca            SSL CA file path for client certificate verification
    -d, --debug             Set log level (default: 7)
    -v, --version           Print the version and exit
    -h, --help              Print this text and exit

Visit https://github.com/tsl0922/ttyd to get more information and report bugs.
[root@feng1 build]#

[Solved] sys.stderr.write(f“ERROR: {exc}“) SyntaxError: invalid syntax

There was an error querying the version of Ubuntu after installing PIP3

Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 7, in <module>
    from pip._internal.cli.main import main
  File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 57
    sys.stderr.write(f"ERROR: {exc}")
                                   ^
SyntaxError: invalid syntax

Solution:

wget https://bootstrap.pypa.io/pip/3.5/get-pip.py

After downloading, execute the following command

python3 get-pip.py 

[Solved] yum error: rpmdb: BDB0113 Thread/process

error

shell> yum info subversion
error: rpmdb: BDB0113 Thread/process 1765361/140192760330112 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:

shell> mv /var/lib/rpm/__db.00* /tmp/&&yum clean all

[Solved] pxp_lib.h:19:10: fatal error: linux/pxp_device.h: No such file or directory


ERROR: imx-lib-1_5.8+AUTOINC+3f777974c0-r0 do_compile: oe_runmake failed
ERROR: imx-lib-1_5.8+AUTOINC+3f777974c0-r0 do_compile: Execution of '/sd1/jarvis-workspace/build-x11/tmp/work/cortexa7t2hf-neon-mx6ul-fsl-linux-gnueabi/imx-lib/1_5.8+AUTOINC+3f777974c0-r0/temp/run.do_compile.612337' failed with exit code 1
ERROR: Logfile of failure stored in: /sd1/jarvis-workspace/build-x11/tmp/work/cortexa7t2hf-neon-mx6ul-fsl-linux-gnueabi/imx-lib/1_5.8+AUTOINC+3f777974c0-r0/temp/log.do_compile.612337
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 1 CROSS_COMPILE=arm-fsl-linux-gnueabi- PLATFORM= INCLUDE=-I/sd1/jarvis-workspace/build-x11/tmp/work/cortexa7t2hf-neon-mx6ul-fsl-linux-gnueabi/imx-lib/1_5.8+AUTOINC+3f777974c0-r0/recipe-sysroot/usr/include/imx all
| make -C pxp all
| make[1]: Entering directory '/sd1/jarvis-workspace/build-x11/tmp/work/cortexa7t2hf-neon-mx6ul-fsl-linux-gnueabi/imx-lib/1_5.8+AUTOINC+3f777974c0-r0/git/pxp'
| arm-fsl-linux-gnueabi-gcc  -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/sd1/jarvis-workspace/build-x11/tmp/work/cortexa7t2hf-neon-mx6ul-fsl-linux-gnueabi/imx-lib/1_5.8+AUTOINC+3f777974c0-r0/recipe-sysroot -D -I/sd1/jarvis-workspace/build-x11/tmp/work/cortexa7t2hf-neon-mx6ul-fsl-linux-gnueabi/imx-lib/1_5.8+AUTOINC+3f777974c0-r0/recipe-sysroot/usr/include/imx -Wall -fPIC  -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/sd1/jarvis-workspace/build-x11/tmp/work/cortexa7t2hf-neon-mx6ul-fsl-linux-gnueabi/imx-lib/1_5.8+AUTOINC+3f777974c0-r0=/usr/src/debug/imx-lib/1_5.8+AUTOINC+3f777974c0-r0                      -fdebug-prefix-map=/sd1/jarvis-workspace/build-x11/tmp/work/cortexa7t2hf-neon-mx6ul-fsl-linux-gnueabi/imx-lib/1_5.8+AUTOINC+3f777974c0-r0=/usr/src/debug/imx-lib/1_5.8+AUTOINC+3f777974c0-r0                      -fdebug-prefix-map=/sd1/jarvis-workspace/build-x11/tmp/work/cortexa7t2hf-neon-mx6ul-fsl-linux-gnueabi/imx-lib/1_5.8+AUTOINC+3f777974c0-r0/recipe-sysroot=                      -fdebug-prefix-map=/sd1/jarvis-workspace/build-x11/tmp/work/cortexa7t2hf-neon-mx6ul-fsl-linux-gnueabi/imx-lib/1_5.8+AUTOINC+3f777974c0-r0/recipe-sysroot-native=  -c pxp_lib.c -o pxp_lib.o
| <command-line>: error: macro names must be identifiers
| In file included from pxp_lib.c:26:
| pxp_lib.h:19:10: fatal error: linux/pxp_device.h: No such file or directory
|    19 | #include <linux/pxp_device.h>
|       |          ^~~~~~~~~~~~~~~~~~~~
| compilation terminated.
| make[1]: *** [Makefile:30: pxp_lib.o] Error 1
| make[1]: Leaving directory '/sd1/jarvis-workspace/build-x11/tmp/work/cortexa7t2hf-neon-mx6ul-fsl-linux-gnueabi/imx-lib/1_5.8+AUTOINC+3f777974c0-r0/git/pxp'
| make: *** [Makefile:17: pxp] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/sd1/jarvis-workspace/build-x11/tmp/work/cortexa7t2hf-neon-mx6ul-fsl-linux-gnueabi/imx-lib/1_5.8+AUTOINC+3f777974c0-r0/temp/run.do_compile.612337' failed with exit code 1

Error resolution:

meta-jarvis/recipes-bsp/imx-lib/imx-lib_git.bbappend



ADD:


PLATFORM_mx6ull = "IMX6UL"

[Solved] CentOS Use Yum to install dependency: error: rpmdb open failed

When installing dependencies using Yum in CentOS, the following errors are reported:

the solution is as follows:

Execute the following commands in order

 # Go to the directory where rpmdb is located
 cd /var/lib/rpm
 # Clear the original rpmdb file
 rm -f __db.*
 # Rebuild the rpm database
 rpm --rebuilddb
 # Clear all yum caches
 yum clean all

After execution, use Yum to install the dependent packages normally

[Solved] Nginx cannot access pictures on FTP Error: Whitelabel error page

1. Unable to access the picture

 

As can be seen from the above figure, whether the full path home/ftpuser/image access or/image access is used, the image access fails.

Let’s solve this problem

2. Configure nginx image access path

# Go to the conf directory of nginx, and find nginx.conf

# Edit profile
vi nginx.conf

# nginx.conf Add Configuration
location /image {
	alias /home/ftpuser/image;
	autoindex on;
}

3. Restart nginx

./nginx -s reload

4. Picture access succeeded