nyuuzyou/wikis huggingface dataset:
Include:Upgrading Alpine executeupgradescript

== Execute upgrade script ==
The new media has a 'upgrade' script found on root level on media. This 'upgrade' script needs to be executed and walked through.
You will be informed about various changes and you will be able to choose if you want to keep your old config-files or if you want to use a new.<BR>
Each setup is different, so it's hard to say what needs to be upgraded and what should be kept.
When the new media holds a updated version of configfile, you will be prompted with something that looks like this:<BR>
 Quit, Next, Show diff, Edit new, Zap new, Use new (q/n/s/e/z/u) [s]:
If you choose to 'Edit new' you will use the 'vi' editor.<BR>
A short note on how you use that editor:
* i = Enter "insert" mode so you can edit the content
* [esc] = Enter CMD-mode where you can chose to save/quit
** CMD-mode has these options
*** :w = Write your changes
*** :q = Quit editor
*** :q! = Force quit even if you have changes that is still not saved
category:Package Manager
Include:Upgrading to Edge

An upgrade of Alpine Linux from a stable version to the rolling development version edge basically requires the same steps as Upgrading to latest release. 
The crucial difference is, that when editing the file, all referenced repository versions (such as or ) therein need to be pointing to edge. 
When using edge branch, testing repository can be added if the packages that one needs are available only in testing repository. 
After upgrading to edge, the currently installed edge version may be checked with and referring to the build date that is attached to the release.
Category:Package Manager
Category:Installation
Category:Development
Include:Upgrading to latest release

=== Update Repositories File ===
The Repositories file can be updated using one of the following methods.
==== Using setup-apkrepos script====
Launch the <Code>setup-apkrepos</Code> script: Pressing will open the file to edit using vi editor. Edit the repository lines to reflect the new version number.
==== Using sed command ====
Use a one-line command to edit all version numbers in the file "in place". Here's how you'd change v3.20 to v3.21: 
==== Manual editing of ====
==== Using latest-stable instead of version number====
Manual changes of the version numbers may be avoided for future release upgrades by having the repository lines refer to "latest-stable" instead of an absolute value in the file as follows:
=== Updating package lists ===
With the correct repositories file in place, the latest index list of available packages can be obtained with:
=== Upgrading packages ===
At times it is required to first upgrade just the Alpine Linux Package Manager itself to the latest available version, before upgrading any other package. This was the case, for example, when upgrading from a version of Alpine before 2.3.0_rc1. But simply always doing so shouldn't hurt, either:
Next, to upgrade all installed packages:
The --available switch is used to force all packages to be upgraded, even if they have the same version numbers. Sometimes changes in musl require doing this.
Initramfs init

mkinitfs is a tool to create initramfs images. Initramfs images are small images which contain a small filesystem with everything required to boot Alpine. For example, when booting a setup with full disk encryption, the initramfs contains the binaries required to prompt for a password and mount the encrypted disk.
== Usage ==
Under a running alpine machine, the following command can be used if for some reason the initramfs has not been created properly for a new kernel. 
 
The script is located in and is created with ash. It expects to be populated with the <kernelvers> listed. For variations on this command (e.g. for chroot) Search "mkinitfs".
== initramfs init cmdline options ==
In addition to the kernel boot parameters are a number of parameters that the init script understands. These are documented in the mkinitfs-bootparam(7) man page.
Depending on your HDD type and filesystem used, the file appears as follows:
Although you may specify your own init script when building an initramfs, these parameters allow for extensive control over the initial startup of an Alpine Linux system.
== Troubleshooting ==
To troubleshoot booting issues, when using grub, replace quiet with debug_init single in the boot command line.
== See Also ==
* PostmarketOS Wiki
* ArchWiki boot process
 
category:Kernel
Category:Booting
Inotifyd

