Tag Archives: linux

The remote port occupation of Linux startup jar package script reports an error

PATH=$PATH:$JAVA_HOME/bin
NAME=$1
VERSION=$2
PORT=$3
echo $NAME
ID=`ps -ef | grep "$NAME" | grep -v "$0" | grep -v "grep" | awk '{print $2}'`
for id in $ID
do
kill -9 $id
echo "killed $id"
done
nohup java -server -Xms600m -Xmx600m -Xmn256m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m -Xverify:none -XX:+DisableExplicitGC 
-Djava.awt.headless=true -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=$PORT,suspend=n -Duser.timezone=Asia/Shanghai 
-Denv=fat -Dapollo.cluster=vmfat03 -jar $NAME-$VERSION.jar  > $NAME.log 2>&1 &

  The script is shown in the figure, which is a very common one. However, if I add a remote port when I start, an error will be reported when I run the script next time

ERROR: transport error 202: bind failed: Address already in use
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [debugInit.c:750]

The remote port is occupied, but I have obviously killed the process, and the command query has also been killed.

After guessing whether it will take some time for the remote connection port to close completely after killing the process, but at this time, you use the same port number to start the remote debug mode, which will lead to the error shown in the figure above, so I’ll sleep 1 behind the done in the script. Let him wait 1s.

The result proved that the conjecture was correct, and then no such error was reported

Troubleshooting of samba error in Linux configuration startup

Troubleshooting of samba error in Linux configuration startup

    systemctl start SMB indicates an error and the firewall needs to be closed. Set SELinux to disabled through sudo VI/etc/SELinux/config, and systemctl start SMB succeeds again. Windows connects to Linux through samba and prompts an error. You need to turn off the firewall through sudo systemctl stop firewalld. Then, connect again and succeed

    Configuring Samba login users

    Sudo smbpasswd – a username
    sudo smbpasswd – A to add a user, the user to be added must already be a system user
    sudo smbpasswd – D to freeze the user so that the user can no longer log in
    sudo smbpasswd – e to restore the user, so that the frozen user can use
    sudo smbpasswd – n to set the user’s password to null again

[Solved] configure: error: no acceptable C compiler found in $PATH

Error: configure: error: no acceptable C compiler found in $PATH

root@ubuntuserver4:/usr/local/pcre-8.01# sudo ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/usr/local/pcre-8.01':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

Solution: install GCC software suite

Method 1. Yum install GCC
method 2. Apt get install GCC

root@ubuntuserver4:~# apt-get install gcc
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  binutils cpp cpp-4.8 gcc-4.8 libasan0 libatomic1 libcloog-isl4
  libgcc-4.8-dev libgmp10 libisl10 libitm1 libmpc3 libmpfr4 libquadmath0
  libtsan0
Suggested packages:
  binutils-doc cpp-doc gcc-4.8-locales gcc-multilib manpages-dev autoconf
  automake1.9 libtool flex bison gdb gcc-doc gcc-4.8-multilib gcc-4.8-doc
  libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan0-dbg
  libtsan0-dbg libquadmath0-dbg
The following NEW packages will be installed:
  binutils cpp cpp-4.8 gcc gcc-4.8 libasan0 libatomic1 libcloog-isl4
  libgcc-4.8-dev libgmp10 libisl10 libitm1 libmpc3 libmpfr4 libquadmath0
  libtsan0
0 upgraded, 16 newly installed, 0 to remove and 171 not upgraded.
Need to get 14.5 MB of archives.
After this operation, 51.9 MB of additional disk space will be used.
Do you want to continue?[Y/n] y
WARNING: The following packages cannot be authenticated!
  libasan0 libatomic1 libitm1 libquadmath0 libtsan0 binutils cpp-4.8
  libgcc-4.8-dev gcc-4.8
