Debian

apt

apt update #更新软件包元数据
apt upgrade/apt full-upgrade #区别在于是否更新依赖
apt install 
apt remove/apt purge #区别在于是否一同删除配置文件,autoremove则是移除不再需要的依赖软件包
apt search '^regex' 

locale zh_CN.UTF-8

cat /etc/default/locale
sudo dpkg-reconfigure locales #select en_US.UTF-8 and zh_CN.UTF-8

移除ubuntu中的snap

# disable service
sudo systemctl disable snapd.service
sudo systemctl disable snapd.socket
sudo systemctl disable snapd.seeded.service

# remove snap list
sudo snap remove --purge gtk-common-themes
sudo snap remove --purge bare
sudo snap remove --purge core22

sudo apt remove --autoremove snapd
sudo rm -rf /var/cache/snapd/
sudo rm -rf ~/snap

# disable sudo apt update for snap
sudo hx /etc/apt/preferences.d/nosnap.pref
Package: snapd
Pin: release a=*
Pin-Priority: -10

apt mirror(local debian need)

sudo sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
sudo sed -i -e 's|security.debian.org/\? |security.debian.org/debian-security |g' \
            -e 's|security.debian.org|mirrors.ustc.edu.cn|g' \
            -e 's|deb.debian.org/debian-security|mirrors.ustc.edu.cn/debian-security|g' \
            /etc/apt/sources.list

debian in wsl

  1. 配置systemd,以便启动docker后台服务
ps --no-headers -o comm 1
# edit /etc/wsl.conf
[boot]
systemd=true

wsl --shutdown
  1. 禁用bell响铃
# /etc/inputrc
set bell-style none
  1. visudo免除sudo密码输入
sudo visudo # 或sudo hx /etc/sudoers
cat ALL=(ALL) NOPASSWD: ALL

manpages缺少部分pthread函数:如pthread_mutex_lock

sudo apt install glibc-doc
  1. ip 查看或重启
ip addr
ip link set eth0 up|down
/etc/network/interfaces
auto enp0s31f6
iface enp0s31f6 inet static
  address 192.168.0.3/24
  broadcast 192.168.0.255
  network 192.168.0.0
  gateway 192.168.0.1