Category Archives: Linux

How to Solve Xmind Install Error in Ubuntu System

1. Download the zip package from the official website.

2. After decompression, enter the directory to execute the script:

sudo sh setup.sh

If the following error is encountered, the corresponding dependency package is missing and cannot be found by the current system:

E: Package 'libwebkitgtk-1.0-0' has no installation candidate

Solution:

sudo getdit /etc/apt/sources.list  # Open the list of mirror sources


deb http://cz.archive.ubuntu.com/ubuntu bionic main universe  # Add the following image source to the file

sudo apt-get update  # update

sudo sh setup.sh  # re-execute

3. Run

Enter the XMind_amd64 directory and execute the script “./xmind” to run successfully

[Solved] Virtual Machine Centos7 Startup Error: Entering emergency mode

Environment

Start centos7 in VMware 15.5 on win10, and the following error is reported:

entering emergency mode Exit the shell to continue

Cause analysis

According to the CentOS file system fault, the root causes of the fault are:

  • Force shutdown of the virtual machine (skip the system and directly shut down VMWare)
  • Irregular execution of on-hook operations
  • Irregularly execute restart operation

Repair method:

Please enter the following command to repair:

xfs_repair -v -L /dev/sda3

Parameter Description:
– L: use the xfs_repair command to clear the log (even if dirty data is included, this will change the metadata information)

After modification, print the log as follows:

after that, execute reboot, restart centos7, and observe whether it can be started normally.

How to Solve Android Linux5.10 Kernel do_gettimeofday Function Error

Android Linux 5.10 kernel do_gettimeofday function prompt does not exist.

Solution: Replace with ktime_get_real_ts64 function.

Specific examples:

Code before modification:

    struct  timeval   time_now;
	struct rtc_time tm; 
    do_gettimeofday(&time_now);
	rtc_time_to_tm(time_now.tv_sec, &tm); 

Code after modification:

	struct timespec64 ts64;
	struct rtc_time tm; 
    ktime_get_real_ts64(&ts64);
	tm = rtc_ktime_to_tm(ts64.tv_sec); 

[Solved] Samba Mount Error: mount error(22): Invalid argument

Samba mount using cifs method reported an error:
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

 

Check the Log:

No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1).
To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.

 

Reason and Solution:No cifs share version specified, cifs are divided into smb1.0/2.0/3.0/3.1

mount -t cifs //ip/data /test -o username=test,password=test,vers=3.0

The sec parameter setting may also lead to similar errors, you can check through man to select the sec parameter setting for that one

[Solved] Linux WebService Startup Error: BindException: Cannot assign requested address

Linux deploys the WebService service and starts the error bindexception: cannot assign requested address

code

Question

The windows local test is normal. When it is deployed to the Linux server, an error is reported when it is started: BindException: Cannot assign requested address

Cause of problem

There is a problem with the IP in the URL. If Alibaba cloud and other cloud servers are used, you need to check the address of the network card eth0, and then change the IP in the URL to the IP of eth0

if not, check whether the IP of eth0 is configured or not in /etc/hosts. If not, add: IP + hostname
if you do not know the hostname, you can use the hostname command to check. If not, vim /etc/hosts, and then insert the data: IP hostname. Note that there is a space in the middle

Finally, when accessing WebService, the service can be accessed through public IP

[Solved] Log Error: kernel: blk_update_request: I/O error, dev fd0, sector 0

Environment: Center OS 7.6 virtual machine

Log error: kernel: BLK_ update_ request: I/O error, dev fd0, sector 0

Query the error information and find that there may be no floppy disk, and the floppy disk drive is loaded when the system is started.

Verification: lsmod | grep float

Step 1: (Not Work)

Try creating nofloppy.conf in the /etc/modprobe.d/ directory to disable the floppy module from loading on boot

vim /etc/modprobe.d/blacklist.conf

#Add command line
blacklist floppy

Or

echo "blacklist floppy" | tee /etc/modprobe.d/blacklist-floppy.conf

reboot

Step 2: The use of blacklist does not disable the way, and finally choose to add the following code in grub to boot disable

vim /boot/grub2/grub.cfg
 
#Add code
modprobe.blacklist=floppy
#Disable floppy drive
 
