Tag Archives: ubuntu

[Solved] Error :: You must put some ‘source‘ URIs in your sources.list

Solution:

Just enter the following three lines.

sudo cp /etc/apt/sources.list /etc/apt/sources.list~
sudo sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list
sudo apt-get update

Users who are not logged in can copy the code below.

sudo cp /etc/apt/sources.list /etc/apt/sources.list~
sudo sed -Ei ‘s/^# deb-src /deb-src /’ /etc/apt/sources.list
sudo apt-get update

Reference:
https://askubuntu.com/questions/496549/error-you-must-put-some-source-uris-in-your-sources-list

[Solved] kalibr Compile Error: error: ‘Eigen::MatrixBase<Derived>::~Matrix

Error 1:
/usr/include/eigen3/Eigen/src/Core/util/Macros.h:885:23: error: ‘Eigen::MatrixBase<Derived>::~MatrixBase() [with Derived = Eigen::Matrix<double, -1, 1>]’ is protected
EIGEN_DEVICE_FUNC ~Derived() = default;
Solution:
/usr/include/eigen3/Eigen/src/Core/MatrixBase.h line 466
Change protected to public
Error 2:

Errors     << aslam_cv_python:make /home/lab/kalibr_workspace/logs/aslam_cv_python/build.make.002.log
Solution: in the File of kalibr/aslam_cv/aslam_imgproc/include/aslam/implementation/aslamcv_helper.hpp, Change CvSize to cv::Size

Done!

[Solved] sbatch: error: Batch script contains DOS line breaks (\r\n)

When using the school HPC cluster, it is found that the batch task written by win10 reports an error, which can be solved with dos2unix.

Bugs and Solutions

This problem is due to the difference between UNIX and DOS blank line format. Just use code conversion
errors are reported as follows:

sbatch: error: Batch script contains DOS line breaks (\r\n)
sbatch: error: instead of expected UNIX line breaks (\n).

Enter dos2unix:

dos2unix yourfilename

mysqlclient in Ubuntu: How to Solve mysqlclient Install Error

After running pip3 install mysqlclient, the following error occurs:

ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-hmicg9lo/mysqlclient_17bc9786b14e4bff9a8bdcf2c8427558/setup.py'"'"'; __file__='"'"'/tmp/pip-install-hmicg9lo/mysqlclient_17bc9786b14e4bff9a8bdcf2c8427558/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-o3rs50h8/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6/mysqlclient
         cwd: /tmp/pip-install-hmicg9lo/mysqlclient_17bc9786b14e4bff9a8bdcf2c8427558/
    Complete output (46 lines):
    mysql_config --version
    ['5.7.33']
    mysql_config --libs
    ['-L/usr/lib/x86_64-linux-gnu', '-lmysqlclient', '-lpthread', '-lz', '-lm', '-lrt', '-lssl', '-lcrypto', '-ldl']
    mysql_config --cflags
    ['-I/usr/include/mysql']
    ext_options:
      library_dirs: ['/usr/lib/x86_64-linux-gnu']
      libraries: ['mysqlclient', 'pthread', 'm', 'rt', 'dl']
      extra_compile_args: ['-std=c99']
      extra_link_args: []
      include_dirs: ['/usr/include/mysql']
      extra_objects: []
      define_macros: [('version_info', "(2,1,0,'final',0)"), ('__version__', '2.1.0')]
    /usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
      warnings.warn(msg)
    /usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'python_requires'
      warnings.warn(msg)
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/MySQLdb
    copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb
    copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.6/MySQLdb
    copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.6/MySQLdb
    copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.6/MySQLdb
    copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.6/MySQLdb
    copying MySQLdb/release.py -> build/lib.linux-x86_64-3.6/MySQLdb
    copying MySQLdb/times.py -> build/lib.linux-x86_64-3.6/MySQLdb
    creating build/lib.linux-x86_64-3.6/MySQLdb/constants
    copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
    copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
    copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
    copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
    copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
    copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants
    running build_ext
    building 'MySQLdb._mysql' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/MySQLdb
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(2,1,0,'final',0) -D__version__=2.1.0 -I/usr/include/mysql -I/usr/include/python3.6m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o -std=c99
    MySQLdb/_mysql.c:46:20: fatal error: Python.h: No such file or directory
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-hmicg9lo/mysqlclient_17bc9786b14e4bff9a8bdcf2c8427558/setup.py'"'"'; __file__='"'"'/tmp/pip-install-hmicg9lo/mysqlclient_17bc9786b14e4bff9a8bdcf2c8427558/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-o3rs50h8/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6/mysqlclient Check the logs for full command output.

 