== Use case ==
Sometimes we need to monitor a directory (or file) and do some post processing/actions. Instead of polling the directory for changes we can use inotify to watch a specific folder or file and be notified if something happens within its context. While there are tools in aports designed around inotify (inotify-tools) alpine has a build in tool called inotifyd (part of busybox) to execute a command on file system events. Below is an example of how you can setup a watch folder with just base alpine (busybox and openrc).
== Create an OpenRC service script ==
== Finishing up ==
Starting inotifyd:
Now copy some file into the watch folder and check the service log in .
In the example above we only listen for file closed events (w). In case you want to listen to more events you can just add them after each other. In case you want to listen to all of them you simply remove all appending event letters from the directory.
== Possible inotify Events ==
Events:
 a File is accessed
 c File is modified
 e Metadata changed
 w Writable file is closed
 0 Unwritable file is closed
 r File is opened
 D File is deleted
 M File is moved
 u Backing fs is unmounted
 o Event queue overflowed
 x File can't be watched anymore
If watching a directory:
 y Subfile is moved into dir
 m Subfile is moved out of dir
 n Subfile is created
 d Subfile is deleted
Category:Monitoring
Install Alpine in QEMU

===Before You Start===
* Download the latest Alpine image.
* Install QEMU on your system (e.g. sudo apt install qemu on Ubuntu, yum -y install qemu on Fedora)
If you are using Alpine Linux, you can install:
===Create the Virtual Machine===
Create a disk image if you want to install Alpine Linux.
The following command starts QEMU with the Alpine ISO image as CDROM, the default network configuration, 512MB RAM, the disk image that was created in the previous step, and CDROM as the boot device.
Log in as root (no password) and run: 
Follow the setup-alpine installation steps.
Run poweroff to shut down the machine.
=== Booting the Virtual Machine ===
After the installation, QEMU can be started from disk image (-boot c) without CDROM.
Category:Virtualization
Install Alpine on LXC

== LXC ==
LXC is an operating-system-level virtualization method for running multiple isolated Linux systems (containers) on a control host using a single Linux kernel.
With LXC you can run Alpine Linux on container and start services in it using native Alpine Linux' init system (openrc).
This is instruction on how to install Alpine Linux on LXC container.
== Preparation ==
=== LXC installation ===
You have to install "lxc" package on your host system. For example, in Arch Linux you can install it by running:
=== Bridge creation ===
You also have to create network bridge on your host.
Setting up bridge in Arch Linux or Arch Linux based systems
Setting up bridge in Ubuntu or Ubuntu based systems
Here is example, how to setup bridge with netctl:
Copy sample file "bridge"
Modify your bridge configuration file as needed (network interfaces: eno1 and tap0 are, of cource, according to your needs)
Stop active connection
Start your bridge	
Perhaps you may wish to setup your system to start your bridge automatically at boot time.
== Container creation ==
To install Alpine Linux edge version run:
You can also configure shared directory which will be accessible from both host and container. In this example we make host's /media/d directory available in container
Add the following lines to the container's configuration file:
Booting container:
Shutting down container:
Going to Alpine Linux console:
== Container setup ==
Modify your apk/repositories configuration file. It is recommended to include "main", "testing" and "community" repositories.
Upgrading your Alpine Linux system:
Starting services:
or
Adding services to autostart
Restarting your container:
Category:Virtualization
Install Alpine on LXD

== LXD ==
LXD is an easy to use daemon and client for managing LXC containers. It is included by default in Ubuntu 16.04 and later versions. It may become available in other distributions, such as debian. If you are not familiar at all with LXC or LXD, start directly with LXD. For detailed instructions on how to use it, see https://linuxcontainers.org/lxd/introduction/
With LXD you can start an Alpine Linux container in seconds, in practically any Ubuntu 16.04 (or later) system, including:
* A standalone system
* An Amazon EC2 instance
* An OpenStack KVM VPS
With LXD, you can easily run Alpine in all those environments, on top of an Ubuntu Host.
These instructions assume you are running on an amd64 (x86_64) platform.
== LXD installation ==
On Ubuntu 18.04 there are two versions of LXD available:
* From apt packages, included by default on a new installation
* From snap. The snap version of LXD has a higher version and more features than the apt version. Future versions of LXD will be distributed only via snap.
If you want to use the latest LXD, remove the apt version and install the snap version:
Add yourself to the lxd group, so you can run lxc without being root:
Then logout and login again.
== LXD configuration ==
Before you launch LXD containers, you must configure LXD:
Accept all the defaults. You can rerun this if you have no containers.
The ZFS storage method is recommended, because of its ability to create instant snapshots and copies of containers, but it requires additional configuration and it is not available everywhere (e.g. in a VPS host). dir will do just fine for a demo.
== Container creation ==
To install Alpine Linux 3.8 run:
To install Alpine Linux edge version run:
To enter a shell in the container:
== Networking ==
The container has outgoing access to the network, but no incoming public access, since it doesn't have a public ip. You can provide incoming access using several networking techniques:
* On a LAN, it suffices to add a route through the host LXD node
* Use an iptables configurator, such as shorewall
* For HTTP/HTTPS access, use an HTTP reverse proxy/load balancer, such as haproxy or pound, to redirect HTTP requests to various containers. You can run the HTTP reverse proxy in an Alpine container, once you redirect the ports that you want to it, (using iptables).
Category:Virtualization
Install Alpine on VMware ESXi

