my cheat sheet on Alpine Linux /w Debian

Home

1 Alpine Linux

Try: wiki.aplinelinux.org for documentation. Here is a smatterin:

1.1 network.

https://wiki.alpinelinux.org/wiki/Configure_Networking

This was the cisco original /etc/network/interfaces file

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
       hostname localhost

I will change this to use a static ip address as follows:


1.2 Restart Network

After making those change restart your network:

  • /etc/init.d/networking restart
  • sudo ifup eth0 also worked.

2 Alpine tips

  • cat /etc/alpine-release shows me the CML alpine image is at 3.12
  • cat /etc/os-release shows me stuff like:
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.12.7
PRETTY_NAME="Alpine Linux v3.12"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"

It turns out that with version 3.12, the interfaces file requires the netmask options and not the x.x.x.x/24 option when configuring an ethernet interface.

3 Alpine Package Management, apk

Lots of beginner info on the wiki.alpinelinux.org site.

  • apk --help
  • sudo apk add ansible vim
  • sudo apk update # updates repositories
  • sudo apk search package
  • sudo apk version -l # list installed packages
  • sudo apk upgrade -U -a # upgrades all packages

3.1 Add the community respository

 cat > /etc/apk/repositories << EOF; $(echo)
 http://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/main
 http://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/community
 EOF

apk update

3.2 Adding bash to Alpine Linux

The shell used in Alpine Linux is a small version of sh, called "ash" If you really must you can install bash by following this cyberciti.biz link.

3.3 Home