Tag Archives: linux

Docker Start Container Error: Error response from daemon: task already exists: unknown

Prompt: docker restart XXX error response from daemon: cannot restart container XXX: container “XXX”: already exists

Even if you run systemctl restart docker, it doesn’t work. Maybe some containers use systemctl stop docker, which will start the container of the bridge network, but will not kill the docker??? Using docker start XXX, the error “already exists” is always reported.

Cause: the container did not exit safely

Solution 1:

#xxx is the container of hash_id
rm -r /var/run/docker/runtime-runc/moby/xxx

Solution 2:
never mind. Restart can solve 50% of the problems:

reboot

[Solved] yum Command Error: Error: Failed to download metadata for repo ‘appstream‘

From the official explanation:
CentOS Linux 8 had reached the End Of Life (EOL) on December 31st, 2021. It means that CentOS 8 will no longer receive development resources from the official CentOS project. After Dec 31st, 2021, if you need to update your CentOS, you need to change the mirrors to vault.centos.org where they will be archived permanently.

Solution: Execute the following statements in sequence

cd /etc/yum.repos.d/
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
yum update

[Solved] filebeat Startup Error: Exiting: error unpacking config data: more than one namespace configured accessing

After extracting filebeat from the virtual machine, enter #: ./filebeat -c filebeat.yml

Encountered the following problems!!!!!!

Exiting: error unpacking config data: more than one namespace configured accessing ‘output’ (source:’filebeat.yml’)

resolvent:

#Note that you must install filebeat in your own directory to modify filebeat.yml

[filebeat directory] #: VIM filebeat.yml

After entering, find the following configuration location

#—————————-Elasticsearch output ———————————-

output. elasticsearch:

#Array of hosts to connecr to.

hosts: [“localhost:9200”]

=====================Modification====================

Just comment out the contents under Elasticsearch output

#—————————-Elasticsearch output ———————————-

#output. elasticsearch:

#Array of hosts to connecr to.

hosts: [“localhost:9200”]

Save exit after modification

Restart filebeat

Enter #:/ filebeat -c filebeat.yml

View process

Enter #:/ filebeat -e -c filebeat.yml

Successfully started filebeat!!!!!

Virtual machine ping Command Error: ping name or service not known

Problem description

In the process of using VMware, the virtual machine environment was configured, but due to the confusion of pending shutdown, the following errors were found when restarting today:
Ping www.google.com, the following errors are found: Ping name or service not known

Since it can be used correctly before, ensure that the virtual network editor of the virtual machine is configured correctly. If it is the first configuration and has not been successfully started before, you can check the configuration of the network editor.

In the process of finding a solution, the following errors are found by using the restart network command service network restart :
restarting network failed journalctl - Xe for detail control process exited with error code

Problem-solving

systemctl stop NetworkManager
systemctl disable NetworkManager
systemctl start network.service

[Solved] Linux shell Script Error: syntax error near unexpected token `do

[problem] the error content reported by the Linux server running the shell script is shown in the following figure.

[reason] incompatible carriage return and line feed characters under Linux and windows

[solution] change the windows newline character “CR lf” in the file to UNIX “LF”

Use Notepad + + to set the view first -> Display symbol -> When all symbols are displayed, you will see “CR lf”

Edit -> with Notepad + +; Document format conversion -> Convert to UNIX (LF)

Re-run to solve the problem.

[Solved] catkin_make Error: pkg_resources.DistributionNotFound: pyparsing

A new workspace is created and catkin_make gives the following error:

Base path: /home/caohaojie/ros_ws
Source space: /home/caohaojie/ros_ws/src
Build space: /home/caohaojie/ros_ws/build
Devel space: /home/caohaojie/ros_ws/devel
Install space: /home/caohaojie/ros_ws/install
####
#### Running command: "cmake /home/caohaojie/ros_ws/src -DCATKIN_DEVEL_PREFIX=/home/caohaojie/ros_ws/devel -DCMAKE_INSTALL_PREFIX=/home/caohaojie/ros_ws/install -G Unix Makefiles" in "/home/caohaojie/ros_ws/build"
####
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:22 (message):
  Search for 'catkin' in workspace failed (catkin_find_pkg catkin
  /home/caohaojie/ros_ws/src): Traceback (most recent call last):
    File "/home/caohaojie/.local/bin/catkin_find_pkg", line 5, in <module>
      from pkg_resources import load_entry_point
    File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2603, in <module>
    File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 666, in require
    File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 565, in resolve
  pkg_resources.DistributionNotFound: pyparsing

-- Configuring incomplete, errors occurred!
See also "/home/caohaojie/ros_ws/build/CMakeFiles/CMakeOutput.log".
Invoking "cmake" failed

 

Solution:
Downgrade the version of catkin-pkg
$pip3 install catkin-pkg==0.4.16 

[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!