私的AI研究会 > Raspbian覚書2
Raspberry Pi をモニター・キーボード・マウスなどの接続なしで、電源のみをつないでセットアップする手順。
wpa_supplicant.conf country=JP ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="SSID名" psk="暗号化キー" }
C:\>for /l %i in (0,1,255) do ping -w 1 -n 1 192.168.0.%iしばらくして終了したら
c:\>arp -a : 192.168.0.14 dc-a6-32-71-af-e7 動的 :b8-27 または dc-a6 で始まるアドレスが RaspberryPi。
$ sudo raspi-config
$ sudo vi /etc/apt/sources.list変更前→
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi変更後→
deb http://ftp.jaist.ac.jp/raspbian buster main contrib non-free rpi # deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
$ sudo apt update $ sudo apt upgrade $ sudo apt autoremove再確認
$ sudo apt update ヒット:1 http://ftp.jaist.ac.jp/raspbian buster InRelease ヒット:2 http://archive.raspberrypi.org/debian buster InRelease パッケージリストを読み込んでいます... 完了 依存関係ツリーを作成しています 状態情報を読み取っています... 完了 パッケージはすべて最新です。
$ vi ~/.vimrc set nocompatible set backspace=indent,eol,start
$ vi ~/.vimrc set nocompatible set backspace=indent,eol,start set number set expandtab set tabstop=4 set shiftwidth=4 set autoindent syntax on
pi@raspberrypi-ml:~ $ sudo ln -s ~/.vimrc /root/.vimrc pi@raspberrypi-ml:~ $ sudo ls -la /root 合計 24 drwx------ 4 root root 4096 3月 19 05:34 . drwxr-xr-x 21 root root 4096 3月 19 04:49 .. -rw-r--r-- 1 root root 570 9月 9 2019 .bashrc drwx------ 2 root root 4096 9月 26 09:13 .cache -rw-r--r-- 1 root root 148 9月 9 2019 .profile lrwxrwxrwx 1 root root 15 3月 19 05:34 .vimrc -> /home/pi/.vimrc drwx------ 3 root root 4096 3月 17 15:37 .vnc
$ sudo apt-get install vim
$ sudo apt install tightvncserver
$ netstat -nlt
$ cd /etc/init.d/ $ sudo vi vncboot #! /bin/sh ### BEGIN INIT INFO # Provides: vncboot # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start VNC Server at boot time # Description: Start VNC Server at boot time. ### END INIT INFO # /etc/init.d/vncboot USER=pi HOME=/home/pi export USER HOME case "$1" in start) echo "Starting VNC Server" #Insert your favoured settings for a VNC session su $USER -c '/usr/bin/vncserver :1 -geometry 1280x720 -depth 24' ;; stop) echo "Stopping VNC Server" su $USER -c '/usr/bin/vncserver -kill :1' ;; *) echo "Usage: /etc/init.d/vncboot {start|stop}" exit 1 ;; esac exit 0
$ cd /etc/init.d/ $ sudo chmod 755 vncboot $ sudo update-rc.d vncboot defaults
$ sudo vi /etc/xdg/lxsession/LXDE-pi/autostart @xset s off @xset -dpms @xset s noblank
$ sudo vi /etc/lightdm/lightdm.conf [SeatDefaults] xserver-command=X -s 0 -dpms
$ sudo apt-get install autocutsel
$ sudo vi .vnc/xstartup # Fix to make GNOME work #vncconfig & autocutsel -fork export XKL_XMODMAP_DISABLE=1 /etc/X11/Xsession
$ vncserver -kill :1 Killing Xtightvnc process ID 539 $ tightvncserver New 'X' desktop is raspberrypi-ml:1 Starting applications specified in /home/pi/.vnc/xstartup Log file is /home/pi/.vnc/raspberrypi-ml:1.log
$ sudo apt-get update : $ sudo apt-get install -y fonts-noto
$ sudo reboot
$ sudo apt-get update : $ sudo apt-get install -y ibus-mozc
※ ここまでのイメージファイル << raspbian_buster_2020_0527_base.img >>