= Preparation =
This Guide assumes you are using the latest (as of this writing, ESXi 6.7) host client on a free install of ESXi, not the VSphere client. Options may be slightly different for that client.
== Download Alpine and upload to a reachable Datastore ==
For this guide, I used the latest Virtual Images, which at the time was, 3.10.2
== Create VM Options ==
# Name: Choose any name you like
# Compatibility: Linux
# Guest OS Version: Select Other 5.x or later Linux (64-bit) if you downloaded the x86_64 Alpine-ISO, or Other 5.x or later Linux (32-bit) if you downloaded the x86 Alpine-ISO.
== Edit VM Settings once Created ==
The default alpine linux iso images only boot from bios, not the ESXi default of UEFI for Linux 4.0+ hosts. To get around this limitation, you have three options:
# Change the VM to use Bios Boot
## Make sure the VM is powered off. (If it is on, you will not be able to change boot options, and your save will fail.)
## Right click on the VM, and select Edit Settings
## Select VM Options
## Under Boot Options > Firmware, select bios
## Click save.
# You could create a new ISO image following the Create UEFI secureboot USB guide (outside the scope of this guide)
# You can change the VM Compatability options to Other Linux (64-bit) but you loose the VMXNET and SR-IOV Passthrough NIC options (helpful for a virtualized firewall) and are limited to the E1000 NIC driver which has been known to drop network connectivity.
= Installation =
Install Alpine Linux. I used the default setup-alpine script 
= Post-Install =
== Install and enable Open-VM-Tools ==
# Enable the Community repo
using root/sudo/wheel privileges, edit /etc/apk/repos and un-comment the community repo
# Install 
# Start, and enable at boot. As of this writing the open-rc scripts are included in the base open-vm-tools package instead of a separate -openrc package.
category:Virtualization
Install Alpine on VMware Workstation

There's at least 2 ways you can setup Alpine on a VMware box.
== Option 1: sys mode, traditional hard-disk install (preferable for a dev box) ==
# Create a virtual machine (Linux, other 3.x kernel 64 bit)
## Add a hard drive with your desired size
## Add a CD/DVD to the VM that points to the Alpine ISO you downloaded
## Disable "UEFI secure boot" in Settings -> Advanced
# Boot the VM and log in with username "root"
## run setup-alpine
## choose sys when asked about the disk mode (sys mode will install Alpine to the disk)
## choose the default hard disk mounted by VMware
## reboot after the installation is complete
== Option 2: USB mode, no data preserved between reboots ==
# Create a virtual machine (Linux, other 3.x kernel 64 bit)
## add a small hard drive, e.g. 100MB for saving configs (like an usb stick)
## Add a CD/DVD to the VM that points to the Alpine ISO you downloaded
# boot into the VM
# press F2 on boot to enter the BIOS 
## change the boot order so that it boots from CD, then HD, then floppy (or whatever - as long as CD is first)
# boot the machine
# now run the following commands:
## mkfs.vfat /dev/sda
## mount /dev/sda /media/usb (Or try: mount -t vfat /dev/sda /media/usb)
## grep /dev/sda /proc/mounts >> /etc/fstab
## setup-alpine (select no disk, save configs to 'usb')
## lbu ci usb
If the VM hangs at the boot prompt, reboot the VM, and when the boot prompt appears again, type pax_nouderef (i.e. append it to the kernel options) and press Enter. This should allow normal boot-up. 
Now you should be able to reboot and it should retain your settings because they were saved to your "usb-disk".
== VMware Tools ==
More info on this page: Open-vm-tools
For VMware Tools support you need to install the package open-vm-tools.
== Install Alpine on 32-bit vmware virtual machine ==
If you want to install Alpine on 32-bit vmware virtual machine, you need to disable the 3D acceleration function of the vmware virtual machine, otherwise there will be a black screen when loading vmwgfx.
In particular, if you use the virt version of the iso to start a 32-bit vmware virtual machine, the default network card (pcnet32) driver is not included in the system, so you need to modify the vmx file and add:
ethernet0.virtualDev = "e1000"
Category:Virtualization
Install Alpine on a btrfs filesystem with refind as boot manager

