Category Archives: Linux

[Solved] /var/tmp/rpm-tmp. The tmp file cannot be found when the installation fails

When installing the package generated by rpmbuild, the following error occurred:

/var/tmp/rpm-tmp.YiDXeN: line 374: syntax error: unexpected end of file

 

Solution:

Write a shell script:

#!/ bin/bash

while [ 1 -eq 1 ]
do
cat -n /var/tmp/rpm-tmp.*
done

Then execute./Sh_ test.sh

Another window starts the installation, and you can see in the front window where the error stopped.

If/var/TMP/rpm-tmp.6ljgwm: Line 374: syntax error: unexpected end of file

Generally, if and fi are not paired. You can use Notepad + + statistics to see if   Don’t count elif

Or use Notepad to open the spec script, highlight if and see the pairing.

have not closed a control structure such as a missing  fi   with an  if, or a missing  done   with a  for.

Ubuntu: How to deal with the fatal: the remote end hung up unexpected error of GIT clone Android kernel

Questions

Use git command to clone Android kernel from Tsinghua open source software image station in Ubuntu, but the following error is reported:

$ git clone https://aosp.tuna.tsinghua.edu.cn/kernel/goldfish
Cloning into 'goldfish'...
remote: Enumerating objects: 116, done.
remote: Counting objects: 100% (116/116), done.
remote: Compressing objects: 100% (69/69), done.
error: RPC failed; curl 56 GnuTLS recv error (-9): Error decoding the received TLS packet.
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

Treatment method

After querying some blogs, this error is summed up as the reason why the file is too large

According to the method of the first problem in reference 1, execute the following commands respectively to solve the problem:

Set git minimum speed
$ git config --global http.lowSpeedLimit 0
$ git config --global http.lowSpeedTime 999999
Set http cache
$ git config --global http.postBuffer 1048576000

Among them, postbuffer is used to set HTTP cache, which can be set larger, such as 1g: git config — global http.postbuffer 1048576000, or 3G 3194304000

Debug record 2: debug error in ec20cehg Linux [How to Solve]

Debugging error in ec20cehg Linux