reboot

After rebooting and checking the logs, no errors were reported.

[Solved] fatal error: openssl/hmac.h: No such file or directory

Background

Error in compiling MSOffice encryption binary file on Debian 10 server

GitHub address: https://github.com/herumi/msoffice

report errors:

root@e0fef8daa858:/var/www/msoffice# make -j RELEASE=1
/usr/bin/make -C src
make[1]: Entering directory '/var/www/msoffice/src'
g++ -c msoffice-crypt.cpp -o release/msoffice-crypt.o -g -D_FILE_OFFSET_BITS=64 -msse2 -fno-operator-names -Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wfloat-equal -Wpointer-arith  -Ofast -fomit-frame-pointer -DNDEBUG -march=native -msse4 -I/var/www/msoffice/include -I/var/www/msoffice/../cybozulib/include -I/var/www/msoffice/../mie/include
g++ -c attack.cpp -o release/attack.o -g -D_FILE_OFFSET_BITS=64 -msse2 -fno-operator-names -Wall -Wextra -Wformat=2 -Wcast-qual -Wcast-align -Wwrite-strings -Wfloat-equal -Wpointer-arith  -Ofast -fomit-frame-pointer -DNDEBUG -march=native -msse4 -I/var/www/msoffice/include -I/var/www/msoffice/../cybozulib/include -I/var/www/msoffice/../mie/include
In file included from /var/www/msoffice/include/decode.hpp:14,
                 from msoffice-crypt.cpp:16:
/var/www/msoffice/../cybozulib/include/cybozu/crypto.hpp:30:10: fatal error: openssl/hmac.h: No such file or directory
   30 | #include <openssl/hmac.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [../common.mk:57: release/msoffice-crypt.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from /var/www/msoffice/include/attack.hpp:14,
                 from attack.cpp:14:
/var/www/msoffice/../cybozulib/include/cybozu/crypto.hpp:30:10: fatal error: openssl/hmac.h: No such file or directory
   30 | #include <openssl/hmac.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [../common.mk:57: release/attack.o] Error 1
make[1]: Leaving directory '/var/www/msoffice/src'
make: *** [Makefile:7: all] Error 2

Solution:

To solve this problem, you need to install the OpenSSL development package, execute the following command to install it, and then recompile it

apt update && apt install libssl-dev

If it is CentOS, you can execute the following command to solve the problem

yum install openssl-dev -y

[Solved] Virtual machine Failed to restart network Error: Error:Failed to start LSB: Bring up/down networking

Problem description

A virtual machine that has been running normally. After a shutdown and restart, it is found that SSH cannot connect

Restart network discovery failed

service networkrestart

Solution:

[root@lexsaints ~]#systemctl stop NetworkManager
[root@lexsaints ~]#systemctl disable NetworkManager
[root@lexsaints ~]#systemctl restart  network
or
[root@lexsaints ~]#systemctl  restart NetworkManager
[root@lexsaints ~]#systemctl restart  network

Cause of problem

NetworkManager is a program that detects the network and automatically connects to the network.

Whether it’s wireless or wired, it makes it easy for you to manage.

For wireless networks, the network manager can automatically switch to the most reliable wireless network.

The program using the network manager can freely switch between online and offline modes.

The network manager can preferentially select wired network and support VPN.

The network manager was originally developed by RedHat and is now managed by gnome.

[Solved] Fatal error in PMPI_Init: Other MPI error, error stack:MPIR_Init_thread(138)

1. Problems

Use the compiler of onepai 2021.3. After compiling the program, use the slurm scheduling system to run the job and report an error:

2. Solutions

In the sbatch script of slurm, add the environment variable of libpmi2.so

export I_MPI_PMI_LIBRARY=../slurm/lib/libpmi2.so

If the application image is made in a container (such as docker)

1. Copy the libpmi2.so file into the container

2. At the same time, the corresponding environment variables are configured for export

 

[Solved] Compose error “HTTP request took too long to complete“

Recently, I noticed that the following error messages often appear in docker-compose:

ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60).

Adding COMPOSE_HTTP_TIMEOUT seems to only delay the error. Is this a known issue? Or is there a workaround?
Tried increasing the COMPOSE_HTTP_TIMEOUT environment variable and it didn’t work.

