Difference between revisions of "Alpine Linux"

From Indie IT Wiki
(Created page with "== Introduction == Alpine Linux is an independent, non-commercial, general purpose Linux distribution designed for power users who appreciate security, simplicity and resourc...")
 
 
(14 intermediate revisions by the same user not shown)
Line 6: Line 6:
  
 
== Installation ==
 
== 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 ===
 
=== Downloads ===
Line 11: Line 43:
 
=== Raspberry Pi ===
 
=== Raspberry Pi ===
  
https://wiki.alpinelinux.org/wiki/Classic_install_or_sys_mode_on_Raspberry_Pi
+
OK, so ignore the instructions and don't use the latest version!
 +
 
 +
Download version 3.13 for RPi4...
 +
 
 +
wget <nowiki>https://dl-cdn.alpinelinux.org/alpine/v3.13/releases/aarch64/alpine-rpi-3.13.0-aarch64.tar.gz</nowiki>
 +
 
 +
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.
 +
 
 +
[https://wiki.alpinelinux.org/wiki/Tutorials_and_Howtos#Raspberry_Pi Tutorials and Howtos for Raspberry_Pi]
 +
 
 +
[https://wiki.alpinelinux.org/wiki/Raspberry_Pi Diskless Install Mode on Raspberry Pi]
 +
 
 +
[https://wiki.alpinelinux.org/wiki/Classic_install_or_sys_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 <code>/etc/apk/repositories</code>
 +
 
 +
<nowiki>http://dl-cdn.alpinelinux.org/alpine/v3.13/main</nowiki>
 +
<nowiki>http://dl-cdn.alpinelinux.org/alpine/v3.13/community</nowiki>
 +
 
 +
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 ==
 +
 
 +
[https://pi3g.com/2019/01/10/alpine-boot-process-on-the-raspberry-pi/ Alpine boot process on the Raspberry Pi]

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