更新时间 ------- 2023 05 18
目录
开启风扇及开机自启动
# Working Once xxx = [0, 255]
sudo sh -c 'echo xxx > sys/devices/pwm-fan/target_pwm'
# Working Forever
sudo vim /etc/rc.local
#Add Below Codes
#!/bin/bash
sleep 10
sudo /usr/bin/jetson_clocks
sudo sh -c 'echo xxx > sys/devices/pwm-fan/target_pwm'
# Set Permission
sudo chmod 777 /etc/rc.local
安装 jtop 失败
# Try below command instead of sudo pip install jetson-stats
sudo -H pip install -U jetson-stats
sudo systemctl restart jtop.service
# Open an new Bash before using jtop
使用 SDK Manager 安装 SDK Components 报错
报错内容: “http://ports.ubuntu.com/ubuntu-ports bionic-security InRelease” 的签名不再生效
更换镜像源
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo gedit /etc/apt/sources.list
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-proposed main restricted universe multiverse
终端 SSH 连接速度慢
sudo vim /etc/ssh/sshd_config
UseDNS no # DNS反向解析关闭
systemctl restart sshd #重启SSH服务
SSH 连接失败
# Realize SSH Connection
sudo apt install openssh-server
# The openssh-client has been installed after Ubuntu system installed.
sudo apt install ssh
# On the other PC, use below commands.
# ssh username@ip -y
Ubuntu 中 Nvidia 驱动安装失败
# Uninstall Drivers
sudo apt-get remove nvidia-*
sudo apt-get autoremove
sudo apt-get purge nvidia*
# Add PPA_Package and Update
sudo add-apt-repository ppa:graphics-drivers
sudo apt-get update
# Find Fit Drivers
ubuntu-drivers devices
# Install Drivers
sudo apt-get install nvidia-driver-440 nvidia-settings nvidia-prime
eth0 设置静态 IP
# vim File
sudo vim /etc/network/interfaces
# Add Below Codes
auto eth0
iface eth0 inet static
address 192.168.137.200
netmask 255.255.255.0
gateway 192.168.137.1
# Restart Network
service networking restart
# Check eth0
ifconfig
Ubuntu 虚拟机安装 VmwareTools
sudo apt-get autoremove open-vm-tools
sudo apt-get install open-vm-tools-desktop
sudo reboot
TorchVision0.9.0 导入后报错
python版本太低导致,需要将python版本升级到3.7以上,或者通过Pillow降级
sudo pip3 install pillow==8.4.0
Archiconda ( Anaconda 的替代)
由于Jetson系列系统架构为Arm64,Anaconda无法在Nano上正常使用,Archiconda(Github下载地址)能够解决此问题。
# Download .sh File
wget https://github.com/Archiconda/build-tools/releases/download/0.2.3/Archiconda3-0.2.3-Linux-aarch64.sh
# Set Permission
sudo chmod 755 Archiconda3-0.2.3-Linux-aarch64.sh
# Install .sh File
./Archiconda3-0.2.3-Linux-aarch64.sh
source ~/.bashrc
# Basic Usage
conda create -n EnvName python=3.7
conda activate EnvName
Miniforge ( Anaconda 的替代)
由于Jetson系列系统架构为Arm64,Anaconda无法在Nano上正常使用,Miniforge(Github下载地址)能够解决此问题。
# Download .sh File
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-aarch64.sh
# Install .sh File
bash Miniforge3-Linux-aarch64.sh
source ~/.bashrc
# Change Source
# 中科大
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
# 清华
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
# Basic Usage
conda env list
conda create -n EnvName python=3.7
conda activate EnvName
conda deactivate
修改 python(2)(3) 指向路径
在安装Miniforge后,Jetson系统默认的python链路将被修改,导致原来安装的package无法使用,现恢复默认链路
# Show python version
python3 --version
# Show python Path
which python3
# Show all python Path
whereis python3
# Delete Old pythonPathFile
sudo rm /usr/bin/python3
# Build New pythonPathFile
sudo ln -s /usr/bin/python3.6 /usr/bin/python3
# Add EnvPath into ~/.bashrc
# ~/.bashrc 针对当前用户永久有效 source后立即生效
# /etc/profile 针对所有用户永久有效 reboot生效
# /etc/environment 针对所有用户永久有效 reboot生效
vim ~/.bashrc
export PATH=/usr/bin:$PATH
source ~/.bashrc
# Check python Path
which python3
修改 pip(2)(3) 默认安装路径
# Show pip Install_Path
python -m site
# Show site.py File_Path
python -m site -help
# Add Install_Path: USER_SITE and USER_BASE to site.py
# USER_BASE: '/home/nonnettawu/.local'
# USER_SITE: '/home/nonnettawu/.local/lib/python3.6/site-packages'
sudo vim */*/site.py
# Check pip Install_Path
python -m site
OpenCV 升级问题
pip3 install opencv-python #仅针对Python3有效但不稳定,会造成“code-dump”错误
sudo apt install python3-opencv #导致 OpenCV 版本降为 3.2.0
#建议不要对OpenCV做任何不必要的改动
ufw 防火墙问题
sudo apt install ufw
sudo ufw status
> Status:inactive (关闭状态)
> Status:active (开启状态)
# 开启/关闭防火墙
sudo ufw enable
sudo ufw disable
# 外来访问默认允许/拒绝
sudo ufw default allow/deny
# 允许/拒绝 访问 20 端口
sudo ufw allow/deny 20
# 删除之前定义的规则
sudo ufw delete allow/deny 20
Ubuntu 服务器自动休眠问题
# 查看自动休眠状态
sudo systemctl status sleep.target
# 关闭自动休眠
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
共享网络 ping 不通网站
sudo systemctl stop NetworkManager
sudo systemctl disable NetworkManager
sudo systemctl mask NetworkManager
# vim File
sudo vim /etc/resolv.conf
# Add Below Codes
nameserver 8.8.8.8
# Back
sudo systemctl unmask NetworkManager
sudo systemctl enable NetworkManager
sudo systemctl start NetworkManager