Install these packages without verification?[y/N] y
Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libasan0 amd64 4.8.4-2ubuntu1~14.04.4 [63.1 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libatomic1 amd64 4.8.4-2ubuntu1~14.04.4 [8,630 B]
Get:3 http://us.archive.ubuntu.com/ubuntu/ trusty/main libgmp10 amd64 2:5.1.3+dfsg-1ubuntu1 [218 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu/ trusty/main libisl10 amd64 0.12.2-1 [419 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu/ trusty/main libcloog-isl4 amd64 0.18.2-1 [57.5 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libitm1 amd64 4.8.4-2ubuntu1~14.04.4 [28.6 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu/ trusty/main libmpfr4 amd64 3.1.2-1 [203 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libquadmath0 amd64 4.8.4-2ubuntu1~14.04.4 [126 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libtsan0 amd64 4.8.4-2ubuntu1~14.04.4 [94.8 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu/ trusty/main libmpc3 amd64 1.0.1-1ubuntu1 [38.4 kB]
Get:11 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main binutils amd64 2.24-5ubuntu14.2 [2,076 kB]
Get:12 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main cpp-4.8 amd64 4.8.4-2ubuntu1~14.04.4 [4,452 kB]
Get:13 http://us.archive.ubuntu.com/ubuntu/ trusty/main cpp amd64 4:4.8.2-1ubuntu6 [27.5 kB]
Get:14 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libgcc-4.8-dev amd64 4.8.4-2ubuntu1~14.04.4 [1,688 kB]
Get:15 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main gcc-4.8 amd64 4.8.4-2ubuntu1~14.04.4 [5,040 kB]
Get:16 http://us.archive.ubuntu.com/ubuntu/ trusty/main gcc amd64 4:4.8.2-1ubuntu6 [5,098 B]
Fetched 14.5 MB in 8s (1,771 kB/s)
Selecting previously unselected package libasan0:amd64.
(Reading database ... 60337 files and directories currently installed.)
Preparing to unpack .../libasan0_4.8.4-2ubuntu1~14.04.4_amd64.deb ...
Unpacking libasan0:amd64 (4.8.4-2ubuntu1~14.04.4) ...
Selecting previously unselected package libatomic1:amd64.
Preparing to unpack .../libatomic1_4.8.4-2ubuntu1~14.04.4_amd64.deb ...
Unpacking libatomic1:amd64 (4.8.4-2ubuntu1~14.04.4) ...
Selecting previously unselected package libgmp10:amd64.
Preparing to unpack .../libgmp10_2%3a5.1.3+dfsg-1ubuntu1_amd64.deb ...
Unpacking libgmp10:amd64 (2:5.1.3+dfsg-1ubuntu1) ...
Selecting previously unselected package libisl10:amd64.
Preparing to unpack .../libisl10_0.12.2-1_amd64.deb ...
Unpacking libisl10:amd64 (0.12.2-1) ...
Selecting previously unselected package libcloog-isl4:amd64.
Preparing to unpack .../libcloog-isl4_0.18.2-1_amd64.deb ...
Unpacking libcloog-isl4:amd64 (0.18.2-1) ...
Selecting previously unselected package libitm1:amd64.
Preparing to unpack .../libitm1_4.8.4-2ubuntu1~14.04.4_amd64.deb ...
Unpacking libitm1:amd64 (4.8.4-2ubuntu1~14.04.4) ...
Selecting previously unselected package libmpfr4:amd64.
Preparing to unpack .../libmpfr4_3.1.2-1_amd64.deb ...
Unpacking libmpfr4:amd64 (3.1.2-1) ...
Selecting previously unselected package libquadmath0:amd64.
Preparing to unpack .../libquadmath0_4.8.4-2ubuntu1~14.04.4_amd64.deb ...
Unpacking libquadmath0:amd64 (4.8.4-2ubuntu1~14.04.4) ...
Selecting previously unselected package libtsan0:amd64.
Preparing to unpack .../libtsan0_4.8.4-2ubuntu1~14.04.4_amd64.deb ...
Unpacking libtsan0:amd64 (4.8.4-2ubuntu1~14.04.4) ...
Selecting previously unselected package libmpc3:amd64.
Preparing to unpack .../libmpc3_1.0.1-1ubuntu1_amd64.deb ...
Unpacking libmpc3:amd64 (1.0.1-1ubuntu1) ...
Selecting previously unselected package binutils.
Preparing to unpack .../binutils_2.24-5ubuntu14.2_amd64.deb ...
Unpacking binutils (2.24-5ubuntu14.2) ...
Selecting previously unselected package cpp-4.8.
Preparing to unpack .../cpp-4.8_4.8.4-2ubuntu1~14.04.4_amd64.deb ...
Unpacking cpp-4.8 (4.8.4-2ubuntu1~14.04.4) ...
Selecting previously unselected package cpp.
Preparing to unpack .../cpp_4%3a4.8.2-1ubuntu6_amd64.deb ...
Unpacking cpp (4:4.8.2-1ubuntu6) ...
Selecting previously unselected package libgcc-4.8-dev:amd64.
Preparing to unpack .../libgcc-4.8-dev_4.8.4-2ubuntu1~14.04.4_amd64.deb ...
Unpacking libgcc-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.4) ...
Selecting previously unselected package gcc-4.8.
Preparing to unpack .../gcc-4.8_4.8.4-2ubuntu1~14.04.4_amd64.deb ...
Unpacking gcc-4.8 (4.8.4-2ubuntu1~14.04.4) ...
Selecting previously unselected package gcc.
Preparing to unpack .../gcc_4%3a4.8.2-1ubuntu6_amd64.deb ...
Unpacking gcc (4:4.8.2-1ubuntu6) ...
Processing triggers for man-db (2.6.7.1-1) ...
Setting up libasan0:amd64 (4.8.4-2ubuntu1~14.04.4) ...
Setting up libatomic1:amd64 (4.8.4-2ubuntu1~14.04.4) ...
Setting up libgmp10:amd64 (2:5.1.3+dfsg-1ubuntu1) ...
Setting up libisl10:amd64 (0.12.2-1) ...
Setting up libcloog-isl4:amd64 (0.18.2-1) ...
Setting up libitm1:amd64 (4.8.4-2ubuntu1~14.04.4) ...
Setting up libmpfr4:amd64 (3.1.2-1) ...
Setting up libquadmath0:amd64 (4.8.4-2ubuntu1~14.04.4) ...
Setting up libtsan0:amd64 (4.8.4-2ubuntu1~14.04.4) ...
Setting up libmpc3:amd64 (1.0.1-1ubuntu1) ...
Setting up binutils (2.24-5ubuntu14.2) ...
Setting up cpp-4.8 (4.8.4-2ubuntu1~14.04.4) ...
Setting up cpp (4:4.8.2-1ubuntu6) ...
Setting up libgcc-4.8-dev:amd64 (4.8.4-2ubuntu1~14.04.4) ...
Setting up gcc-4.8 (4.8.4-2ubuntu1~14.04.4) ...
Setting up gcc (4:4.8.2-1ubuntu6) ...
Processing triggers for libc-bin (2.19-0ubuntu6.9) ...

