1. Regarding the motivation of Raspberry Pi, as I wrote at the end of an article before, after discovering that ipv6 can be used as a reverse proxy and that Raspberry Pi can install Ubuntu 14.04, I was originally just interested in the tree. The Berry Pi was immediately on the purchase agenda. Purchase Raspberry Pi, case and heat sink I bought a Raspberry Pi 2B with a case and heat sink. The HDMI to DVI conversion interface is because the monitor does not support HDMI, and considering that the more popular HDMI to VGA converts from digital signals to analog signals, the conversion interface is implemented internally with a chip, and for the Raspberry Pi, there is no choice for the HDMI to VGA port. There is an endless debate about source or active; therefore, converting HDMI directly to DVI does not require chip conversion, which is much more reliable and convenient. Note that there are also many models of DVI ports, and pay attention to the support of the monitor. Power supply Regarding the power supply issue, I happened to have a 1.5A power adapter from SONY, so I used it directly. However, the instructions in the Raspberry Pi I received stated that the power supply is required to be greater than 1.8A, but since I don’t use the USB port much, the 1.5A Raspberry Pi runs pretty well. MicroSD card microSD card is a pitfall. I first searched for what kind of memory card the Raspberry Pi should use. When I saw someone saying it was a full-size SD card, I decided to just use an idle SD card. Class 10 should be enough. After receiving the goods, when I was about to insert the card, I realized that I needed a microSD card. I really don’t know who said it was a full-size SD card. So I placed another order and waited for a day to receive the microSD card and card reader. Because the USB HUB itself is designed to be used as a mini server, I bought a USB HUB with a power supply to drive a mobile hard disk. 2. Install Ubuntu 14.04 LTS. To install Ubuntu 14.04, completely follow the steps in the Ubuntu wiki. Download and write the image according to the address provided in the wiki. After downloading, unzip the .img for writing. Write to the microSD card to install the official software and steps provided by Raspberry Pi. Insert the microSD card into the card reader and then into the computer; open Win32DiskImager, select the .img image you just decompressed, select the drive letter of the microSD card, and then write. Install and set up Ubuntu. Note that this Ubuntu image does not include openssh, so it must be directly connected to the Raspberry Pi. Plug in the keyboard, connect the monitor, and then connect the power supply, and the Raspberry Pi starts working. After Ubuntu starts, the login username and password are both ubuntu. Opening the root account For Ubuntu that requires a lot of trouble, it will be much more convenient to directly use the root account. sudo passwd root and then enter the current user's password, which is ubuntu; then enter the new password of root twice. su root Enter the root password to enter the root account. Use all partition space At this time, Ubuntu does not use all the SD card space and needs to be set manually. 1fdisk /dev/mmcblk0 Delete the second partition: Press d, then press 2 to rebuild the second partition: Press n, then p, then 2, then enter, then enter, then w and then restart Ubuntu1reboot enter resize2fs /dev /mmcblk0p2 so that Ubuntu uses all the SD card space. This is a necessary step to update the source. apt-get updateapt-get upgrade Set SWAP. Ubuntu itself does not have SWAP and needs to be created manually. However, there is a software that automatically completes the SWAP setting. This software will set up a SWAP partition twice the size of RAM by default. , so a 2G SWAP partition will be generated in the Raspberry Pi. After apt-get install dphys-swapfile is installed and set up, SWAP is set up.
This is a must-have when installing an SSH server. Allow SSH access apt-get install openssh-server. This means that even if the initial setup is completed, because this image is equivalent to the smallest image of Ubuntu, many software or dependencies are not installed, so there may be many apt -get install will install a lot of dependencies incidentally.