title: "树莓派折腾日记#1"
date: 2020-04-29
tags: ["raspiberry","linux","debian"]
categories: ["raspiberry","linux","debian"]
boot分区下新建文件 ssh 来启用ssh
boot分区编辑config.txt最后一行加上
arm_64bit=1
来启用64位内核
使用 pi raspberry 登陆系统
修改密码并解锁root账户
sudo passwd pi #修改pi的密码
sudo passwd root #修改root的密码
sudo passwd --unlock root #解锁root用户
然后使用root登陆
备份镜像源
cp /etc/apt/sources.list /etc/apt/sources.list.bak
cp /etc/apt/sources.list.d/raspi.list /etc/apt/sources.list.d/raspi.list.bak
修改软件源
sudo nano /etc/apt/sources.list
阿里云地址
deb http://mirrors.aliyun.com/raspbian/raspbian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/raspbian/raspbian/ buster main non-free contrib
Ctrl+O保存,Ctrl+X退出
修改系统源
sudo nano /etc/apt/sources.list.d/raspi.list
还是阿里云
deb http://mirrors.aliyun.com/raspbian/raspbian/ buster main
deb-src http://mirrors.aliyun.com/raspbian/raspbian/ buster main
Ctrl+O保存,Ctrl+X退出
更新软件包
apt-get update && apt-get upgrade -y
apt-get -y install vim #先来个vim舒服一下
vi ~/.vimrc
启用鼠标
:set mouse-=a
粘贴以下内容
if has('mouse')
set mouse-=a
endif
syntax on
filetype indent on
set showcmd
set showmatch
set incsearch
set syn=cpp
set nu!
set hlsearch
set nobackup
set ruler
colorscheme evening
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set enc=utf-8
set fenc=utf-8
set fencs=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set langmenu=zh_CN.UTF-8
set helplang=cn
保存走你
vi /etc/bash.bashrc
vi ~/.bashrc
找到并注释掉类似于如下内容
if ! [ -n "${SUDO_USER}" -a -n "${SUDO_PS1}" ]; then
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
并在下面添加
PS1="\[\e[37;1m\][\[\e[35;1m\]\u\[\e[32;1m\]@\[\e[34;1m\]\h \[\e[31;1m\]\w \[\e[33;1m\]\t\[\e[37;1m\]]\[\e[32;1m\]\$\[\e[m\]"
保存走你
source /etc/bash.bashrc
source ~/.bashrc
来个系统信息查看
apt-get -y install screenfetch
screenfetch
基础完毕 enjoy :)
Q.E.D.