You can execute it after installation

root@ubuntuserver4:~# cd /usr/local/pcre-8.01/
root@ubuntuserver4:/usr/local/pcre-8.01# sudo ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking dependency style of g++... none
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for int64_t... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for dlfcn.h... yes
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... (cached) no
checking whether g++ accepts -g... (cached) no
checking dependency style of g++... (cached) none
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether ln -s works... yes
checking for ANSI C header files... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for sys/types.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking dirent.h usability... yes
checking dirent.h presence... yes
checking for dirent.h... yes
checking windows.h usability... no
checking windows.h presence... no
checking for windows.h... no
checking for alias support in the linker... no
checking for alias support in the linker... no
checking string usability... no
checking string presence... no
checking for string... no
checking bits/type_traits.h usability... no
checking bits/type_traits.h presence... no
checking for bits/type_traits.h... no
checking type_traits.h usability... no
checking type_traits.h presence... no
checking for type_traits.h... no
checking for srtoq... no
checking for strtoll... no
checking for _strtoi64... no
checking for strtoimax... no
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for bcopy... yes
checking for memmove... yes
checking for strerror... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for gzopen in -lz... yes
checking bzlib.h usability... no
checking bzlib.h presence... no
checking for bzlib.h... no
checking for libbz2... no
checking readline/readline.h usability... no
checking readline/readline.h presence... no
checking for readline/readline.h... no
checking readline/history.h usability... no
checking readline/history.h presence... no
checking for readline/history.h... no
checking for readline in -lreadline... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libpcre.pc
config.status: creating libpcreposix.pc
config.status: creating libpcrecpp.pc
config.status: creating pcre-config
config.status: creating pcre.h
config.status: creating pcre_stringpiece.h
config.status: creating pcrecpparg.h
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing script-chmod commands
config.status: executing delete-old-chartables commands