Run quectel CM & amp
requestRegistrationState2 MCC: 460, MNC: 0, PS: Attached, DataCap: EDGE
requestSetupDataCall QMUXResult = 0x1, QMUXError = 0xe
requestSetupDataCall QMUXResult = 0x1, QMUXError = 0xe`

Solution

1: When the Internet of things is locked, it needs to be unblocked
2: does the receiving and transmitting frequency bands of the antenna match

	 I encountered the first situation, replace the IoT card to solve, try the following with their own cell phone card, get the IP address to connect to the Internet can communicate.

[Solved] SSH WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

root@node145:~# ssh-copy-id -i ~/.ssh/id_rsa.pub  [email protected]
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
​
/usr/bin/ssh-copy-id: ERROR: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
ERROR: @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
ERROR: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
ERROR: IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
ERROR: Someone could be eavesdropping on you right now (man-in-the-middle attack)!
ERROR: It is also possible that a host key has just been changed.
ERROR: The fingerprint for the ECDSA key sent by the remote host is
ERROR: SHA256:PO6FFmEQ9kOL1nodp3vLqVvCRW00Rhnn6cD9+SxbfbU.
ERROR: Please contact your system administrator.
ERROR: Add correct host key in /root/.ssh/known_hosts to get rid of this message.
ERROR: Offending ECDSA key in /root/.ssh/known_hosts:2
ERROR:   remove with:
ERROR:   ssh-keygen -f "/root/.ssh/known_hosts" -R "10.17.20.144"
ERROR: ECDSA host key for 10.17.20.144 has changed and you have requested strict checking.
ERROR: Host key verification failed.
​
### Solution Reassign the name of the file where the key is saved
root@node145:~# ssh-keygen -f "/root/.ssh/known_hosts" -R 10.17.20.144
# Host 10.17.20.144 found: line 2
/root/.ssh/known_hosts updated.
Original contents retained as /root/.ssh/known_hosts.old
root@node145:~# ssh-copy-id -i ~/.ssh/id_rsa.pub  [email protected]
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host '10.17.20.144 (10.17.20.144)' can't be established.
ECDSA key fingerprint is SHA256:PO6FFmEQ9kOL1nodp3vLqVvCRW00Rhnn6cD9+SxbfbU.
Are you sure you want to continue connecting (yes/no)?yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
[email protected]'s password: 
​
Number of key(s) added: 1
​
Now try logging into the machine, with:   "ssh '[email protected]'"
and check to make sure that only the key(s) you wanted were added.

SSH keygen command is used to generate, manage and transform authentication key for SSH. It supports RSA and DSA

SSH keygen (option)

-b: specify the length of the key. 
-e : read the private or public key file of openssh. 
-C: add comment. 
-f: specify the name of the file used to save the key. 
-i : reads the unencrypted ssh-v2 compatible private/public key file and then displays the openssh compatible private/public key on the standard output device. 
-l: display the fingerprint data of the public key file. 
-N: provide a new cipher. 
-P: provide the (old) cipher.
-q: silent mode. 
-t: specify the type of key to be created.

[Solved] NIC cannot be generated vf, intel/mellanox, write error: Cannot allocate memory “not enough MMIO resources for SR-IOV”

Phenomenon: # echo 2 > /sys/class/infiniband/mlx5_0/device/mlx5_num_vfs
write error: Cannot allocate memory
#echo 8 > /sys/class/net/enp1s0f0/device/sriov_numvfs
write error: Cannot allocate memory
Verification.
You can see this error in dmesg “not enough MMIO resources for SR-IOV”
Analysis.
Due to BIOS limitations or errors, the PCI code cannot reallocate enough MMIO. RHEL’s SR-IOV support makes it necessary to have enough resources to map all possible VFs, otherwise all VF MMIO space allocation will fail.
Solution.
1. The BIOS does not provide enough MMIO space for the VFs. Contact your hardware vendor for a firmware or bios update.
2. As a workaround, you can pass “pci=realloc” to kernel 2.6.32-228.el6 during boot.
Implementation.
Add the following section in red to grub.cfg.
[root@localhost ~]# cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=”$(sed ‘s, release .*$,,g’ /etc/system-release)”
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT=”console”
GRUB_CMDLINE_LINUX=”crashkernel=auto resume=/dev/mapper/cl-swap rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet iommu=pt intel_iommu=on pci=assign-busses pci=realloc”
GRUB_DISABLE_RECOVERY=”true”
GRUB_ENABLE_BLSCFG=true
[root@localhost ~]#
Verification:
[root@localhost ~]# cat /proc/cmdline
BOOT_IMAGE=(hd0,gpt9)/vmlinuz-4.18.0-240.22.1.el8_3.x86_64 root=/dev/mapper/cl-root ro crashkernel=auto resume=/dev/mapper/cl-swap rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet iommu=pt intel_iommu=on pci=assign-busses pci=realloc
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# lspci
00:00.0 Host bridge: Intel Corporation Device 9b33 (rev 05)
00:01.0 PCI bridge: Intel Corporation 6th-9th Gen Core Processor PCIe Controller (x16) (rev 05)
00:02.0 VGA compatible controller: Intel Corporation Device 9bc5 (rev 05)
00:08.0 System peripheral: Intel Corporation Xeon E3-1200 v5/v6/E3-1500 v5/6th/7th/8th Gen Core Processor Gaussian Mixture Model
00:12.0 Signal processing controller: Intel Corporation Comet Lake PCH Thermal Controller
00:14.0 USB controller: Intel Corporation Comet Lake USB 3.1 xHCI Host Controller
00:14.2 RAM memory: Intel Corporation Comet Lake PCH Shared SRAM
00:15.0 Serial bus controller [0c80]: Intel Corporation Comet Lake PCH Serial IO I2C Controller #0
00:16.0 Communication controller: Intel Corporation Comet Lake HECI Controller
00:17.0 SATA controller: Intel Corporation Device 06d2
00:1b.0 PCI bridge: Intel Corporation Comet Lake PCI Express Root Port #21 (rev f0)
00:1c.0 PCI bridge: Intel Corporation Device 06bd (rev f0)
00:1c.6 PCI bridge: Intel Corporation Device 06be (rev f0)
00:1f.0 ISA bridge: Intel Corporation Device 0687
00:1f.3 Audio device: Intel Corporation Comet Lake PCH cAVS
00:1f.4 SMBus: Intel Corporation Comet Lake PCH SMBus Controller
00:1f.5 Serial bus controller [0c80]: Intel Corporation Comet Lake PCH SPI Controller
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (11) I219-LM
01:00.0 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5]
01:00.1 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5]
01:00.2 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5 Virtual Function]
01:00.3 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5 Virtual Function]
01:00.4 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5 Virtual Function]
01:00.5 Ethernet controller: Mellanox Technologies MT27800 Family [ConnectX-5 Virtual Function]
02:00.0 Non-Volatile memory controller: Intel Corporation SSD 660P Series (rev 03)
03:00.0 PCI bridge: Texas Instruments XIO2001 PCI Express-to-PCI Bridge
05:00.0 Network controller: Qualcomm Atheros AR9287 Wireless Network Adapter (PCI-Express) (rev 01)
[root@localhost ~]#related commands:
#modprobe mlx5_core max_vfs=8
#mlxconfig -d /dev/mst/mt4119_pciconf0 q set SRIOV_EN=1 NUM_OF_VFS=8
#mst start    //mlx manager tools   mst status
modprobe:
options mlx4_core num_vfs=4 port_type_array=1,2 probe_vf=1echo 0 > /sys/class/net/enp1s0f0/device/sriov_numvfs
echo 8 > /sys/class/net/enp1s0f0/device/sriov_numvfs

Ubuntu20.04 install the ROS noetic version in catkin_Problems in make compilation

2021-06-27 install ROS noetic version. There was a problem during compilation. Now record it

1. Error one

-- Could NOT find PY_em (missing: PY_EM) 
CMake Error at cmake/empy.cmake:30 (message):
Unable to find either executable 'empy' or Python module 'em'...  try
installing the package 'python-empy'

You need to install Python empy to solve the above problems

pip install empy

2. Error two

Once the error is resolved, continue with catkin_ The following error occurred when making

ImportError: "from catkin_pkg.package import parse_package" failed: No module named 'catkin_pkg'
Make sure that you have installed "catkin_pkg", it is up to date and on the PYTHONPATH

Try to find catkin_ PKG and check pythonpath with the following command:

locate catkin_pkg

If you execute the above command and report an error that locate is not installed, use the following command to install it:

sudo apt install mlocate

After executing locate catkin_ After PKG, in the displayed results, the first behavior is as follows:

/usr/lib/python3/dist-packages/catkin_pkg

View the path of pythonpath

echo $PYTHONPATH
# After executing the above command, the following result is displayed
/opt/ros/noetic/lib/python3/dist-packages

Therefore, catkin_ Make is not in the pythonpath path. Next, you need to add catkin_ Make is added to the pythonpath path

Edit the ~/.bashrc file and add the following two lines to the end of the file.
export PYTHONPATH=$PYTHONPATH:/usr/lib/python3/dist-packages

Save the file and run the source to update.
source ~/.bashrc

Re-check PYTHONPATH:
echo $PYTHONPATH
/opt/ros/noetic/lib/python3/dist-packages:/usr/lib/python3/dist-packages

To solve the above two problems

Job for network.service failed [How to Solve]

[root@centOS ~]# systemctl start network.service
Restarting network (via systemctl): Job for network.service failed because the control process exited with error code.
See “systemctl status network.service” and “journalctl -xe” for details.
[root@centOS ~]# systemctl status network.service

[root@centOS ~]# journalctl -xe[root@centOS ~]# systemctl start network.service
Restarting network (via systemctl): Job for network.service failed because the control process exited with error code.
See “systemctl status network.service” and “journalctl -xe” for details.
[root@centOS ~]# systemctl status network.service
[root@centOS ~]# journalctl -xe

Reason.
On CentOS system, there are currently two network management tools, NetworkManager and network. If both are configured, it will cause conflicts, and NetworkManager will clean up the routes when the network is disconnected. If some custom routes, which are not added to NetworkManager’s configuration file, the routes are cleaned up and need to be custom added on after the network is connected.
Solution.
1. Stop the networkmanager service
systemctl stop NetworkManager
systemctl disable NetworkManager
2. restart the network card, it is OK
systemctl restart network
systemctl status network

[Solved] Job for docker.service failed because the control process exited with error code. After changing the docker configuration

Solution
( 1) Change       Cnetos7 managed startup file   , When the configuration service starts, does the daemon use the    Some profiles

vim /usr/lib/systemd/system/docker.service

[ Service]

ExecStart=/usr/bin/dockerd            # delete  – After H (including)   All content

(2) There is a problem with the configuration of daemon.json
Look carefully. What’s wrong

I didn’t write that before   ,   number

{    # Turn on remote connection
” hosts”: [” tcp://0.0.0.0 :2375″,”unix:///var/run/docker.sock”],

#  Image acceleration (write your own, alicloud, don’t write it)
” registry-mirrors”: [“https://*******.mirror.aliyuncs.com”]

}

systemctl   daemon-reload

systemctl   start   docker
Wait for the startup to succeed,

ss -anput  | grep  : two thousand three hundred and seventy-five      Display, port open

Docker pull Command Error response from daemon: Head https://registry-1.docker.io/v2/library/

Exception information:

Error response from daemon: Head https://registry-1.docker.io/v2/library/redis/manifests/latest: Get https://auth.docker.io/token?scope=repository%3Alibrary%2Fredis%3Apull&service=registry.docker.io: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

There are two main ways to solve this problem

Method 1:
Parsing IP is not available. You can use dig @ 114.114.114.114 registry-1.docker.io to find the following information

;; ANSWER SECTION:
registry-1.docker.io.   forty       IN       A       3.209.182.229
Fill in the information in answer section and etc/hosts file

Method 2:
DNS resolution error
in/etc/resolv. Conf
Add Google’s DNS domain name resolution address:
nameserver 8.8.4.4
nameserver localdomain
restart the docker command after saving:

[Solved] Doris 5 Doris_core Run make Error: bk_messages.hh:214:26 error: invalid conversion from ‘char‘ …

Doris 5 error during installation

Problem Description:

Doris in Doris 5_ Error when executing make in the core folder: BK_ messages.hh:214:26 error: invalid conversion from ‘char’ to ‘const char*’ [fpermissive]

strcat(name_, ‘\ 0’);// terminate id

Solution:

Find Doris_ BK in the core folder_ Message.hh file, comment out line 214 strcat (name, '\ 0');, add name_[ 9] = '\0';

It should be changed as follows:

211   if (strlen(id)>=10)
212      {
213       strncpy(name_,id,9);
#         strcat(name_,'\0');
214       name_[9] = '\0':
215      }
216    else
217      {