跳到主要内容

sAkura-IO

  • 今日
  • 文章
  • 笔记
  • 游记
  • 友链
  • 作品
  • 我的
今日 文章 笔记 友链

sAkura-IO

  • 今日
  • 文章
  • 笔记
  • 游记
  • 友链
  • 作品
  • 我的

sAkura-IO

  • 今日
  • 文章
  • 笔记
  • 游记
  • 友链
  • 作品
  • 我的

sAkura-IO

  • 今日
  • 文章
  • 笔记
  • 游记
  • 友链
  • 作品
  • 我的

Linux新机开荒攻略

2026年9月24日 · 639 字 · 约 2 分钟 · Linux

debian

独显直连会导致kde桌面卡死,开混合模式

换源

sudo nano /etc/apt/sources.list

#deb cdrom:[Debian GNU/Linux 12.11.0 _Bookworm_ - Official amd64 DVD Binary-1 with firmware 20250517-09:52]/ bookworm contrib main non-free-firmware
deb https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
#deb-src https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian-security/ bookworm-security main
#deb-src https://mirrors.aliyun.com/debian-security/ bookworm-security main
deb https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
#deb-src https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib
#deb-src https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib

kde+fcitx5无法打字

sudo apt-get install  fcitx5-frontend-qt5 fcitx5-frontend-gtk2 fcitx5-frontend-gtk3 fcitx5-pinyin fcitx5-chinese-addons fcitx5-chewing fcitx5-module-lua fcitx5-module-lua-common fcitx5-modules unicode-cldr-core 

新建文件在/etc/environment

XIM=fcitx5
XIM_PROGRAM=fcitx5
GTK_IM_MODULE=fcitx5
QT_IM_MODULE=fcitx5
XMODIFIERS=@im=fcitx5
SDL_IM_MODULE=fcitx5
GLFW_IM_MODULE=fcitx5

新建文件~/.pam_environment

export XIM=fcitx5
export XIM_PROGRAM=fcitx5
export GTK_IM_MODULE=fcitx5
export QT_IM_MODULE=fcitx5
export XMODIFIERS=@im=fcitx5
export SDL_IM_MODULE=fcitx5
export GLFW_IM_MODULE=fcitx5

重启电脑

修改默认浏览器

自带的火狐不太好用,推荐EDGE

在开始菜单搜索默认,点进去就可以更改

ssh相关命令

移除过期指纹

ssh-keygen -R 192.168.0.108

获取电脑的公钥

type $env:USERPROFILE\.ssh\id_rsa.pub

放入远程机器:

mkdir -p ~/.ssh
nano ~/.ssh/authorized_keys

linux上可以使用此命令一键部署公钥

ssh-copy-id sakura-io@192.168.0.108

Linux权限相关常用指令

列出所有用户名

cut -d: -f1 /etc/passwd

强制切换到某个用户

sudo su - 用户名

强制切换到某个用户,即使该用户没有home目录

sudo su -s /bin/bash 用户名

查询一个命令(文件)所在的位置

which 命令名
# 或者如果 which 找不到,用这个:
whereis 命令名

查询一个命令(文件)的拥有者

ls -l $(which 命令名)
 
ls -lh 文件名

如果是链接文件,常常是满权限的,但是并不是该文件真实的权限

请深入到真实位置查询

ls -ld 文件名
ls -lh 文件名

修改主机名

sudo hostnamectl set-hostname 主机名

评论

评论

?

还没有评论,来聊两句?