This Tutorial is about installing Alpine Linux as a btrfs subvolume Dualbooting with another Linux distribution and uses refind as boot manager. 
The below instructions are based on below partition layout as shown by command. 
 
/dev/nvme0n1p1: UUID="55C3-8AB4" TYPE="vfat"
/dev/nvme0n1p2: UUID="dab64e31-fb89-4364-b90f-b79400f73304" TYPE="swap"
/dev/nvme0n1p3: LABEL="BTRFSVOL" UUID="823a3283-30a7-4fef-b50b-8a2230c71b5b" TYPE="btrfs"
# Complete the Installation until the base configuration step.
# Once base configuration is complete, Identify your partition name and note the LABEL for the btrfs filesystem by using the command. 
# Mount the btrfs partition to /mnt. 
# To create a Btrfs subvolume for Alpine Linux install the package . 
# Create a new Btrfs subvolume for Alpine. 
# Unmount the btrfs partition. 
# Mount the newly created subvolume to /mnt. 
# Install the base system using the below command: 
# This will install the base system to the mounted subvolume. Once the base system is installed, chroot into the new system:
# Check and ensure that uses the correct subvolume for the root entry like below. Mounting the efi partition is optional. If you want to share your @home subvolume between both the operating systems, you can also add an entry for it now. 
# Verify linux kernel is installed successfully. 
# If your other OS is already installed and working with refind as boot manager, then there is no need to install refind again. You may want to remove the grub and grub-efi packages.
# Exit the chroot. 
# Mount the EFI partition to edit the refind.conf file. 
# Edit /mnt/os/boot/efi/EFI/refind/refind.conf to boot alpine by adding an entry for Alpine Linux as shown below: 
# Unmount everything 
# Reboot your system. 
#Now, you should now see an option to boot into Alpine Linux in the rEFInd boot menu.
== See Also ==
* Refind in Arch Wiki
Category:Installation
Install to disk

#REDIRECT Installation
= If using Alpine Linux 2.2.3 or later =
The following is meant to be an absolute newbie guide
* Burn the Alpine ISO image to a CD
* Put the CD into the new computer and turn on the power. Make sure the computer is capable to boot from a CD. Your manual for the computer or the BIOS can help.
* Wait for the text login: to appear, type root and press enter.
* Run the setup-alpine script
** Choose your keyboard layout. If you don't know your keyboard layout choose us. Here us was chosen.
*** Then I chose the us variant.
** Host name, which will be the name of your computer, you can just press enter if you want to use the default name
** Choose your network card, most people can just go with the default (press enter)
*** Most people will use DHCP, so press enter again, or you can enter in your static IP address
*** You will be asked if you want to do any manual network configuration, press enter for no
** Type in your root password twice.
** Choose a time zone, you can get a list by pressing ?. If you want a sub zone, e.g. Africa, type in Africa and press enter, ? will give you a list of sub zones in Africa.
** Press f to choose the fastest mirror.
** Choose an SSH server, this allows you to remotely manage your machine. OpenSSH is what the big distro's use, Dropbear is a tiny SSH replacement. Choose none for best security.
** Choose an NTP client, this keeps your machine's time accurate using an Internet time server. Openntpd is what the big distro's use, while Chrony is a tiny replacement.
** Choose a disk you want to install Alpine onto, as an example, sda is the first disk in your computer.
*** Now choose how you would like to use it, for this guide, choose sys, this will install the entire OS onto your hard drive
*** You are given a final chance to back out, type in Y to continue
* The installation is now complete and you will be asked to reboot. Type in reboot and press enter
Take out the CD, and your computer should boot into Alpine using your hard drive.
=== Continue Setting up your Computer ===
* Alpine Linux package management (How to add/remove packages on your Alpine)
* OpenRC (Configure a service to automatically boot at next reboot)
* Setting up a SSH server (Using ssh is a good way to administer your box remotely)
* Tutorials and Howtos (Various tutorials, including how to setup a XFCE desktop)
Category:Installation
Installation pages setup-disk script alpine main single