Solution:

sudo apt-get install python3.6-dev

It may be due to the mismatch of dev version due to the installation of Python 3.6 in Ubuntu.

How to Solve QT uses MSVC compiler to code error

QT uses MSVC compiler, and the code reports an error

1. Premise

After inspection, it is confirmed that your code is correct, and the error reported by QT creator is a pure false alarm.

2. Error examples

[error] Constants with newlines
[error] xxx is not a member of xxx
[error] Syntax error, missing ;
...

3. Solutions

Add the following configuration in *.Pro file.

win32-msvc*: {
    QMAKE_CFLAGS *= /utf-8
    QMAKE_CXXFLAGS *= /utf-8
}

[Solved] Vscode connect virtual machine error: can’t be established

Record a problem with the vscode connection virtual machine

There is no problem when using vscode to connect the virtual machine for the first time
when returning to school to use campus network connection, set the virtual machine network to bridge mode

after obtaining IP, an error is reported when using vscode to connect:

The authenticity of host '192.168.1.106 (192.168.1.106)' can't be established.

Tried to use the command and modify the sshconfig file
SSH – O stricthostkeychecking = no 192.168.0.xxx

Stricthostkeychecking no
userknownhostsfile/dev/null
results are not allowed
the final solution is


Add “remote.SSH.Uselocalserver” on the last side: true

[Solved] Ubuntu Execute uci Error: uci: error while loading shared libraries: lib

Problem description

The following errors occur when testing UCI under Ubuntu

root@virtual-machine:/home//uci# uci 
uci: error while loading shared libraries: libuci.so: cannot open shared object file: No such file or directory

Solution

Modify the/etc/ld.so.conf file, add the/usr/local/lib path at the end of the file, and execute ldconfig to take effect immediately

echo /usr/local/lib >>/etc/ld.so.conf

Testing

Enter UCI again to see the following input

root@virtual-machine:/home/uci# uci 
Usage: uci [<options>] <command> [<arguments>]

Commands:
	batch
	export     [<config>]
	import     [<config>]
	changes    [<config>]
	commit     [<config>]
	add        <config> <section-type>
	add_list   <config>.<section>.<option>=<string>
	del_list   <config>.<section>.<option>=<string>
	show       [<config>[.<section>[.<option>]]]
	get        <config>.<section>[.<option>]
	set        <config>.<section>[.<option>]=<value>
	delete     <config>[.<section>[[.<option>][=<id>]]]
	rename     <config>.<section>[.<option>]=<name>
	revert     <config>[.<section>[.<option>]]
	reorder    <config>.<section>=<position>

Options:
	-c <path>  set the search path for config files (default: /etc/config)
	-d <str>   set the delimiter for list values in uci show
	-f <file>  use <file> as input instead of stdin
	-m         when importing, merge data into an existing package
	-n         name unnamed sections on export (default)
	-N         don't name unnamed sections
	-p <path>  add a search path for config change files
	-P <path>  add a search path for config change files and use as default
	-t <path>  set save path for config change files
	-q         quiet mode (don't print error messages)
	-s         force strict mode (stop on parser errors, default)
	-S         disable strict mode
	-X         do not use extended syntax on 'show'

[Solved] An unexpected error has occurred. Conda has prepared the above report.

Problem Description:

Error when using CONDA to create a virtual environment:

An unexpected error has occurred. Conda has prepared the above report. 

Solution:

Method (1): delete the .Condarc file

Method (2): CONDA clean - I

Method (3): after closing your VPN, restart your computer and continue to install the virtual environment

VMware: vmw_ ioctl_ Command error invalid parameter [How to Solve]

(1) First, run: roscore & rosrun gazebo_ros gazebo  Or terminal directly enter: gazebo;

(2) Error reporting: vmw_ioctl_Command error invalid parameter

Solution: write export SVGA in ~ /.Bashrc file_Vgpu10 = 0, i.e.

$ echo "export SVGA_VGPU10=0" >> ~/.bashrc

Then turn off the terminal and re-enter(1), the following may appear:

In this case, turn off the terminal, reopen the terminal and input it several times: gazebo.