pcre-8.01 configuration summary:

    Install prefix .................. : /usr/local
    C preprocessor .................. : gcc -E
    C compiler ...................... : gcc
    C++ preprocessor ................ :
    C++ compiler .................... : g++
    Linker .......................... : /usr/bin/ld -m elf_x86_64
    C preprocessor flags ............ :
    C compiler flags ................ : -O2
    C++ compiler flags .............. :
    Linker flags .................... :
    Extra libraries ................. :

    Build C++ library ............... : yes
    Enable UTF-8 support ............ : no
    Unicode properties .............. : no
    Newline char/sequence ........... : lf
    \R matches only ANYCRLF ......... : no
    EBCDIC coding ................... : no
    Rebuild char tables ............. : no
    Use stack recursion ............. : yes
    POSIX mem threshold ............. : 10
    Internal link size .............. : 2
    Match limit ..................... : 10000000
    Match limit recursion ........... : MATCH_LIMIT
    Build shared libs ............... : yes
    Build static libs ............... : yes
    Link pcregrep with libz ......... : no
    Link pcregrep with libbz2 ....... : no
    Link pcretest with libreadline .. : no

How to Solve Docker delete container image error: Error response from daemon: conflict: unable to delete 7cc1942f1ed5 (must be forced)

I don’t know if you have encountered an error when
docker deletes the container image

docker RMI container image ID

Details of error reporting:

Error response from daemon: conflict: unable to delete 7cc1942f1ed5 (must be forced) – image is referenced in multiple repositories

Solution:

First docker PS - a
see several containers with the same image ID. what the hell, There must be a mistake during the construction, and then stop the container using the container image (if it has stopped, please go to the next step)
docker stop the ID of the container using the container image and RM drop
docker RM the ID of the container using the container image and
docker RMI the container image ID

Discovery or error


Well, the ultimate solution (that’s the point of this article)

docker rmi -f This container image ID

It is the above command with the – f parameter that forcibly deletes all container images with the container image ID

How to Solve Git clone Error: error: RPC failed; result=35, HTTP code = 0

When installing odoo, GIT clone downloads odoo and reports an error
error: RPC failed; result=35, HTTP code = 0

[odoo@node02 src]$ git clone https://www.github.com/odoo/odoo --depth 1 --branch 14.0 /opt/odoo/odoo14
Cloning into '/opt/odoo/odoo14'...
error: RPC failed; result=35, HTTP code = 0
fatal: The remote end hung up unexpectedly

The Internet says the error cache is small

Solution: set the cache to 50m or greater
I set 50m

git config --global http.postBuffer 50M

The above error does not appear, but a new error appears

[odoo@node02 src]$ git config --global http.postBuffer 50M
[odoo@node02 src]$ git clone https://www.github.com/odoo/odoo --depth 1 --branch 14.0 /opt/odoo/odoo14
Cloning into '/opt/odoo/odoo14'...
fatal: unable to access 'https://www.github.com/odoo/odoo/': Encountered end of file

This is a mistake, fatal: unable to access ‘ https://www.github.com/odoo/odoo/ ’: Encountered end of file
clicking on the Internet:
git config –global http.proxy
git config –global –unset http.proxy

or not.

[odoo@node02 src]$ git config --global http.proxy
[odoo@node02 src]$ git config --global --unset http.proxy
[odoo@node02 src]$ git clone https://www.github.com/odoo/odoo --depth 1 --branch 14.0 /opt/odoo/odoo14
Cloning into '/opt/odoo/odoo14'...
fatal: unable to access 'https://www.github.com/odoo/odoo/': Encountered end of file
[odoo@node02 src]$ rm ~/.gitconfig
[odoo@node02 src]$ git clone https://www.github.com/odoo/odoo --depth 1 --branch 14.0 /opt/odoo/odoo14
Cloning into '/opt/odoo/odoo14'...
fatal: unable to access 'https://www.github.com/odoo/odoo/': Encountered end of file

