Tag Archives: ubuntu

[Solved] an error occurred when attempting to lock the volume

When using the burning tool win32diskimager to create the Ubuntu system boot disk, an error occurred

because the software was placed on the USB disk. Software and image files should be placed in other locations. Select the location of the created file under device.

Correct production process

    1. after opening the Win32 disk imager software, click the button under device, select the SD card, select the image file, and then click write. When the overwrite prompt message as shown in the figure below appears, click the “yes” button

    1. . There will be a progress display during the burning process. When the burning is completed, the progress bar reaches 100% and then disappears

    1. after burning, a successful prompt box will pop up, and click “OK” to complete the burning operation

[Solved] Docker Error: got permission denied while trying to connect to the docker daemon socket at…

Problem Description:
got permission denied while trying to connect to the docker daemon socket at unix:///var/run/docker.sock: Get http://% 2fvar% 2frun% 2fdocker.sock/v1.40/version: Dial UNIX/var/run/docker.sock: Connect: permission denied
error reason:
docker process uses UNIX socket instead of TCP port. By default, UNIX socket belongs to the root user and needs root permission to access it
solution:

sudo groupadd docker     #Add the docker user group
sudo gpasswd -a $USER docker #Add the logged-in user to the docker user group
newgrp docker #Update the user group
docker ps #Test that the docker command works properly with sudo

Troubleshooting of Ubuntu wrk installation error

Installation Preferences

https://blog.csdn.net/qq_41030861/article/details/90553510

git clone https://github.com/wg/wrk.git 

cd mrk
make
ln -s /xxx/mrk/mrk  /usr/local/bin

be careful

The compilation environment
needs to be installed, including C, C + +
related C libraries, Lua, etc

report errors

echo LuaJIT-2.1
LuaJIT-2.1
make: unzip: Command not found
Makefile:81: recipe for target ‘obj/LuaJIT-2.1’ failed
make: *** [obj/LuaJIT-2.1] Error 127

Error reporting solution

Linux system does not have its own compression and decompression tools; We need to install it ourselves; When Zip or unzip is used, unzip: command not found or zip: command not found will appear if it is not installed; This happens because unzip and zip are not installed;

sudo apt-get install zip

[Solved] Sudo doesn‘t work: “/etc/sudoers is owned by uid 1000, should be 0”

1.error
When I type a sudo command into the terminal it shows the following error:

sudo: /etc/sudoers is owned by uid 1000, should be 0
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

How do I fix this?
2. Solution:
Change the owner back to root:

pkexec chown root:root /etc/sudoers /etc/sudoers.d -R

Or use the visudo command to ensure general correctness of the files:

pkexec visudo

Moveit configuration manipulator error: kin.parameters file

Follow the tutorial with moveit_ setup_ Assistant generates the configuration package, opens the terminal, runs roslaunch demo.launch, and reports an error
rlexception: error loading & lt; rosparam> tag:
file does not exist [3]
XML is < rosparam command=”load” file=”3″ ns=”manipulator”/>

  Then edit the model

In planning   In the groups option, the kin.parameters file is empty, and the group default planner selects RRT

Save and regenerate the function package to overwrite the old function package.

Problem solving

  reference resources: https://blog.csdn.net/anyingdaozhimi/article/details/109247029

[Solved] Opencv3. X fatal error: opencv2/nonfree/nonfree.hpp: there is no such file or directory

When SIFT algorithm is used for matching, an error is reported during compilation:

fatal error: opencv2/nonfree/nonfree.hpp: Not having that file or directory
#include <opencv2/nonfree/nonfree.hpp>

When you go online, you basically say to download opencv nonfree:

sudo apt-get update
sudo add-apt-repository --yes ppa:xqms/opencv-nonfree
sudo apt-get update
sudo apt-get install libopencv-nonfree-dev

As a result, a new error is reported when the second instruction is run:

sudo add-apt-repository --yes ppa:xqms/opencv-nonfree
Cannot add PPA: 'ppa:~xqms/ubuntu/opencv-nonfree'.
ERROR: '~xqms' user or team does not exist.

After careful review, it is found that the opencv2. X version is still very good to install under the Ubuntu system. You only need to install it through the above instructions

opencv-3.4.0/opencv_contrib-3.4.0/modules/xfeatures2d/include/opencv2/xfeatures2d/nonfree.hpp

Put #include < opencv2/nonfree/nonfree.hpp> Change to absolute path and solve it.

Docker Run ‘echo core > /proc/sys/kernel/core_pattern‘ Error

1、 Background

In the previous article, the research group needs to encapsulate AFL as a web API with docker in order to make a visual display of AFL on the web side. When the script is redeployed, the AFL boot fails when calling AFL for fuzzing. Because before executing AFL fuzzy , if the system is configured to send core dump file (core) notification to external programs, the delay between sending crash information to fuzzer will increase, and the crash may be falsely reported as timeout. So you have to modify the core temporarily_ Pattern file, as follows:

echo core > /proc/sys/kernel/core_pattern

However, an error occurs when executing the above command in the docker container:

bash: /proc/sys/kernel/core_pattern: Read-only file system

Core_ Pattern is a system read-only file and cannot be modified

2、 Doubt

When docker is executed, the root user executes various commands internally. Why can’t you change the files with read-only permission?With this question, baidu found it again and again, but it didn’t find one. Therefore, it checked a machine turned post, which is also ambiguous.

Since Baidu can’t, then Google. After checking for two minutes, I found a blog of compatriots across the Strait and found a solution.

3、 Solution

Direct code:

# Add the --privileged parameter when building the container
docker run -idt -p xx:xx --privileged afl-api:0.0.3

As with the above command, the problem can be solved by adding an additional -- privileged parameter when building the container.

4、 Cause

About version 0.6, privileged was introduced into docker
with this parameter, the root in the container has real root permissions
otherwise, the root in the container is only an external ordinary user permission
with the container started by privileged, you can see many devices on the host and execute mount
it even allows you to start the docker container in the docker container

That is, the container with the -- privileged parameter can really execute root permission.

To solve the problem that deep in 20.2 system cannot save and transform the format of typora, and provide an effective installation method of typora

Background: deep in 20.2 system app store can only edit files after downloading typora, but can’t save files and convert file formats (such as exporting PDF, word, etc.) without any error prompt, just can’t convert.

Cause analysis: the typora downloaded from the deep in app store comes with its own pandoc plug-in, so there is no problem that there is no pandoc; The deepin version of TA is 20.0, but it can be used normally. I use the command line to run typora for operation, and there is no error related to file conversion or saving. Subjective conjecture is that the latest version of deepin is incompatible with the app store’s typora version.

resolvent:

Uninstall the app store, and download and install it from the official website https://www.typora.io/ (just use the operation method of Linux system on the official website)

Actual operation:

The following is the official website installation operation and possible errors, I give my own solution:

1. Get the key

wget -qO – https://typora.io/linux/public-key.asc | sudo apt-key add –

2. Add the repository of typora

sudo add-apt-repository ‘deb https://typora.io/linux ./’
sudo apt-get update

in this step, you may report an error of “unable to find the repository command”

Try some methods on the network is not feasible, so directly add violence!

    use the VIM command to edit the configuration file of apt get installation( The directory is/etc/apt/source. List)

      Press’ I ‘to enter edit mode and add: DEB https://typora.io/linux . /,
      then press ESC + “: WQ” to save and exit

        then execute sudo apt get update to update the configuration file

        3. Install typora

        sudo apt-get install typora

Solve the problem that Gabor can’t start itself after the server is restarted

Questions

When the server deployed with Gabor restarts, it may appear that Gabor can’t follow the system to start itself

Solution

Now assume that the location of the installation directory of Gabor is/usr/local/Gabor. After the installation of Gabor, the docker-compose.yml configuration file will be generated in this directory. You can use docker compose to operate this file to control the startup and shutdown of Gabor.

Next, write a system D service that starts from Gabor, named Gabor. Service (placed in the/etc/system/system directory)

[Unit]
Description=harbor
After=docker.service systemd-networkd.service systemd-resolved.service
Requires=docker.service
Documentation=http://github.com/vmware/harbor

[Service]
Type=simple
Restart=on-failure
RestartSec=5
ExecStart=/usr/local/bin/docker-compose -f  /usr/local/harbor/docker-compose.yml up
ExecStop=/usr/local/bin/docker-compose -f  /usr/local/harbor/docker-compose.yml down

[Install]
WantedBy=multi-user.target

After writing, use systemctl enable harbor.service to set the boot time. Then restart the server for testing.

The solution of insufficient disk space of docker in Ubuntu

First, check the docker location:

docker info

Stop docker service

systemctl stop docker

Look at the high capacity location and create a transfer directory on it

df -h
mkdir -p /home/docker

Take/home/docker as an example. I will transfer the docker of/var/lib/docker to here later.

Migrate the files in/var/lib/docker directory to the target location

sudo rsync -avz /var/lib/docker /home/docker

Create a new/etc/docker/daemon.json file and edit it

There is no such file by default, so you can create and edit it directly with vim
sudo vim /etc/docker/daemon.json
Here is how to use vim.
Press i to enter the insert state and copy the following list into the file
{
  "graph":"/docker/lib/docker"

}
Press Esc to exit the insert state, then press shift+:
and then press wq! Enter to force save the file.
PS. If you encounter any swap file already open when inserting, then sudo rm file name to delete the file

Reload docker and restart docker

systemctl daemon-reload && systemctl restart docker

Check whether the docker is changed to a new directory

docker info

Delete old docker directory

rm -rf /var/lib/docker