Debian的初始化
Debian是较为常用的GNU/Linux的一个分支,有众多衍生版本,本文也可作为其他Linux系统的参考
一、安装过程
安装时语言应该选英文,否则安装后中文一定会出现乱码,安装软件一定要选择SSH Server,标准系统工具,不建议安装桌面,注意安装的时候换国内源,否则安装会特别慢,并且会导致安装失败
安装完成若找不到启动项,在Bios里手动添加efi
File Browser Add Boot Option -你的设备-EFI - Debian- grub64.efi - 输入名字
二、安装完成
解决运行什么命令都command not find的问题
1 | nano .bashrc |
使修改生效
1 | source .bashrc |
如果安装未选择ssh,可以手动安装
1 | apt install openssh-server |
安装后中文乱码
1 | apt-get install locales |
设置管理员密码
1 | sudo passwd root |
修改用户密码
1 | sudo passwd pi |
允许root登录SSH
1 | nano /etc/ssh/sshd_config |
重启ssh服务生效
1 | sudo systemctl restart ssh |
三、安装软件
如果提示缺少xxx,就访问Debianpkgs搜索缺少的文件就能找出未安装的依赖
一些必要软件
1 | apt-get install sudo curl gnupg net-tools |
安装Python3&GCC
1 | apt-get install python3-pip python3-dev libffi-dev gcc make |
安装带php的apache
1 | apt-get install apache2 php libapache2-mod-php |
安装Webmin管理服务器,参考Linux性能监控
安装ZeroTier,参考内网穿透软件
安装文件服务器,参考搭建文件服务器
安装Syncthing,参考备份软件的使用
配置代理服务器,详见搭建代理服务器
安装Aria2,参考Aria2的使用
配置自定义的服务,参考Linux配置服务
配置定时任务,参考Linux配置定时任务
安装Wordpress,参考使用Wordpress建站
搭建Minecraft服务器,参考搭建Minecraft服务器
卸载软件
1 | apt-get purge nginx //apt-get卸载 |
常见命令
查看时间
1 | date |
设置时区
1 | cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime |
给权限
1 | chmod 777 n.sh |
察看文件夹占用
1 | du -h --max-depth=1 |
挂载硬盘
安装硬盘SMART监视工具
1 | apt-get install smartmontools |
查找磁盘:
1 | sudo fdisk -l |
挂载硬盘
1 | mkdir /mnt/disk |
卸载硬盘
1 | umount /dev/sda1 |
开机自动挂载磁盘
1 | blkid /dev/sda3 #查询sda3的UUID |
ACPI相关
合上盖子无操作
1 | nano /etc/systemd/logind.conf |
追加此代码
1 | HandleLidSwitch=ignore |
性能调节器
查看调节器
1 | cat /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor |
调整调节器
1 | echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor //性能模式 |
网络代理
设置代理,详见搭建代理服务器
1 | nano /etc/apt/apt-proxy.conf |
安装ax200驱动
首先添加non-free源
1 | nano /etc/apt/sources.list |
安装并配置iwlwifi
1 | apt update |
Wifi相关
1 | ifconfig -a //查看所有网卡,看有没有wlxxx0 |
扫描wifi
1 | iwlist wlxxx0 scan |
如果出现“Interface doesn’t support scanning : Network is down”,激活网卡
1 | sudo ifconfig wlxxx0 up |
配置interfaces
1 | nano /etc/network/interfaces |
写入下面内容
1 | allow-hotplug wlxxx0 |
wifi配置文件:
1 | nano /etc/wpa_supplicant/wpa_supplicant.conf |
文件内容如下
1 | country=CN |
输入下面的命令生效
1 | ifup wlp6s0 |
扫描热点:
1 | sudo iwlist scan | grep ESSID |
错误排查
修复apt
1 | apt --fix-broken install |
清除cache
1 | echo 2 > /proc/sys/vm/drop_caches |
清除apt缓存
1 | sudo apt-get autoclean |
香橙派相关
连接串口后CH340的串口波特率为115200、8、1、N、N
ubuntu默认帐号和密码orangepi sudo passwd root
设置root密码
armbian默认帐号密码root 1234登陆成功后需要修改密码