The ultimate solution:
change HTTPS to GIT and you will succeed in Git clone git://www.github.com/ ****

[odoo@node02 src]$ git clone git://www.github.com/odoo/odoo --depth 1 --branch 14.0 /opt/odoo/odoo14     
Cloning into '/opt/odoo/odoo14'...
remote: Enumerating objects: 31507, done.
remote: Counting objects: 100% (31507/31507), done.
remote: Compressing objects: 100% (25092/25092), done.
Receiving objects:  20% (6511/31507), 22.17 MiB | 64.00 KiB/s    

dpkg: error: dpkg frontend is locked by another process

Question

Today, the following problems occur when using dpkg – I *. DEB:

root@zabbix-server:~# dpkg -i zabbix-release_4.0-3+bionic_all.deb
dpkg: error: dpkg frontend is locked by another process

reason

This is because the package manager did not close properly

solve

1. Find out the process of saving the lock file

lsof /var/lib/dpkg/lock-frontend
sudo kill -9 PID

2. Remove the lock and reconfigure the dpkg

sudo rm /var/lib/dpkg/lock-frontend
sudo dpkg --configure -a

3. Then don’t report mistakes

Error:Could not create the Java Virtical Machine. Error: A fatal exception has occurred. program

I’m in Android Studio – & gt; help–> After editing cost VM options modifies the configuration (because the word is misspelled), Android studio cannot be opened. It is useless to modify studio64.vmoptions in the bin directory, uninstall and reinstall, There are the following errors when opening the command line:
it is obvious that I misspelled the word class in the process of configuration

actually, it can’t be started because my android studio does not start the Android studio I re downloaded by default, but the residual file of the Android studio with incorrect configuration.
solution: find the directory: ~ /. Config/Google/androidstudio2020.3/studio.vmoptions, Replace the correct configuration and restart it

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

RuntimeError: Address already in use [How to Solve]

(cp3) zhangrui@test:~/project/cp3/CenterPoint$ python -m torch.distributed.launch --nproc_per_node=4 ./tools/train.py ~/project/cp3/CenterPoint/work_dirs/voxsc_centerpoint_voxelnet_0075voxel_fix_bn_z.py
*****************************************
Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable forformance in your application as needed.
*****************************************
No Tensorflow
No Tensorflow
Traceback (most recent call last):
  File "./tools/train.py", line 137, in <module>
    main()
  File "./tools/train.py", line 86, in main
    torch.distributed.init_process_group(backend="nccl", init_method="env://")
  File "/home/zhangrui/anaconda3/envs/cp3/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 436, in init_process_group
    store, rank, world_size = next(rendezvous_iterator)
  File "/home/zhangrui/anaconda3/envs/cp3/lib/python3.7/site-packages/torch/distributed/rendezvous.py", line 179, in _env_rendezvous_handler
    store = TCPStore(master_addr, master_port, world_size, start_daemon, timeout)
RuntimeError: Address already in use

The TCP port is occupied. Start multiple jobs on one computer. You need to specify a different port for each job (29500 by default) to avoid communication conflict
the solution is to specify the port while running the program, and give the port number arbitrarily before the PY file to be executed:

python -m torch.distributed.launch --nproc_per_node=1 --master_port 66660  ./tools/train.py ~/project/cp3/CenterPoint/work_dirs/voxel_config/nusc_centerpoint_voxelnet_0075voxel_fix_bn_z.py

Another way is to find the occupied port number (insert print output in the program), then find the PID value corresponding to the port number: netstat – nltp, and then cancel the occupation of the port through kill – 9 PID.

[Solved] #include errors detected. Please update your includePath.

When I saw the solution, I didn’t know why my first reaction was: Sima Danghuo, doctor.

Under the. Vscode folder, locate C_ cpp_ Properties.json, I don’t need to tell you that people have told you about their mistakes.

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "/usr/include/**",		add this line
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "gnu17",
            "cppStandard": "gnu++14",
            "intelliSenseMode": "linux-gcc-x64",
            "compileCommands": "${workspaceFolder}/build/release-cpp11/compile_commands.json"
        }
    ],
    "version": 4
}