# Increase timeout period to 120 seconds.
export COMPOSE_HTTP_TIMEOUT=120;
# Rebuild all containers using the new images.
docker-compose up -d;

# or use docker-compose --verbose up -d to check out the errors

My Solution:

sudo service docker restart
docker-compose up

Maybe I have a high inode

df -ih			#  -i, --inodes   List information about information nodes, not data block usage
Filesystem     Inodes IUsed IFree IUse% Mounted on
udev             493K   390  492K    1% /dev
tmpfs            494K   537  494K    1% /run
/dev/xvda1       1.3M  1.2M   70K   95% /
tmpfs            494K     1  494K    1% /dev/shm
tmpfs            494K     3  494K    1% /run/lock
tmpfs            494K    16  494K    1% /sys/fs/cgroup
tmpfs            494K     4  494K    1% /run/user/1000

[Solved] gawk: error while loading shared libraries: libreadline.so.4

While cross-compiling, I encountered gawk: error while loading shared libraries: libreadline.so.4: cannot open shared object file: No such file or directory. The current build environment is x86_64, Ubuntu 20.04, the target runtime environment is mips32. The first thing I thought of when I encountered this problem was to install this lib.

On Ubuntu, we can use the apt-file program to find out where this library is installed. If you don’t have apt-file installed on your system, you need to install apt-file first, and then run it as follows:

$sudo apt-file update
$sudo apt-file search libreadline.so.4   #find no results
$sudo apt-file search libreadline.so    #returns the following
lib32readline-dev: /usr/lib32/libreadline.so

lib32readline8: /lib32/libreadline.so.8

lib32readline8: /lib32/libreadline.so.8.0

libreadline-dev: /usr/lib/x86_64-linux-gnu/libreadline.so

libreadline-gplv2-dev: /usr/lib/x86_64-linux-gnu/libreadline.so

libreadline5: /lib/x86_64-linux-gnu/libreadline.so.5

libreadline5: /lib/x86_64-linux-gnu/libreadline.so.5.2

libreadline5-dbg: /usr/lib/debug/libreadline.so.5

libreadline5-dbg: /usr/lib/debug/libreadline.so.5.2

libreadline8: /lib/x86_64-linux-gnu/libreadline.so.8

libreadline8: /lib/x86_64-linux-gnu/libreadline.so.8.0

libreadline.so.4 is a very old library and is no longer available on Ubuntu’s library sources, but try the later versions. Since the source code is developed and compiled on 32bit centos, choose the 32bit library: lib32readline8.

Run as below:

$sudo apt install lib32readline8

After installation, enter the /lib32 directory and you can see libreadline.so.8 and libreadline.so.8.0.

lrwxrwxrwx 1 root root     18 Feb 25  2020 /lib32/libreadline.so.8 -> libreadline.so.8.0
-rw-r--r-- 1 root root 311884 Feb 25  2020 /lib32/libreadline.so.8.0

Then run:

$ sudo ln -sv /lib32/libreadline.so.8.0 /lib32/libreadline.so.4

In $ls -l you can see that the symbolic link has been created.

However, running the cross-compilation task still reports the same error. After posting this issue on stack overflow, someone left a comment below reminding me to fix not libreadline.so.4, but the gawk version being too old.

I ran $gawk which prompted no such command, so

$sudo apt install gawk

Then Enter $gawk –version to check the other version, and return

GNU Awk 5.0.1, API: 2.0 (GNU MPFR 4.0.2, GNU MP 6.2.0)

Enter $whereis gawk to find its installation path:

gawk: /usr/bin/gawk /usr/lib/x86_64-linux-gnu/gawk /usr/share/man/man1/gawk.1.gz

The path is /usr/bin, and running the cross-compile job again still gives the same error, which means that there is another gawk installed in a directory that is called first when running the cross-compile. And this directory is not in the $PATH, or if it is, it is after /usr/bin.

I found the possible installation directory of gawk in the configuration file of the source code to be compiled, cd to that directory, run $gawk, and report the same error, and here it is. Run the following command:

$cp /usr/bin/gawk gawk

Run gawk in the current directory again to confirm that it has been updated to the latest version.

Run cross compilation again without error. The problem has been solved.