Difference between revisions of "Alpine Linux"

From Indie IT Wiki
 
(2 intermediate revisions by the same user not shown)
Line 11: Line 11:
 
== Networking ==
 
== Networking ==
  
 +
 +
 +
=== Fix SSH Failure ===
 +
 +
If you enable root login and see this error...
 +
 +
ssh root@192.168.0.106
 +
Received disconnect from 192.168.0.106 port 22:2: Too many authentication failures
 +
Disconnected from 192.168.0.106 port 22
 +
 +
Then instruct ssh to only use the authentication identity files specified on the command line...
 +
 +
ssh -o IdentitiesOnly=yes root@192.168.0.106
  
 
== Fonts ==
 
== Fonts ==
Line 82: Line 95:
  
 
  apk -U upgrade
 
  apk -U upgrade
 +
 +
== Change to BASH shell ==
 +
 +
apk add bash
 +
nano /etc/passwd
 +
 +
https://wiki.alpinelinux.org/wiki/Change_default_shell
 +
 +
https://www.cyberciti.biz/faq/alpine-linux-install-bash-using-apk-command/
  
 
== Docker ==
 
== Docker ==
Line 96: Line 118:
 
Install Docker...
 
Install Docker...
  
  apk add docker
+
  apk add docker docker-compose docker-compose-bash-completion
  
 
Add Docker to the boot process...
 
Add Docker to the boot process...

Latest revision as of 11:24, 10 August 2021

Introduction

Alpine Linux is an independent, non-commercial, general purpose Linux distribution designed for power users who appreciate security, simplicity and resource efficiency. A minimal installation to disk requires only 130MB of storage. It is used in the majority of Docker container images and installs only about 8MB of operating system software.

https://alpinelinux.org/about

Installation

https://wiki.alpinelinux.org/wiki/Alpine_newbie_install_manual

Networking

Fix SSH Failure

If you enable root login and see this error...

ssh root@192.168.0.106
Received disconnect from 192.168.0.106 port 22:2: Too many authentication failures
Disconnected from 192.168.0.106 port 22

Then instruct ssh to only use the authentication identity files specified on the command line...

ssh -o IdentitiesOnly=yes root@192.168.0.106

Fonts

To set a large font on the console command line...

apk add terminus-font
setfont /usr/share/consolefonts/ter-132n.psf.gz
nano /etc/conf.d/consolefont
rc-update add consolefont boot
reboot

https://www.reddit.com/r/AlpineLinux/comments/oipp89/set_larger_console_font_size_on_raspberry_pi/

https://www.reddit.com/r/AlpineLinux/comments/evujhq/console_font/

Downloads

Raspberry Pi

OK, so ignore the instructions and don't use the latest version!

Download version 3.13 for RPi4...

wget https://dl-cdn.alpinelinux.org/alpine/v3.13/releases/aarch64/alpine-rpi-3.13.0-aarch64.tar.gz

Partition your SD card...

Device     Boot  Start      End  Sectors  Size Id Type
/dev/sda1  *      2048   503807   501760  245M  c W95 FAT32 (LBA)
/dev/sda2       503808 15548415 15044608  7.2G 83 Linux

Add the usercfg.txt tweaks...

mount /dev/sda1 /mnt/usb/
nano /mnt/usb/usercfg.txt

disable_overscan=1
enable_uart=1

Boot first time, log in as root with no password and run...

setup-alpine

Setup keyboard, wireless, timezone, hostname, etc. then run...

setup-disk

Choose to unmount /dev/mmcblk0 and then choose 'sys' install method using 'mmcblk0' and wipe and install.

reboot

Done.

Tutorials and Howtos for Raspberry_Pi

Diskless Install Mode on Raspberry Pi

Classic Install Mode on Raspberry Pi

Package Management

apk update
apk search packagename
apk add packagename
apk policy packagename

https://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management

System Upgrade

apk -U upgrade

Change to BASH shell

apk add bash
nano /etc/passwd

https://wiki.alpinelinux.org/wiki/Change_default_shell

https://www.cyberciti.biz/faq/alpine-linux-install-bash-using-apk-command/

Docker

Enable the 'community' repository in /etc/apk/repositories

http://dl-cdn.alpinelinux.org/alpine/v3.13/main
http://dl-cdn.alpinelinux.org/alpine/v3.13/community

Update the package list...

apk update

Install Docker...

apk add docker docker-compose docker-compose-bash-completion

Add Docker to the boot process...

rc-update add docker boot
service docker start

...done!

https://wiki.alpinelinux.org/wiki/Docker

Information

Alpine boot process on the Raspberry Pi