玩命加载中 . . .

Ubuntu常见问题


bash 和 zsh 切换

chsh -s /bin/bash
chsh -s /bin/zsh

tar解压

单个文件

tar -zxvf ***.tar.gz

多个文件

ls model.tar.g* | xargs -n1 tar xzvf

Python

Python位置

# kavin @ ubuntu in /usr/lib
$ ls -d python*
python2.7  python3  python3.6  python3.7  python3.8
# kavin @ ubuntu in /usr/bin
$ ls python*
python            python2-config  python3.6-config   python3m
python2           python2-qr      python3.6m         python3m-config
python2.7         python3         python3.6m-config  python-config
python2.7-config  python3.6       python3-config

pip 出错

requests.exceptions.InvalidSchema: Missing dependencies for SOCKS support.

解决方法

unset all_proxy && unset ALL_PROXY
printenv | grep all_proxy
没有输出即可

pip3 install —user

功能包会被安装在~/.local/lib/python3.6/site-packages

# kavin @ ubuntu in ~/.local/lib/python3.6/site-packages
$ ls
em.py                       numpy                     pyparsing-2.4.7.dist-info
empy-3.3.4.dist-info        numpy-1.19.5.dist-info    pyparsing.py
jinja2                      numpy.libs                toml
Jinja2-3.0.1.dist-info      packaging                 toml-0.10.2.dist-info
markupsafe                  packaging-20.9.dist-info
MarkupSafe-2.0.1.dist-info  __pycache__

添加环境变量

错误方式

vim ~/.zshrc
export PKG_CONFIG_PATH=~/Library/opencv-3.3.1/build/installed/lib/

$ export | grep LD_LIBRARY_PATH
LD_LIBRARY_PATH=/home/kavin/Library/opencv-3.3.1/build/installed/lib

原来的LD_LIBRARY_PATH会被覆盖

正确方式

vim ~/.zshrc
export LD_LIBRARY_PATH=~/Library/opencv-3.3.1/build/installed/lib:$LD_LIBRARY_PATH

$ export | grep LD_LIBRARY_PATH
LD_LIBRARY_PATH=/home/kavin/Library/opencv-3.3.1/build/installed/lib
:/home/kavin/ROSProjects/Prometheus/devel/lib
:/opt/ros/melodic/lib

文章作者: kunpeng
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 kunpeng !
  目录