===== Setup Disk =====
This will setup the destination usage of the files
====== Witch disk choose to use? ======
To choose the disk destination .. commonly sda are the hard disk cos sdb the USB boot or CD/DVD image
====== How would be used? ======
Then choose type of installation .. those are described at Setup modes section at Alpine setup scripts wiki page. "sys" mode is the familiar install to disk well knowed for usage as main OS to computers.
After all a confirmation question will raised, type "y" if everything are ok and the setup will proceed to erase, format and copy the files to the destination disk choose!
Installing Alpine in a virtual machine

This page will walk you through how to setup a virtual machine for AlpineLinux installation
= VirtualBox =
This guide describes a standard install of Alpine within a Virtual Box VM. (virtual machine)
Oracle VM VirtualBox runs one or more virtual x86 or x64 guests on a host computer.<BR>
This enables you to install and test Alpine on your main computer almost as you would any other program.
== Preparation ==
== Install Virtual Box on host ==
First you'll need to download and install Virtual Box on your host computer. Either from the official homepage (for Windows, OS X or Solaris) or from your distribution’s repository (for Linux). 
Virtual Box consists of two components: 
* VirtualBox platform package
* Oracle VM VirtualBox Extension Pack
Install both and start VirtualBox to check for proper operation. If you have problems, consult the VirtualBox user manual or one of the support sites for Virtual Box.
== Download Alpine ==
Download the Virtual Alpine ISO, which is optimized for virtual systems, from the Alpine Download section. Save it in a location where you can find it easily. 
== Setting up virtual PC ==
Start Virtual Box. You will see a mostly empty window with a couple symbols in the upper left corner. The leftmost icon is a multi pointed star. If you hover your mouse over it, the tooltip will say “New”. 
Click on the multi pointed star to create a new machine. A window will pop up, asking you some questions about the virtual (guest) computer you want to create.
# Name: Choose anything you like. e.g. “Alpine”.
# Type: Linux
# Version: Other Linux, either 64 bit or 32 bit. Choose 64 bit if you downloaded the x86_64 Alpine-ISO, or 32 bit if you downloaded the x86 Alpine-ISO.
# Use the default values for the other questions, simply click “next” or “create” until the dialogue finishes.
You will see a new entry in Virtual Box, called Alpine (or the name you chose during step 1 in the dialogue above). Click on it for more information about your guest.
One of the entries should read Mass storage, and offer an IDE controller with a primary master (the virtual hard disc) and a secondary master (the virtual optical drive). 
Click on the secondary master. A context menu will pop up. Select the entry “choose image” and open the Alpine ISO you downloaded earlier.
Once that is done, click on the green start arrow on the menu bar.
== Install Alpine on the virtual computer ==
Follow the steps described in the Installation Handbook, just as if you were installing Alpine on a real PC.
== Install drivers for Virtual Box ==
Once you successfully reboot into the Alpine VM, there are two steps left:
# Enable the Community Respository
# Enable VirtualBox shared folders
These two steps install all drivers that other programs might request, and activate several comfort functions.
= KVM / QEMU =
= VMware =
See instructions for installing Alpine on VMware and VMware ESXi.
== See Also ==
* Installation
* Post Install
Category:Virtualization