https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&user=Psykose&feedformat=atomAlpine Linux - User contributions [en]2024-03-29T16:04:04ZUser contributionsMediaWiki 1.40.0https://wiki.alpinelinux.org/w/index.php?title=Template:AlpineLatest&diff=23963Template:AlpineLatest2023-07-29T07:10:06Z<p>Psykose: 3.18.2</p>
<hr />
<div><noinclude>{{Template}}<br />
</noinclude>3.18.2</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Bootloaders&diff=23962Bootloaders2023-07-29T07:06:17Z<p>Psykose: mention rootfstype param</p>
<hr />
<div><br />
This page shows the basic steps you need to perform, if you for any reason want to switch bootloaders or apply some manual configuration.<br />
<br />
<br />
<code>rEFInd</code> is an easy to use EFI boot menu that allows booting different operating systems.<br><br />
<code>Syslinux</code> is the default light-weight bootloader used in Alpine.<br><br />
<code>Grub</code> is a standard linux boot loader.<br><br />
<code>EFI Boot Stub</code> allows booting linux directly from a motherboard supporting UEFI or another bootloader.<br><br />
<br />
<br />
<br />
= rEFIind =<br />
<br />
For (U)EFI systems, the <code>refind</code> package can provide a graphical EFI boot menu that allows to boot operating systems that are found on the available partitions.<br />
<br />
If <code>refind</code> is not yet available in the used alpine release, it may be installed in another dual/multi-booted linux distribution.<br />
<br />
For example, with a Debian based distribution, it can be installed to the EFI partition like this:<br />
<br />
apt install refind # installs the debian package<br />
refind-install --alldrivers # installs refind to the EFI partition<br />
<br />
(The --alldrivers option includes all filesystem drivers instead of only the one needed to load the currently running kernel, to allow finding and booting operating systems from more partitions.)<br />
<br />
And a first (default) boot menu line needs to be configured with Alpine's default boot parameters. Assuming the bootable partition is mounted at <code>/media/sdXY</code> it can be done like this (at time of writing):<br />
echo '"Alpine" "modules=loop,squashfs,sd-mod,usb-storage quiet initrd=\boot\intel-ucode.img initrd=\boot\amd-ucode.img initrd=\boot\initramfs-lts"' > /media/sdXY/boot/refind_linux.conf<br />
<br />
{{Note|<br />
<br />
# At the time of writing, it was still needed to use backslashes in the .conf file. <br />
# The path in the config file needs to be relative to the partition that the kernel resides on. If <code>/boot</code> resides on its own separate partition, then <code>\boot</code> needs to be removed from the paths. }}<br />
<br />
= Installing Syslinux =<br />
<br />
If you want to switch from another bootloader back to Syslinux, or if you for some reason want to install Syslinux manually, the following steps are required.<br />
<br />
Install the <code>syslinux</code> package:<br />
<br />
<pre>apk add syslinux</pre><br />
<br />
If you're using GPT partitions, install the GPT MBR onto the drive you want to install the bootloader on (in this case <code>/dev/sda</code>):<br />
<br />
<pre>dd bs=440 count=1 conv=notrunc if=/usr/share/syslinux/gptmbr.bin of=/dev/sda</pre><br />
<br />
Or if you're using DOS partitions, install the DOS MBR instead:<br />
<br />
<pre>dd bs=440 count=1 conv=notrunc if=/usr/share/syslinux/mbr.bin of=/dev/sda</pre><br />
<br />
<!-- See also: http://www.syslinux.org/wiki/index.php?title=Mbr --><br />
<br />
Next install the required Syslinux binaries. Despite being called <code>extlinux</code>, Syslinux supports booting from FAT12/16/32, NTFS, ext2/3/4, [[Btrfs|btrfs]], XFS, and UFS/FFS filesystems.<br />
<br />
<pre>extlinux --install /boot</pre><br />
<br />
The configuration file is located in <code>/boot/extlinux.conf</code>.<br />
Alpine ships with a script called <code>update-extlinux</code> which automatically (re)generates this file, for example on updates to Syslinux.<br />
The settings for this script can be found in <code>/etc/update-extlinux.conf</code>, including the option to disable automatic overwriting of <code>/boot/extlinux.conf</code>.<br />
You can also place additional menu entries in the <code>/etc/update-extlinux.d/</code> directory, e.g. for dual booting.<br />
<br />
<br />
=== EFI ===<br />
<br />
{{Todo|Work in progress. This should at least get you started.}}<br />
<br />
Assuming <code>/mnt</code> is a FAT32 partition of type EF00 and <code>/boot</code> belongs to the rootfs created after running <code>setup-disk</code>:<br />
<br />
<pre><br />
mkdir -p /mnt/EFI/syslinux<br />
cp /usr/share/syslinux/efi64/* /mnt/EFI/syslinux/<br />
cp /boot/extlinux.conf /mnt/EFI/syslinux/syslinux.cfg<br />
cp /boot/vmlinuz* /mnt/<br />
cp /boot/initramfs* /mnt/<br />
</pre><br />
<br />
You may need to modify <code>/mnt/EFI/syslinux/syslinux.cfg</code> to change the paths to absolute paths (just add a / in front of the vmlinuz/initramfs entries),<br />
or copy the files to <code>/mnt/EFI/syslinux</code> instead (XXX: untested).<br />
<br />
= GRUB =<br />
<br />
To install GRUB in BIOS mode, (optionally) remove the Syslinux package and install the required GRUB packages:<br />
<br />
<pre>apk del syslinux<br />
apk add grub grub-bios</pre><br />
<br />
For EFI, install Grub's EFI package instead. Note that <code>/boot</code> has to be an EFI compatible filesystem like FAT32.<br />
<br />
<pre>apk add grub-efi</pre><br />
<br />
Next install the MBR and GRUB binaries to disk for BIOS mode:<br />
<br />
<pre>grub-install /dev/vda</pre><br />
<br />
For EFI mode:<br />
<br />
<pre>grub-install --target=x86_64-efi --efi-directory=/boot</pre><br />
<br />
GRUB ships with an automatic config generator, including some automatic detection of other operating systems installed on the device:<br />
<br />
<pre>grub-mkconfig -o /boot/grub/grub.cfg</pre><br />
<br />
This script can be configured via the <code>/etc/default/grub</code> file.<br />
See [https://www.gnu.org/software/grub/manual/html_node/Simple-configuration.html] for a list of available options.<br />
<br />
<br />
= EFI Boot Stub =<br />
<br />
To boot directly from your motherboard's UEFI boot menu, a boot entry needs<br />
to be created with either a UEFI shell or ''efibootmgr''.<br />
<br />
== efibootmgr ==<br />
<br />
Install efibootmgr:<br />
<pre>apk add efibootmgr</pre><br />
<br />
Create a boot entry. It's recommended to do this in a script, as efibootmgr<br />
does not allow editing entries.<br />
<br />
<pre>#!/bin/sh<br />
<br />
params="root=/dev/sdXZ rootfstype=ext4 rw \<br />
initrd=\intel-ucode.img \<br />
initrd=\initramfs-lts"<br />
<br />
efibootmgr --create --label "Alpine Linux" \<br />
--disk /dev/sdX --part Y \<br />
--loader /vmlinuz-lts \<br />
--unicode "${params}" \<br />
--verbose<br />
</pre><br />
<br />
Where <code>/dev/sdXY</code> contains the EFI partition and <code>/dev/sdXZ</code> contains the root partition. If you are using {{Pkg|linux-edge}}, replace <code>lts</code> with <code>edge</code> in the script<br />
<br />
{{Note|<br />
The kernel contains the [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/init/do_mounts.c#n254 exhaustive list] of ways to specify the block device. For a more robust boot entry, it is recommended to use a persistent name such as the PARTUUID.<br />
}}<br />
<br />
Optionally, set the newly created entry as the default:<br />
<br />
<pre>efibootmgr -n XXXX</pre><br />
<br />
Where <code>XXXX</code> is the boot number of the new entry.<br />
<br />
{{Note|<br />
The loader and initrd file arguments are relative to the EFI partition. In a default installation, alpine places these files in <code>/boot/</code>, while EFI is mounted to <code>/boot/efi/</code>. You can either update fstab to mount EFI at <code>/boot/</code>, or manually copy them to <code>/boot/efi/</code>. }}<br />
<br />
= Using a UKI (UEFI only) =<br />
<br />
It is possible to boot directly into a '''Unified Kernel Image''' (UKI). A UKI is a single file which contains the initfs, kernel and cmdline. While this is typically done in order to enable [https://en.wikipedia.org/wiki/UEFI SecureBoot], it is perfectly feasible to skip enrolling the custom keys and leave SecureBoot off.<br />
<br />
The page [[UEFI Secure Boot]] contains the instructions for setting an a UKI. Additionally, it is possible to install the UKI in the default fallback path used by most UEFI implementations. By installing the UKI into this path, the system will automatically boot into it if no other entries are defined. This can be automated as part of the kernel hook by adding the following to <code>/etc/kernel-hooks.d/secureboot.conf</code><br />
<br />
<pre><br />
# For the edge kernel, install the UKI into the default UEFI path.<br />
if [ "$1" == "edge" ]; then<br />
output_dir="/efi/EFI/Boot/"<br />
output_name="bootx64.efi"<br />
fi<br />
</pre><br />
<br />
<code>bootx64.efi</code> is only correct for <code>x86_64</code> systems. For other architectures the exact name will vary.<br />
<br />
= External Links =<br />
* [https://www.denx.de/wiki/U-Boot/ReleaseCycle U-Boot Release Cycle]<br />
<br />
[[Category:Installation]]<br />
[[Category:Booting]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Alpine_Linux:FAQ&diff=23823Alpine Linux:FAQ2023-07-26T02:05:13Z<p>Psykose: clarify power/s390</p>
<hr />
<div>[[Image:filetypes.svg|64px|left|link=]]<br />
This is a list of '''frequently asked questions''' about Alpine Linux.<br /><br />
If your question is not answered on this page, use the search box above to find work in progress pages not linked here, or in case of no answer, edit this page and write down your question.<br />
{{Tip| Prepare your question. Think it through. Make it simple and understandable.}} <br />
<br />
=General=<br />
<br />
Alpine Linux is used heavily in containers (e.g. Docker images) on servers, so many of its main packages are focused on server services.<br />
<br />
== Where to start? ==<br />
<br />
The [[Installation]] page and the [[Installation#Post-Installation|Post Installation]] section on that page, provide a basic orientation.<br />
<br />
A broader overview may be found on the official [https://alpinelinux.org/about About] page and at the [[Alpine Linux:Overview|wiki overview]].<br />
<br />
Please note that testing is safer on your own virtual machine or on a public [https://distrotest.net/AlpineLinux/ DistroTest.net].<br />
<br />
== I have found a bug, where can I report it? ==<br />
<br />
You can report it on the [https://gitlab.alpinelinux.org/groups/alpine/-/issues bugtracker], but search it first to see if the issue has already been reported.<br />
<br />
== Are there any details about the releases available? ==<br />
Yes, please check the [https://alpinelinux.org/releases/ releases] page.<br />
<br />
== How can I contribute? ==<br />
You can contribute by:<br />
* Using the software and giving [https://gitlab.alpinelinux.org/groups/alpine/-/issues feedback].<br />
* Documenting your [https://www.alpinelinux.org Alpine Linux] experiences on this [[Main_Page|wiki]].<br />
* Flag packages as outdated in the [https://pkgs.alpinelinux.org/packages package database], or even better enable release monitoring in [https://release-monitoring.org/ Anitya] for them.<br />
* In many other ways.<br />
Please visit [[Contribute|Contribute page]] to read more about this topic.<br />
<br />
== Why don't I have man pages or where is the 'man' command? ==<br />
The <code>man</code> command and '''man pages''' are not installed by default.<br />
<br />
Install the <code>man</code> command:<br />
{{cmd|# apk add mandoc}}<br />
Install basic manual pages. {{pkg|man-pages}} package provides the system's ''core'' manual pages:<br />
{{cmd|# apk add man-pages}}<br />
Install the <code>apropos</code> command to search in '''man pages''':<br />
{{cmd|# apk add mandoc-apropos}}<br />
Once installed, add documentation for the package where you need it. For example, say you installed {{pkg|nftables}} and you now require its '''man pages''':<br />
{{cmd|# apk add nftables-doc}}<br />
To always install the documentation companion package add the {{pkg|docs}} meta package. Keep in mind not all packages have a corresponding documentation package and even when it has one it may not include '''man pages''':<br />
{{cmd|# apk add docs}}<br />
<br />
== What is the difference between edge and stable releases? ==<br />
Stable releases are just what they sound like: initially a point-in-time snapshot of the package archives, but then maintained with bugfixes only in order to keep a stable environment.<br />
<br />
[[Repositories#Edge|Edge]] is more of a rolling-release, with the latest and greatest packages available in the online repositories.<br /><br />
Occasionally, snapshot ISO images of the then-current state of [[Repositories#Edge|edge]] are made and are available for download.<br /><br />
Typically these are made when there are major kernel upgrades or package upgrades that require initramfs rebuilds.<br />
<br />
== What architectures does Alpine Linux support? ==<br />
* '''aarch64''': 64-bit ARM processors (e.g. Raspberry Pi 4)<br />
* '''armhf''': 32-bit ARMv6 processors with a floating point unit (e.g. Raspberry Pi 1) (armv6hf)<br />
* '''armv7''': 32-bit ARMv7 processors with a floating point unit (armv7hf)<br />
* '''s390x''': IBM mainframes using the z/Architecture (z196 minimum)<br />
* '''ppc64le''': 64-bit little-endian POWER devices (e.g. Raptor Talos II) (POWER8 minimum)<br />
* '''x86''': 32-bit Intel and AMD processors commonly found in older personal computers (e.g. Pentium M+). Can also run on x86_64 machines (not recommended). Requires SSE2.<br />
* '''x86_64''': 64-bit Intel and AMD processors commonly found in personal computers (e.g. Core i7, Ryzen 7)<br />
'''Please check [https://alpinelinux.org/downloads Download] page for media availability on each one''' and check [https://alpinelinux.org/releases/ Release Branches] page for latest.<br />
<br />
== What kinds of release of Alpine Linux are available? ==<br />
Please check the [https://alpinelinux.org/releases/ Release Branches] page for more information.<br />
<br />
=Setup=<br />
<br />
== What is the difference between ''sys'', ''data'', and ''diskless'' when running <code>setup-alpine</code> or <code>setup-disk</code>? ==<br />
<br />
'''sys:''' This mode is a traditional disk install. The following partitions will be created on the disk: ''/boot/'', ''/'' (filesystem root) and ''swap''.<br />
This mode may be used for development boxes, desktops, virtual servers, etc.<br />
<br />
'''data:''' This mode uses your disk(s) for data storage, not for the operating system. Runs from the media and only a ''/var/'' is created on disk. The system itself will run from a ''tmpfs'' (RAM). Use this mode if you only want to use the disk(s) for data, like ''mailspool'', ''databases'', ''logs'', etc.<br />
<br />
'''diskless:''' No disks are to be used. [[Alpine local backup]] may still be used in this mode.<br />
<br />
These modes are explained further on the [[Installation#Installation_Overview|'''Installation''']] page.<br />
<br />
== How do I upgrade Alpine? ==<br />
<br />
To upgrade to a new stable release or edge:<br />
<code>apk upgrade --available</code><br />
<br />
==Why don't my cron jobs run?==<br />
<br />
Start service ''crond'' and add it to runlevel:<br />
<br />
: {{cmd|rc-service crond start && rc-update add crond}}<br />
<br />
After that the cron daemon is started automatically on system boot and executes the scripts placed in the folders under ''/etc/periodic/'' - there are folders for ''15min'', ''hourly'', ''daily'', ''weekly'' and ''monthly'' scripts.<br />
<br />
To check whether your scripts are likely to run, use the ''run-parts'' command, for example:<br />
<br />
: {{cmd|run-parts --test /etc/periodic/15min}}<br />
<br />
This command will tell you what should run but will not actually execute the scripts.<br />
<br />
If the results of the test are not as expected, check the following:<br />
<br />
* Make sure the script is executable - if unsure, issue the command {{cmd|chmod +x /etc/periodic/[path/scriptname]}}<br />
* Make sure the first line of your script is <code>#!/bin/sh</code><br />
* Do not use periods on your script file names - this stops them from working; for example: {{Path|/etc/periodic/daily/myscript}} will run, but {{Path|/etc/periodic/daily/myscript.sh}} won't.<br />
<br />
= Time and timezones =<br />
<br />
== How do I set the local timezone? ==<br />
<br />
If you wish to edit the ''timezone'' (TZ) after installation, run the [[Alpine_setup_scripts#setup-timezone|setup-timezone]] script.<br />
<br />
= Packages =<br />
<br />
== Can you build an APK package for ...? ==<br />
Please create an [https://gitlab.alpinelinux.org/alpine/aports/issues/new issue] in the [https://gitlab.alpinelinux.org bugtracker]. Prefix it with "package request:" in the title and include a short description (one-line), a URL for the home page, why you need it, and a URL for the source package.<br />
<br />
== How can I build my own package? ==<br />
Please see the [[Creating an Alpine package]] page.<br />
<br />
== What does "required by: world[$pkgname]" mean? ==<br />
<br />
It means that the package you tried to install does not exist in the repositories you have configured. <br />
<br />
Maybe you forgot to add community, testing or unmaintained to ''/etc/apk/repositories''? <br />
<br />
Or is the package in a [[Alpine_Linux_package_management#Repository_pinning|pinned repository]] and you forgot to suffix the package with the repo tag? Example:<br />
<br />
{{cmd|apk add experimental-package@testing}}<br />
<br />
== How can I find out if a certain package exists in Alpine? ==<br />
<br />
If you want to only search repositories you have configured in /etc/apk/repositories, then <code>apk search $pkgname</code> should get you sorted. If you want to search all repositories have a look at the [https://pkgs.alpinelinux.org/ online pkg oracle]<br />
<br />
== WARNING: Ignoring APKINDEX.xxxx.tar.gz ==<br />
If you get <code>WARNING: Ignoring APKINDEX.xxxx.tar.gz: No such file or directory</code> while running [[Alpine_Linux_package_management|package related tools]], check your {{Path|/etc/apk/repositories}} file.<br />
<br />
To check the content of the repositories file<br />
{{Cmd|cat /etc/apk/repositories}}<br />
<br />
or <br />
{{Cmd|setup-apkrepos}}<br />
<br />
= Dynamic DNS =<br />
== How do I schedule a regular dynamic DNS update? ==<br />
You'll want to install the {{pkg|ez-ipupdate}} package:<br />
{{cmd|apk add ez-ipupdate}}<br />
<br />
After that, create a new file at {{path|/etc/ez-ipupdate.conf}} with contents similar to:<br />
service-type=dyndns<br />
user=myusername:mypassword<br />
interface=eth1<br />
host=myhostname.dyndns.org<br />
<br />
Make the new ip cache directory:<br />
{{cmd|mkdir /var/cache/ez-ipupdate<br />
lbu add /var/cache/ez-ipupdate}}<br />
<br />
Then schedule a new cron job with this command:<br />
{{cmd|echo >> /var/log/ez-ipupdate && \<br />/bin/date >> /var/log/ez-ipupdate && \<br />ez-ipupdate --config-file /etc/ez-ipupdate.conf -f -F /var/run/ez-ipupdate.pid \<br /> --cache-file /var/cache/ez-ipupdate/ipcache --quiet >> /var/log/ez-ipupdate 2>&1}}<br />
<br />
Don't forget to backup your settings!<br />
{{cmd|lbu ci}}<br />
<br />
= Terminal =<br />
<br />
== How to enable/fix colors for git? ==<br />
<br />
The problem is not in git itself or terminal, but in the <tt>less</tt> command.<br />
Busybox’s <tt>less</tt> doesn’t support <tt>-r</tt> (<tt>--raw-control-chars</tt>) and <tt>-R</tt> (<tt>--RAW-CONTROL-CHARS</tt>) options.<br />
<br />
The simplest (yet not ideal) solution is to install GNU less:<br />
<br />
{{cmd|apk add less}}<br />
<br />
== Fix lacking lsusb / lspci output ==<br />
<br />
If you launch <code>lsusb</code> or <code>lspci</code> on a minimal installation, there's no device descriptions, and the latter doesn't exist.<br />
This can be fixed by installing the hwdata tables, '''hwdata-uwb''' or '''hwdata-pci''' respectively. For <code>lspci</code>, add '''pciutils'''.<br />
<br />
= Old questions, no longer frequently asked =<br />
<br />
== Alpine freezes during boot from Compact Flash, how can I fix? ==<br />
Most Compact Flash card readers do not support proper DMA.<br /><br />
You should append '''nodma''' to the ''append'' line in {{path|syslinux.cfg}}.<br />
<br />
== How do I remove the CD-ROM? ==<br />
Since the modloop loopback device is on CD-ROM you cannot just run <code>eject</code>. You need to unmount the modloop first.<br /><br />
Unmounting both the modloop and the CDROM in one step can be done by executing:<br />
{{Cmd|/etc/init.d/modloop stop}}<br />
<br />
Then it's possible to eject the CD-ROM:<br />
{{Cmd|eject}}<br />
<br />
== How can I install custom firmware in a diskless system? ==<br />
<br />
The modules and firmware are both special images which are mounted as read-only.<br /><br />
To fix this issue you can copy the firmware directory to your writeable media (cf/usb) and copy your custom firmware to it.<br /><br />
After reboot Alpine should automatically use the directory on your local storage instead of the loopback device.<br />
<br />
== OpenNTPD reports an error with "adjtime" ==<br />
Your log contains something like:<br />
reply from 85.214.86.126: offset 865033148.784255 delay 0.055466, next query 32s<br />
reply from 202.150.212.24: offset 865033148.779314 delay 0.400771, next query 3s<br />
adjusting local clock by 865033148.779835s <br />
adjtime failed: Invalid argument <br />
<br />
{{pkg|openntpd}} is supposed to make small adjustments in the time without causing time jumps.<br /><br />
If the adjustment is too big then something is clearly wrong and ntpd gives up. (its actually adjtime(3) that has a limit on how big adjustments are allowed)<br />
<br />
You can make ntpd set the time at startup by adding ''-s'' option to ntpd. This is done by setting '''NTPD_OPTS="-s"''' in {{path|/etc/conf.d/ntpd}}.<br />
<br />
== Using a cron job to keep the time in sync ==<br />
Add the following to {{path|/etc/periodic/daily}} (or use another folder under the {{path|/etc/periodic}} hierarchy if you want to run the script more/less frequently)<br />
<br />
Example: file called {{path|do-ntp}}<br />
<pre><br />
#!/bin/sh<br />
ntpd -d -q -n -p uk.pool.ntp.org</pre><br />
<br />
This queries the uk time server pool - you can modify this to suit your localisation, or just use ''pool.ntp.org''. More info here: [http://www.pool.ntp.org/zone/@ http://www.pool.ntp.org/zone/@]<br />
<br />
== Windows clients reports an error when trying to sync ==<br />
{{pkg|openntpd}} needs to run for a while before it is satisfied it is in sync.<br />
Until then it will set a flag "clock not synchronized" and Windows will report an error while trying to sync with your {{pkg|openntpd}} server.<br />
<br />
Only thing to do is wait, do something else for 15-20mins and then check.<br />
<br />
<br />
[[Category:Newbie]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Alpine_Linux:FAQ&diff=23822Alpine Linux:FAQ2023-07-26T02:04:23Z<p>Psykose: clarify wrong arm info</p>
<hr />
<div>[[Image:filetypes.svg|64px|left|link=]]<br />
This is a list of '''frequently asked questions''' about Alpine Linux.<br /><br />
If your question is not answered on this page, use the search box above to find work in progress pages not linked here, or in case of no answer, edit this page and write down your question.<br />
{{Tip| Prepare your question. Think it through. Make it simple and understandable.}} <br />
<br />
=General=<br />
<br />
Alpine Linux is used heavily in containers (e.g. Docker images) on servers, so many of its main packages are focused on server services.<br />
<br />
== Where to start? ==<br />
<br />
The [[Installation]] page and the [[Installation#Post-Installation|Post Installation]] section on that page, provide a basic orientation.<br />
<br />
A broader overview may be found on the official [https://alpinelinux.org/about About] page and at the [[Alpine Linux:Overview|wiki overview]].<br />
<br />
Please note that testing is safer on your own virtual machine or on a public [https://distrotest.net/AlpineLinux/ DistroTest.net].<br />
<br />
== I have found a bug, where can I report it? ==<br />
<br />
You can report it on the [https://gitlab.alpinelinux.org/groups/alpine/-/issues bugtracker], but search it first to see if the issue has already been reported.<br />
<br />
== Are there any details about the releases available? ==<br />
Yes, please check the [https://alpinelinux.org/releases/ releases] page.<br />
<br />
== How can I contribute? ==<br />
You can contribute by:<br />
* Using the software and giving [https://gitlab.alpinelinux.org/groups/alpine/-/issues feedback].<br />
* Documenting your [https://www.alpinelinux.org Alpine Linux] experiences on this [[Main_Page|wiki]].<br />
* Flag packages as outdated in the [https://pkgs.alpinelinux.org/packages package database], or even better enable release monitoring in [https://release-monitoring.org/ Anitya] for them.<br />
* In many other ways.<br />
Please visit [[Contribute|Contribute page]] to read more about this topic.<br />
<br />
== Why don't I have man pages or where is the 'man' command? ==<br />
The <code>man</code> command and '''man pages''' are not installed by default.<br />
<br />
Install the <code>man</code> command:<br />
{{cmd|# apk add mandoc}}<br />
Install basic manual pages. {{pkg|man-pages}} package provides the system's ''core'' manual pages:<br />
{{cmd|# apk add man-pages}}<br />
Install the <code>apropos</code> command to search in '''man pages''':<br />
{{cmd|# apk add mandoc-apropos}}<br />
Once installed, add documentation for the package where you need it. For example, say you installed {{pkg|nftables}} and you now require its '''man pages''':<br />
{{cmd|# apk add nftables-doc}}<br />
To always install the documentation companion package add the {{pkg|docs}} meta package. Keep in mind not all packages have a corresponding documentation package and even when it has one it may not include '''man pages''':<br />
{{cmd|# apk add docs}}<br />
<br />
== What is the difference between edge and stable releases? ==<br />
Stable releases are just what they sound like: initially a point-in-time snapshot of the package archives, but then maintained with bugfixes only in order to keep a stable environment.<br />
<br />
[[Repositories#Edge|Edge]] is more of a rolling-release, with the latest and greatest packages available in the online repositories.<br /><br />
Occasionally, snapshot ISO images of the then-current state of [[Repositories#Edge|edge]] are made and are available for download.<br /><br />
Typically these are made when there are major kernel upgrades or package upgrades that require initramfs rebuilds.<br />
<br />
== What architectures does Alpine Linux support? ==<br />
* '''aarch64''': 64-bit ARM processors (e.g. Raspberry Pi 4)<br />
* '''armhf''': 32-bit ARMv6 processors with a floating point unit (e.g. Raspberry Pi 1) (armv6hf)<br />
* '''armv7''': 32-bit ARMv7 processors with a floating point unit (armv7hf)<br />
* '''s390x''': IBM mainframes using the z/Architecture<br />
* '''ppc64le''': 64-bit little-endian POWER devices (e.g. Raptor Talos II)<br />
* '''x86''': 32-bit Intel and AMD processors commonly found in older personal computers (e.g. Pentium M+). Can also run on x86_64 machines (not recommended). Requires SSE2.<br />
* '''x86_64''': 64-bit Intel and AMD processors commonly found in personal computers (e.g. Core i7, Ryzen 7)<br />
'''Please check [https://alpinelinux.org/downloads Download] page for media availability on each one''' and check [https://alpinelinux.org/releases/ Release Branches] page for latest.<br />
<br />
== What kinds of release of Alpine Linux are available? ==<br />
Please check the [https://alpinelinux.org/releases/ Release Branches] page for more information.<br />
<br />
=Setup=<br />
<br />
== What is the difference between ''sys'', ''data'', and ''diskless'' when running <code>setup-alpine</code> or <code>setup-disk</code>? ==<br />
<br />
'''sys:''' This mode is a traditional disk install. The following partitions will be created on the disk: ''/boot/'', ''/'' (filesystem root) and ''swap''.<br />
This mode may be used for development boxes, desktops, virtual servers, etc.<br />
<br />
'''data:''' This mode uses your disk(s) for data storage, not for the operating system. Runs from the media and only a ''/var/'' is created on disk. The system itself will run from a ''tmpfs'' (RAM). Use this mode if you only want to use the disk(s) for data, like ''mailspool'', ''databases'', ''logs'', etc.<br />
<br />
'''diskless:''' No disks are to be used. [[Alpine local backup]] may still be used in this mode.<br />
<br />
These modes are explained further on the [[Installation#Installation_Overview|'''Installation''']] page.<br />
<br />
== How do I upgrade Alpine? ==<br />
<br />
To upgrade to a new stable release or edge:<br />
<code>apk upgrade --available</code><br />
<br />
==Why don't my cron jobs run?==<br />
<br />
Start service ''crond'' and add it to runlevel:<br />
<br />
: {{cmd|rc-service crond start && rc-update add crond}}<br />
<br />
After that the cron daemon is started automatically on system boot and executes the scripts placed in the folders under ''/etc/periodic/'' - there are folders for ''15min'', ''hourly'', ''daily'', ''weekly'' and ''monthly'' scripts.<br />
<br />
To check whether your scripts are likely to run, use the ''run-parts'' command, for example:<br />
<br />
: {{cmd|run-parts --test /etc/periodic/15min}}<br />
<br />
This command will tell you what should run but will not actually execute the scripts.<br />
<br />
If the results of the test are not as expected, check the following:<br />
<br />
* Make sure the script is executable - if unsure, issue the command {{cmd|chmod +x /etc/periodic/[path/scriptname]}}<br />
* Make sure the first line of your script is <code>#!/bin/sh</code><br />
* Do not use periods on your script file names - this stops them from working; for example: {{Path|/etc/periodic/daily/myscript}} will run, but {{Path|/etc/periodic/daily/myscript.sh}} won't.<br />
<br />
= Time and timezones =<br />
<br />
== How do I set the local timezone? ==<br />
<br />
If you wish to edit the ''timezone'' (TZ) after installation, run the [[Alpine_setup_scripts#setup-timezone|setup-timezone]] script.<br />
<br />
= Packages =<br />
<br />
== Can you build an APK package for ...? ==<br />
Please create an [https://gitlab.alpinelinux.org/alpine/aports/issues/new issue] in the [https://gitlab.alpinelinux.org bugtracker]. Prefix it with "package request:" in the title and include a short description (one-line), a URL for the home page, why you need it, and a URL for the source package.<br />
<br />
== How can I build my own package? ==<br />
Please see the [[Creating an Alpine package]] page.<br />
<br />
== What does "required by: world[$pkgname]" mean? ==<br />
<br />
It means that the package you tried to install does not exist in the repositories you have configured. <br />
<br />
Maybe you forgot to add community, testing or unmaintained to ''/etc/apk/repositories''? <br />
<br />
Or is the package in a [[Alpine_Linux_package_management#Repository_pinning|pinned repository]] and you forgot to suffix the package with the repo tag? Example:<br />
<br />
{{cmd|apk add experimental-package@testing}}<br />
<br />
== How can I find out if a certain package exists in Alpine? ==<br />
<br />
If you want to only search repositories you have configured in /etc/apk/repositories, then <code>apk search $pkgname</code> should get you sorted. If you want to search all repositories have a look at the [https://pkgs.alpinelinux.org/ online pkg oracle]<br />
<br />
== WARNING: Ignoring APKINDEX.xxxx.tar.gz ==<br />
If you get <code>WARNING: Ignoring APKINDEX.xxxx.tar.gz: No such file or directory</code> while running [[Alpine_Linux_package_management|package related tools]], check your {{Path|/etc/apk/repositories}} file.<br />
<br />
To check the content of the repositories file<br />
{{Cmd|cat /etc/apk/repositories}}<br />
<br />
or <br />
{{Cmd|setup-apkrepos}}<br />
<br />
= Dynamic DNS =<br />
== How do I schedule a regular dynamic DNS update? ==<br />
You'll want to install the {{pkg|ez-ipupdate}} package:<br />
{{cmd|apk add ez-ipupdate}}<br />
<br />
After that, create a new file at {{path|/etc/ez-ipupdate.conf}} with contents similar to:<br />
service-type=dyndns<br />
user=myusername:mypassword<br />
interface=eth1<br />
host=myhostname.dyndns.org<br />
<br />
Make the new ip cache directory:<br />
{{cmd|mkdir /var/cache/ez-ipupdate<br />
lbu add /var/cache/ez-ipupdate}}<br />
<br />
Then schedule a new cron job with this command:<br />
{{cmd|echo >> /var/log/ez-ipupdate && \<br />/bin/date >> /var/log/ez-ipupdate && \<br />ez-ipupdate --config-file /etc/ez-ipupdate.conf -f -F /var/run/ez-ipupdate.pid \<br /> --cache-file /var/cache/ez-ipupdate/ipcache --quiet >> /var/log/ez-ipupdate 2>&1}}<br />
<br />
Don't forget to backup your settings!<br />
{{cmd|lbu ci}}<br />
<br />
= Terminal =<br />
<br />
== How to enable/fix colors for git? ==<br />
<br />
The problem is not in git itself or terminal, but in the <tt>less</tt> command.<br />
Busybox’s <tt>less</tt> doesn’t support <tt>-r</tt> (<tt>--raw-control-chars</tt>) and <tt>-R</tt> (<tt>--RAW-CONTROL-CHARS</tt>) options.<br />
<br />
The simplest (yet not ideal) solution is to install GNU less:<br />
<br />
{{cmd|apk add less}}<br />
<br />
== Fix lacking lsusb / lspci output ==<br />
<br />
If you launch <code>lsusb</code> or <code>lspci</code> on a minimal installation, there's no device descriptions, and the latter doesn't exist.<br />
This can be fixed by installing the hwdata tables, '''hwdata-uwb''' or '''hwdata-pci''' respectively. For <code>lspci</code>, add '''pciutils'''.<br />
<br />
= Old questions, no longer frequently asked =<br />
<br />
== Alpine freezes during boot from Compact Flash, how can I fix? ==<br />
Most Compact Flash card readers do not support proper DMA.<br /><br />
You should append '''nodma''' to the ''append'' line in {{path|syslinux.cfg}}.<br />
<br />
== How do I remove the CD-ROM? ==<br />
Since the modloop loopback device is on CD-ROM you cannot just run <code>eject</code>. You need to unmount the modloop first.<br /><br />
Unmounting both the modloop and the CDROM in one step can be done by executing:<br />
{{Cmd|/etc/init.d/modloop stop}}<br />
<br />
Then it's possible to eject the CD-ROM:<br />
{{Cmd|eject}}<br />
<br />
== How can I install custom firmware in a diskless system? ==<br />
<br />
The modules and firmware are both special images which are mounted as read-only.<br /><br />
To fix this issue you can copy the firmware directory to your writeable media (cf/usb) and copy your custom firmware to it.<br /><br />
After reboot Alpine should automatically use the directory on your local storage instead of the loopback device.<br />
<br />
== OpenNTPD reports an error with "adjtime" ==<br />
Your log contains something like:<br />
reply from 85.214.86.126: offset 865033148.784255 delay 0.055466, next query 32s<br />
reply from 202.150.212.24: offset 865033148.779314 delay 0.400771, next query 3s<br />
adjusting local clock by 865033148.779835s <br />
adjtime failed: Invalid argument <br />
<br />
{{pkg|openntpd}} is supposed to make small adjustments in the time without causing time jumps.<br /><br />
If the adjustment is too big then something is clearly wrong and ntpd gives up. (its actually adjtime(3) that has a limit on how big adjustments are allowed)<br />
<br />
You can make ntpd set the time at startup by adding ''-s'' option to ntpd. This is done by setting '''NTPD_OPTS="-s"''' in {{path|/etc/conf.d/ntpd}}.<br />
<br />
== Using a cron job to keep the time in sync ==<br />
Add the following to {{path|/etc/periodic/daily}} (or use another folder under the {{path|/etc/periodic}} hierarchy if you want to run the script more/less frequently)<br />
<br />
Example: file called {{path|do-ntp}}<br />
<pre><br />
#!/bin/sh<br />
ntpd -d -q -n -p uk.pool.ntp.org</pre><br />
<br />
This queries the uk time server pool - you can modify this to suit your localisation, or just use ''pool.ntp.org''. More info here: [http://www.pool.ntp.org/zone/@ http://www.pool.ntp.org/zone/@]<br />
<br />
== Windows clients reports an error when trying to sync ==<br />
{{pkg|openntpd}} needs to run for a while before it is satisfied it is in sync.<br />
Until then it will set a flag "clock not synchronized" and Windows will report an error while trying to sync with your {{pkg|openntpd}} server.<br />
<br />
Only thing to do is wait, do something else for 15-20mins and then check.<br />
<br />
<br />
[[Category:Newbie]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Alpine_Linux:FAQ&diff=23821Alpine Linux:FAQ2023-07-26T02:03:20Z<p>Psykose: clarify x86</p>
<hr />
<div>[[Image:filetypes.svg|64px|left|link=]]<br />
This is a list of '''frequently asked questions''' about Alpine Linux.<br /><br />
If your question is not answered on this page, use the search box above to find work in progress pages not linked here, or in case of no answer, edit this page and write down your question.<br />
{{Tip| Prepare your question. Think it through. Make it simple and understandable.}} <br />
<br />
=General=<br />
<br />
Alpine Linux is used heavily in containers (e.g. Docker images) on servers, so many of its main packages are focused on server services.<br />
<br />
== Where to start? ==<br />
<br />
The [[Installation]] page and the [[Installation#Post-Installation|Post Installation]] section on that page, provide a basic orientation.<br />
<br />
A broader overview may be found on the official [https://alpinelinux.org/about About] page and at the [[Alpine Linux:Overview|wiki overview]].<br />
<br />
Please note that testing is safer on your own virtual machine or on a public [https://distrotest.net/AlpineLinux/ DistroTest.net].<br />
<br />
== I have found a bug, where can I report it? ==<br />
<br />
You can report it on the [https://gitlab.alpinelinux.org/groups/alpine/-/issues bugtracker], but search it first to see if the issue has already been reported.<br />
<br />
== Are there any details about the releases available? ==<br />
Yes, please check the [https://alpinelinux.org/releases/ releases] page.<br />
<br />
== How can I contribute? ==<br />
You can contribute by:<br />
* Using the software and giving [https://gitlab.alpinelinux.org/groups/alpine/-/issues feedback].<br />
* Documenting your [https://www.alpinelinux.org Alpine Linux] experiences on this [[Main_Page|wiki]].<br />
* Flag packages as outdated in the [https://pkgs.alpinelinux.org/packages package database], or even better enable release monitoring in [https://release-monitoring.org/ Anitya] for them.<br />
* In many other ways.<br />
Please visit [[Contribute|Contribute page]] to read more about this topic.<br />
<br />
== Why don't I have man pages or where is the 'man' command? ==<br />
The <code>man</code> command and '''man pages''' are not installed by default.<br />
<br />
Install the <code>man</code> command:<br />
{{cmd|# apk add mandoc}}<br />
Install basic manual pages. {{pkg|man-pages}} package provides the system's ''core'' manual pages:<br />
{{cmd|# apk add man-pages}}<br />
Install the <code>apropos</code> command to search in '''man pages''':<br />
{{cmd|# apk add mandoc-apropos}}<br />
Once installed, add documentation for the package where you need it. For example, say you installed {{pkg|nftables}} and you now require its '''man pages''':<br />
{{cmd|# apk add nftables-doc}}<br />
To always install the documentation companion package add the {{pkg|docs}} meta package. Keep in mind not all packages have a corresponding documentation package and even when it has one it may not include '''man pages''':<br />
{{cmd|# apk add docs}}<br />
<br />
== What is the difference between edge and stable releases? ==<br />
Stable releases are just what they sound like: initially a point-in-time snapshot of the package archives, but then maintained with bugfixes only in order to keep a stable environment.<br />
<br />
[[Repositories#Edge|Edge]] is more of a rolling-release, with the latest and greatest packages available in the online repositories.<br /><br />
Occasionally, snapshot ISO images of the then-current state of [[Repositories#Edge|edge]] are made and are available for download.<br /><br />
Typically these are made when there are major kernel upgrades or package upgrades that require initramfs rebuilds.<br />
<br />
== What architectures does Alpine Linux support? ==<br />
* '''aarch64''': 64-bit ARM processors (e.g. Raspberry Pi 4)<br />
* '''armhf''': 32-bit ARM processors with a floating point unit (e.g. Raspberry Pi 1)<br />
* '''armv7''': 32-bit ARM processors without a floating point unit<br />
* '''s390x''': IBM mainframes using the z/Architecture<br />
* '''ppc64le''': 64-bit little-endian POWER devices (e.g. Raptor Talos II)<br />
* '''x86''': 32-bit Intel and AMD processors commonly found in older personal computers (e.g. Pentium M+). Can also run on x86_64 machines (not recommended). Requires SSE2.<br />
* '''x86_64''': 64-bit Intel and AMD processors commonly found in personal computers (e.g. Core i7, Ryzen 7)<br />
'''Please check [https://alpinelinux.org/downloads Download] page for media availability on each one''' and check [https://alpinelinux.org/releases/ Release Branches] page for latest.<br />
<br />
== What kinds of release of Alpine Linux are available? ==<br />
Please check the [https://alpinelinux.org/releases/ Release Branches] page for more information.<br />
<br />
=Setup=<br />
<br />
== What is the difference between ''sys'', ''data'', and ''diskless'' when running <code>setup-alpine</code> or <code>setup-disk</code>? ==<br />
<br />
'''sys:''' This mode is a traditional disk install. The following partitions will be created on the disk: ''/boot/'', ''/'' (filesystem root) and ''swap''.<br />
This mode may be used for development boxes, desktops, virtual servers, etc.<br />
<br />
'''data:''' This mode uses your disk(s) for data storage, not for the operating system. Runs from the media and only a ''/var/'' is created on disk. The system itself will run from a ''tmpfs'' (RAM). Use this mode if you only want to use the disk(s) for data, like ''mailspool'', ''databases'', ''logs'', etc.<br />
<br />
'''diskless:''' No disks are to be used. [[Alpine local backup]] may still be used in this mode.<br />
<br />
These modes are explained further on the [[Installation#Installation_Overview|'''Installation''']] page.<br />
<br />
== How do I upgrade Alpine? ==<br />
<br />
To upgrade to a new stable release or edge:<br />
<code>apk upgrade --available</code><br />
<br />
==Why don't my cron jobs run?==<br />
<br />
Start service ''crond'' and add it to runlevel:<br />
<br />
: {{cmd|rc-service crond start && rc-update add crond}}<br />
<br />
After that the cron daemon is started automatically on system boot and executes the scripts placed in the folders under ''/etc/periodic/'' - there are folders for ''15min'', ''hourly'', ''daily'', ''weekly'' and ''monthly'' scripts.<br />
<br />
To check whether your scripts are likely to run, use the ''run-parts'' command, for example:<br />
<br />
: {{cmd|run-parts --test /etc/periodic/15min}}<br />
<br />
This command will tell you what should run but will not actually execute the scripts.<br />
<br />
If the results of the test are not as expected, check the following:<br />
<br />
* Make sure the script is executable - if unsure, issue the command {{cmd|chmod +x /etc/periodic/[path/scriptname]}}<br />
* Make sure the first line of your script is <code>#!/bin/sh</code><br />
* Do not use periods on your script file names - this stops them from working; for example: {{Path|/etc/periodic/daily/myscript}} will run, but {{Path|/etc/periodic/daily/myscript.sh}} won't.<br />
<br />
= Time and timezones =<br />
<br />
== How do I set the local timezone? ==<br />
<br />
If you wish to edit the ''timezone'' (TZ) after installation, run the [[Alpine_setup_scripts#setup-timezone|setup-timezone]] script.<br />
<br />
= Packages =<br />
<br />
== Can you build an APK package for ...? ==<br />
Please create an [https://gitlab.alpinelinux.org/alpine/aports/issues/new issue] in the [https://gitlab.alpinelinux.org bugtracker]. Prefix it with "package request:" in the title and include a short description (one-line), a URL for the home page, why you need it, and a URL for the source package.<br />
<br />
== How can I build my own package? ==<br />
Please see the [[Creating an Alpine package]] page.<br />
<br />
== What does "required by: world[$pkgname]" mean? ==<br />
<br />
It means that the package you tried to install does not exist in the repositories you have configured. <br />
<br />
Maybe you forgot to add community, testing or unmaintained to ''/etc/apk/repositories''? <br />
<br />
Or is the package in a [[Alpine_Linux_package_management#Repository_pinning|pinned repository]] and you forgot to suffix the package with the repo tag? Example:<br />
<br />
{{cmd|apk add experimental-package@testing}}<br />
<br />
== How can I find out if a certain package exists in Alpine? ==<br />
<br />
If you want to only search repositories you have configured in /etc/apk/repositories, then <code>apk search $pkgname</code> should get you sorted. If you want to search all repositories have a look at the [https://pkgs.alpinelinux.org/ online pkg oracle]<br />
<br />
== WARNING: Ignoring APKINDEX.xxxx.tar.gz ==<br />
If you get <code>WARNING: Ignoring APKINDEX.xxxx.tar.gz: No such file or directory</code> while running [[Alpine_Linux_package_management|package related tools]], check your {{Path|/etc/apk/repositories}} file.<br />
<br />
To check the content of the repositories file<br />
{{Cmd|cat /etc/apk/repositories}}<br />
<br />
or <br />
{{Cmd|setup-apkrepos}}<br />
<br />
= Dynamic DNS =<br />
== How do I schedule a regular dynamic DNS update? ==<br />
You'll want to install the {{pkg|ez-ipupdate}} package:<br />
{{cmd|apk add ez-ipupdate}}<br />
<br />
After that, create a new file at {{path|/etc/ez-ipupdate.conf}} with contents similar to:<br />
service-type=dyndns<br />
user=myusername:mypassword<br />
interface=eth1<br />
host=myhostname.dyndns.org<br />
<br />
Make the new ip cache directory:<br />
{{cmd|mkdir /var/cache/ez-ipupdate<br />
lbu add /var/cache/ez-ipupdate}}<br />
<br />
Then schedule a new cron job with this command:<br />
{{cmd|echo >> /var/log/ez-ipupdate && \<br />/bin/date >> /var/log/ez-ipupdate && \<br />ez-ipupdate --config-file /etc/ez-ipupdate.conf -f -F /var/run/ez-ipupdate.pid \<br /> --cache-file /var/cache/ez-ipupdate/ipcache --quiet >> /var/log/ez-ipupdate 2>&1}}<br />
<br />
Don't forget to backup your settings!<br />
{{cmd|lbu ci}}<br />
<br />
= Terminal =<br />
<br />
== How to enable/fix colors for git? ==<br />
<br />
The problem is not in git itself or terminal, but in the <tt>less</tt> command.<br />
Busybox’s <tt>less</tt> doesn’t support <tt>-r</tt> (<tt>--raw-control-chars</tt>) and <tt>-R</tt> (<tt>--RAW-CONTROL-CHARS</tt>) options.<br />
<br />
The simplest (yet not ideal) solution is to install GNU less:<br />
<br />
{{cmd|apk add less}}<br />
<br />
== Fix lacking lsusb / lspci output ==<br />
<br />
If you launch <code>lsusb</code> or <code>lspci</code> on a minimal installation, there's no device descriptions, and the latter doesn't exist.<br />
This can be fixed by installing the hwdata tables, '''hwdata-uwb''' or '''hwdata-pci''' respectively. For <code>lspci</code>, add '''pciutils'''.<br />
<br />
= Old questions, no longer frequently asked =<br />
<br />
== Alpine freezes during boot from Compact Flash, how can I fix? ==<br />
Most Compact Flash card readers do not support proper DMA.<br /><br />
You should append '''nodma''' to the ''append'' line in {{path|syslinux.cfg}}.<br />
<br />
== How do I remove the CD-ROM? ==<br />
Since the modloop loopback device is on CD-ROM you cannot just run <code>eject</code>. You need to unmount the modloop first.<br /><br />
Unmounting both the modloop and the CDROM in one step can be done by executing:<br />
{{Cmd|/etc/init.d/modloop stop}}<br />
<br />
Then it's possible to eject the CD-ROM:<br />
{{Cmd|eject}}<br />
<br />
== How can I install custom firmware in a diskless system? ==<br />
<br />
The modules and firmware are both special images which are mounted as read-only.<br /><br />
To fix this issue you can copy the firmware directory to your writeable media (cf/usb) and copy your custom firmware to it.<br /><br />
After reboot Alpine should automatically use the directory on your local storage instead of the loopback device.<br />
<br />
== OpenNTPD reports an error with "adjtime" ==<br />
Your log contains something like:<br />
reply from 85.214.86.126: offset 865033148.784255 delay 0.055466, next query 32s<br />
reply from 202.150.212.24: offset 865033148.779314 delay 0.400771, next query 3s<br />
adjusting local clock by 865033148.779835s <br />
adjtime failed: Invalid argument <br />
<br />
{{pkg|openntpd}} is supposed to make small adjustments in the time without causing time jumps.<br /><br />
If the adjustment is too big then something is clearly wrong and ntpd gives up. (its actually adjtime(3) that has a limit on how big adjustments are allowed)<br />
<br />
You can make ntpd set the time at startup by adding ''-s'' option to ntpd. This is done by setting '''NTPD_OPTS="-s"''' in {{path|/etc/conf.d/ntpd}}.<br />
<br />
== Using a cron job to keep the time in sync ==<br />
Add the following to {{path|/etc/periodic/daily}} (or use another folder under the {{path|/etc/periodic}} hierarchy if you want to run the script more/less frequently)<br />
<br />
Example: file called {{path|do-ntp}}<br />
<pre><br />
#!/bin/sh<br />
ntpd -d -q -n -p uk.pool.ntp.org</pre><br />
<br />
This queries the uk time server pool - you can modify this to suit your localisation, or just use ''pool.ntp.org''. More info here: [http://www.pool.ntp.org/zone/@ http://www.pool.ntp.org/zone/@]<br />
<br />
== Windows clients reports an error when trying to sync ==<br />
{{pkg|openntpd}} needs to run for a while before it is satisfied it is in sync.<br />
Until then it will set a flag "clock not synchronized" and Windows will report an error while trying to sync with your {{pkg|openntpd}} server.<br />
<br />
Only thing to do is wait, do something else for 15-20mins and then check.<br />
<br />
<br />
[[Category:Newbie]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Steam&diff=23818Steam2023-07-23T18:36:32Z<p>Psykose: use unified dbus instructions instead of copying more things</p>
<hr />
<div>[http://store.steampowered.com/about/ Steam] is a popular game distribution platform by Valve.<br />
<br />
{{Note|Steam for Linux only supports Ubuntu LTS. Thus, do not turn to Valve for support for issues with Steam on Alpine Linux.}}<br />
<br />
== Installation ==<br />
<br />
Steam requires glibc to run, and thus doesn't straight up run on Alpine Linux.<br />
To work around this problem, we'll use [https://wiki.alpinelinux.org/wiki/Flatpak Flatpak].<br />
Make sure you have the Flathub repository installed.<br />
<br />
# apk add flatpak<br />
$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo<br />
$ flatpak install com.valvesoftware.Steam<br />
<br />
After installation Steam can be started using it's .desktop file or on the command line:<br />
<br />
$ flatpak run com.valvesoftware.Steam<br />
<br />
== Troubleshooting ==<br />
<br />
=== My controllers aren't detected ===<br />
<br />
By default Steam doesn't have permission to read your controllers.<br />
This can be fixed by installing an udev rule from the official Steam package, but the udev rules are also available as an Alpine package.<br />
<br />
# apk add steam-devices<br />
<br />
=== SteamVR won't launch ===<br />
<br />
Out of the box SteamVR might not be able to launch and give you various errors. Steam tries to fix this itself by setting the right capabilities on the SteamVR binary, but this doesn't work in the Flatpak. Instead we'll have do it manually.<br />
<br />
# setcap CAP_SYS_NICE+ep ~/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher<br />
<br />
Then restart Steam.<br />
<br />
There is an issue for this [https://github.com/flathub/com.valvesoftware.Steam/issues/636#issuecomment-779763326 on the Flathub repository].<br />
<br />
=== Steam - Error: OpenGL GLX extension not supported by display ===<br />
<br />
Add the Mesa gallium driver and reboot your system.<br />
<br />
# apk add mesa-dri-gallium<br />
<br />
=== eventfd: Too many open files ===<br />
<br />
Due to a low amount of allowed open file descriptors, Proton games may crash shortly after launching. This can be worked around by disabling esync but many games will perform measurably worse without it. Instead, user limits should be increased. In order to do this, you will need [[PAM]] and a PAM enabled login.<br />
<br />
Add the following to <code>/etc/security/limits.conf</code>:<br />
@users hard nofile 524288<br />
<br />
{{Note|Although you should already belong to the users group, you can run <code>groups</code> to check.}}<br />
<br />
Reboot and run <code>ulimit -Hn</code> to verify the new limits are applied.<br />
<br />
=== dbus-launch: no such file or directory ===<br />
<br />
Set up [https://wiki.alpinelinux.org/wiki/D-Bus dbus] for your session.<br />
<br />
=== Steam games launched via Proton crash before creating a window ===<br />
<br />
See [[Sway#Steam_games_launched_via_Proton_crash_before_creating_a_window]].<br />
<br />
[[Category:Gaming]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Install_Alpine_on_LXC&diff=23810Install Alpine on LXC2023-07-18T13:49:53Z<p>Psykose: dl-cdn</p>
<hr />
<div>== LXC ==<br />
<br />
[https://en.wikipedia.org/wiki/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.<br />
<br />
With LXC you can run Alpine Linux on container and start services in it using native Alpine Linux' init system (openrc).<br />
<br />
This is instruction on how to install Alpine Linux on LXC container.<br />
<br />
== Preparation ==<br />
<br />
=== LXC installation ===<br />
You have to install "lxc" package on your host system. For example, in Arch Linux you can install it by running:<br />
{{Cmd|sudo pacman -S lxc}}<br />
<br />
=== Bridge creation ===<br />
You also have to create network bridge on your host.<br />
<br />
[https://wiki.archlinux.org/index.php/Network_bridge Setting up bridge in Arch Linux or Arch Linux based systems]<br />
<br />
[https://help.ubuntu.com/community/NetworkConnectionBridge Setting up bridge in Ubuntu or Ubuntu based systems]<br />
<br />
Here is example, how to setup bridge with netctl:<br />
<br />
Copy sample file "bridge"<br />
{{Cmd|sudo cp /etc/netctl/examples/bridge /etc/netctl/myBridge}}<br />
<br />
Modify your bridge configuration file as needed (network interfaces: eno1 and tap0 are, of cource, according to your needs)<br />
{{Cmd|sudo vim /etc/netctl/myBridge}}<br />
<pre><br />
Description="Bridge connection"<br />
Interface=br0<br />
Connection=bridge<br />
BindsToInterfaces=(eno1 tap0)<br />
IP=dhcp<br />
</pre><br />
<br />
Stop active connection<br />
{{Cmd|sudo systemctl stop dhcpcd}}<br />
<br />
Start your bridge <br />
{{Cmd|sudo netctl start myBridge}}<br />
<br />
Perhaps you may wish to setup your system to start your bridge automatically at boot time.<br />
<br />
== Container creation ==<br />
<br />
To install Alpine Linux edge version run:<br />
{{Cmd|sudo lxc-create --name alpine-edge -t alpine -- --release edge}}<br />
<br />
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<br />
{{Cmd|sudo mkdir /var/lib/lxc/alpine-edge/rootfs/media/d}}<br />
<br />
Modify container's configuration file:<br />
{{Cmd|sudo nano /var/lib/lxc/alpine-edge/config}}<br />
<br />
Add folowing lines:<br />
<pre><br />
lxc.network.type = veth<br />
lxc.network.flags = up<br />
lxc.network.link = br0<br />
lxc.mount.entry=/media/d media/d none bind 0 0<br />
</pre><br />
<br />
Booting container:<br />
{{cmd|sudo lxc-start -n alpine-edge}}<br />
<br />
Shutting down container:<br />
{{cmd|sudo lxc-stop -n alpine-edge}}<br />
<br />
Going to Alpine Linux console:<br />
{{cmd|sudo lxc-attach -n alpine-edge}}<br />
<br />
== Container setup ==<br />
<br />
Modify your apk/repositories configuration file<br />
{{cmd|vi /etc/apk/repositories}}<br />
<br />
It is recommended to include "main", "testing" and "community" repositories.<br />
<pre><br />
http://dl-cdn.alpinelinux.org/alpine/edge/main<br />
http://dl-cdn.alpinelinux.org/alpine/edge/testing<br />
http://dl-cdn.alpinelinux.org/alpine/edge/community<br />
</pre><br />
<br />
Upgrading your Alpine Linux system:<br />
{{cmd|apk update && apk upgrade -a}}<br />
<br />
Starting services:<br />
{{Cmd|/etc/init.d/service_name start}}<br />
or<br />
{{Cmd|rc-service service_name start}}<br />
<br />
Adding services to autostart<br />
{{Cmd|rc-update add service_name}}<br />
<br />
Restarting your container:<br />
{{Cmd|reboot}}<br />
<br />
[[Category:Virtualization]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Setting_up_unbound_DNS_server&diff=23809Setting up unbound DNS server2023-07-18T13:49:23Z<p>Psykose: dl-cdn</p>
<hr />
<div>[http://unbound.net/ Unbound] is a validating, recursive, and caching DNS resolver that supports DNSSEC.<br />
<br />
= Install =<br />
<br />
Install the {{Pkg|unbound}} package:<br />
{{Cmd|apk add unbound}}<br />
<br />
= Configure =<br />
<br />
The following configuration is an example of a caching name server (in a production server, it's recommended to adjust the access-control parameter to limit access to your network). The forward-zone(s) section will forward all DNS queries to the specified servers. Don't forget to change the 'interface' parameter to that of your local interface IP address (or 0.0.0.0 to listen on all local IPv4 interfaces). The following is a minimal example with many options commented out.<br />
<br />
{{Path|/etc/unbound/unbound.conf}}<br />
<pre><br />
server:<br />
verbosity: 1<br />
## Specify the interface address to listen on:<br />
interface: 10.0.0.1<br />
## To listen on all interfaces use:<br />
# interface: 0.0.0.0<br />
do-ip4: yes<br />
do-ip6: yes<br />
do-udp: yes<br />
do-tcp: yes<br />
do-daemonize: yes<br />
access-control: 0.0.0.0/0 allow<br />
## Other access control examples<br />
#access-control: 192.168.1.0/24 action<br />
## 'action' should be replaced by any one of:<br />
#deny (drop message)<br />
#refuse (sends a DNS rcode REFUSED error message back)<br />
#allow (recursive ok)<br />
#allow_snoop (recursive and nonrecursive ok).<br />
## Minimum lifetime of cache entries in seconds. Default is 0.<br />
#cache-min-ttl: 60<br />
## Maximum lifetime of cached entries. Default is 86400 seconds (1 day).<br />
#cache-max-ttl: 172800<br />
## enable to prevent answering id.server and hostname.bind queries. <br />
hide-identity: yes<br />
## enable to prevent answering version.server and version.bind queries. <br />
hide-version: yes<br />
## default is to use syslog, which will log to /var/log/messages.<br />
use-syslog: yes<br />
## to log elsewhere, set 'use-syslog' to 'no' and set the log file location below:<br />
#logfile: /var/log/unbound<br />
python:<br />
remote-control:<br />
control-enable: no<br />
## Stub zones are like forward-zones (see below) but must contain only the authority server (no recursive servers)<br />
#stub-zone: <br />
# name: "my.test.com"<br />
# stub-addr: 172.16.1.1<br />
# stub-addr: 172.16.1.2<br />
## Note: for forward-zones, the destination servers must be able to handle recursion to other DNS servers<br />
## Forward all *.example.com queries to the server at 192.168.1.1<br />
#forward-zone:<br />
# name: "example.com"<br />
# forward-addr: 192.168.1.1<br />
## Forward all other queries to the Verizon DNS servers<br />
forward-zone: <br />
name: "."<br />
## Level3 Verizon<br />
forward-addr: 4.2.2.1<br />
forward-addr: 4.2.2.4<br />
</pre><br />
<br />
== root-hints ==<br />
Instead of forwarding queries to a public DNS server, you may prefer to query the root DNS servers. To do this, comment out the forwarding entries ("forward-zone" sections) in the config. Then, grab the latest root hints file using wget:<br />
{{Cmd|wget -S https://www.internic.net/domain/named.cache -O /etc/unbound/root.hints}}<br />
And finally point unbound to the root hints file by adding the following line to the server section of the unbound config file:<br />
<pre><br />
root-hints: "/etc/unbound/root.hints"<br />
</pre><br />
Restart unbound to ensure the changes take effect. You may wish to setup a [[FAQ#My cron jobs don.27t run.3F|cron job]] to update the root hints file occasionally.<br />
<br />
== 0x20 bit ==<br />
Use of the [https://tools.ietf.org/html/draft-vixie-dnsext-dns0x20-00.html 0x20 bit] is considered experimental. It makes use of an otherwise unused bit in a DNS packet to ask an authoritative server to respond with an answer mimicking the case used in the query.<br />
<br />
For example, when using this feature a query for www.google.com could appear in the request as www.google.com or Www.GoogLe.coM or WWW.GoOGlE.cOm or any other conbination of upper and lower case. The authoritative server should respond with the same case. This helps prevent DNS spoofing attacks. <br />
<br />
In some cases a very small number of old or misconfigured servers may return an error (less than 1% of servers will respond incorrectly). To turn on this feature, simply add the following line to the 'server' section of {{Path|/etc/unbound/unbound.conf}} and restart the server:<br />
<pre><br />
use-caps-for-id: yes<br />
</pre><br />
<br />
= Set auto-start, start and test the daemon =<br />
<br />
Check the configuration for errors:<br />
{{Cmd|unbound-checkconf}}<br />
if no errors are reported, set to auto-start then start unbound:<br />
{{Cmd|rc-update add unbound<br />
rc-service unbound start}}<br />
Test. For example:<br />
{{Cmd|dig dl-cdn.alpinelinux.org @10.0.0.1}}<br />
or:<br />
{{Cmd|nslookup www.google.cz 10.0.0.1}}<br />
or use {{Pkg|drill}}: <br />
{{Cmd|drill www.bbc.co.uk @10.0.0.1}}<br />
<br />
= Additional information =<br />
unbound.conf man page [http://linux.die.net/man/5/unbound.conf here] or [http://unbound.net/documentation/unbound.conf.html here]<br />
<br />
[http://unbound.net/documentation/howto_optimise.html unbound optimization guide]<br />
<br />
[https://calomel.org/unbound_dns.html excellent unbound tutorial at calomel.org]<br />
<br />
General information via the Wikipedia pages on [https://en.wikipedia.org/wiki/Domain_Name_System DNS], [https://en.wikipedia.org/wiki/List_of_DNS_record_types record types], [https://en.wikipedia.org/wiki/Dns_zone zones], [https://en.wikipedia.org/wiki/Name_server name servers] and [https://en.wikipedia.org/wiki/Dnssec DNSsec] <br />
<br />
[[Category:Networking]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Replacing_non-Alpine_Linux_with_Alpine_remotely&diff=23808Replacing non-Alpine Linux with Alpine remotely2023-07-18T13:49:08Z<p>Psykose: dl-cdn</p>
<hr />
<div>{{obsolete}}<br />
* What: These instructions are for installing Alpine Linux on a hosted ''physical'' server from a hosting company like serverpronto, bluehost, etc.<br />
* Why: Typically these companies run Debian, Fedora, or another Linux distribution. This document explains how to get Alpine Linux on a machine with nothing but ssh access.<br />
<br />
== With VNC access ==<br />
{{Note|Usually providers offer vnc access to the server, if that's not the case skip this.}}<br />
Download an alpine iso that boots from ram, e.g. alpine-virt<br />
wget dl-cdn.alpinelinux.org/alpine/v3.5/releases/x86_64/alpine-virt-3.5.2-x86_64.iso<br />
Flash the image to the drive of your server, e.g. /dev/sda<br />
dd if=alpine-virt-3.5.2-x86_64.iso of=/dev/sda<br />
Reboot, and login again from vnc with root. Alpine is now running from ram, and should have mounted /dev/sda on /media/sda, paste it into ram.<br />
mkdir /media/setup<br />
cp -a /media/sda/* /media/setup<br />
Copy also the kernel modules which are located in /.modloop<br />
mkdir /lib/setup<br />
cp -a /.modloop/* /lib/setup<br />
Unmount modloop and the media folder<br />
/etc/init.d/modloop stop<br />
umount /dev/sda<br />
Move back the files in place<br />
mv /media/setup/* /media/sda/<br />
mv /lib/setup/* /.modloop/<br />
Finally you can format the disk to install alpine<br />
setup-disk<br />
Or just run the the whole setup<br />
setup-alpine<br />
<br />
== Without VNC access ==<br />
<br />
{{Note|This process will not work with alpine-1.9.0_rc4 or ''earlier''''' Use Alpine-1.9.1 or later for best results.}}<br />
<br />
{{Warning| Practice on a computer with physical access first. If something goes wrong, the remote box will very likely be left in an unusable state. In that case, you get to turn in a support request to regen the server back to "factory fresh" mode.}}<br />
<br />
{{Warning|Really. Practice this first.}}<br />
<br />
Prerequisites:<br />
* SSH access to the remote box (needs to have SSH server running)<br />
* Alpine Linux supported hardware<br />
* Adventurous mind<br />
* Nerves of steel<br />
<br />
These instructions are based on a debian (physical) server, and all steps are performed while logged into the machine. So you should start with a machine that has ssh running.<br />
<br />
== Create apk overlay suitable for hard disk based tmpfs boot ==<br />
<br />
{{Note|This entire section can be replaced by setting up a box from scratch, using setup-alpine and selecting 'none' for the install disk, then running 'lbu ci' to save the apkovl. You can then open the overlay and set up networking ''exactly'' as it should be on the target box, then repackage the overlay and drop in the root of alpine_dev on the remote host.)}}<br />
<br />
The first step is to create Alpine configuration file with basic configuration of the host. We need the new box to start networking and ssh in the beginning so we can reconnect to it after reboot.<br />
<br />
Create basic layout for the overlay:<br />
mkdir overlay<br />
cd overlay<br />
mkdir -p etc/ssh etc/network etc/runlevels/{default,boot,sysinit,shutdown} root/.ssh etc/lbu<br />
<br />
You can also use default Alpine configuration files. In this case you should use ssh key to authorize yourself (as root password is empty, and ssh has empty passwords disabled).<br />
<br />
If you want to keep the existing host identity (e.g. SSH key), you can copy them over:<br />
<br />
cp -a /etc/{passwd,group,shadow,gshadow,hostname,resolv.conf,network/interfaces,ssh} etc/<br />
cp /etc/network/interfaces etc/network<br />
<br />
Copy over your ssh authorized_keys and make sure its included in future:<br />
cp -a /root/.ssh/authorized_keys root/.ssh<br />
echo "/root/.ssh" > etc/lbu/include<br />
<br />
Find out which shell is used for root:<br />
<br />
grep ^root /etc/passwd<br />
<br />
If its /bin/ash, you are good. If not, edit etc/passwd and change it to /bin/ash.<br />
sed -i -e '/^root:/s:/bin/bash:/bin/ash:' etc/passwd<br />
<br />
{{Note|If you don't do this, nobody (even with physical access) will be able to log into the machine.}}<br />
<br />
Create etc/network/interfaces with network configuration (unless it was previously copied over). It should look something like:<br />
auto lo<br />
iface lo inet loopback<br />
<br />
auto eth0<br />
iface eth0 inet static<br />
address ip.ad.dr.es<br />
netmask 255.255.255.0<br />
gateway gw.ad.dr.es<br />
<br />
Since Alpine 3.13 must be:<br />
auto lo<br />
iface lo inet loopback<br />
<br />
auto eth0<br />
iface eth0 inet static<br />
address ip.ad.dr.es/cidr<br />
gateway gw.ad.dr.es<br />
'''Make sure there is no whitespace at end of lines''' in interfaces file. Busybox ifup is very picky.<br />
<br />
Make sure your etc/resolv.conf exists; if not create etc/resolv.conf with the nameserver configuration like:<br />
nameserver dns.ip.ad.dr<br />
options edns0 trust-ad single-request-reopen<br />
<br />
Create the apk world (etc/apk/world) with essential packages:<br />
mkdir -p etc/apk<br />
echo "alpine-base iproute2 openssh" > etc/apk/world<br />
<br />
'''Double check the IP configuration and ssh keys.'''<br />
<br />
Finally, make the essential services start up automatically and create the overlay file:<br />
ln -s /etc/init.d/{hwclock,modules,sysctl,hostname,bootmisc,syslog} etc/runlevels/boot/<br />
ln -s /etc/init.d/{devfs,dmesg,mdev,hwdrivers} etc/runlevels/sysinit/<br />
ln -s /etc/init.d/{networking,sshd} etc/runlevels/default/<br />
ln -s /etc/init.d/{mount-ro,killprocs,savecache} etc/runlevels/shutdown/<br />
tar czf ../host.apkovl.tar.gz *<br />
<br />
Verify the overlay with "tar tzf" to see that it contains everything in proper places, and ensure it is in the / directory<br />
<br />
tar tzvf host.apkovl.tar.gz<br />
cp host.apkovl.tar.gz /<br />
<br />
== Install Alpine cd-rom image on hard disk ==<br />
<br />
We need to copy over two sets of information: the boot kernel (kernel, initramdisk and boot configuration) and operating system boot data (overlay, apk packages and kernel modules). These can reside on same partition if they fit. However, /boot is usually small, so you might want to put the apks on separate partition. This guide assumes they are on sda1 (/boot) and sda2 (/) with both having ext3 filesystems. If you don't have ext3 on / or /boot, then you might be able to disable swap and reformat the swap partition as ext3 and use that.<br />
<br />
Download an alpine iso and mount it; for example<br />
<br />
wget {{#latestalp:alpine|url}}<br />
mount alpine*.iso /cdrom -o loop<br />
<br />
Copy the apkovl and the contents of cd-rom image to root of current installation:<br />
cp host.apkovl.tar.gz /<br />
cp -a /cdrom/* /<br />
<br />
Next we make the Alpine Linux kernel bootable (requires syslinux) and use fdisk to mark the /boot partition as bootable (if not done already):<br />
dd if=/usr/share/syslinux/mbr.bin of=/dev/sda # on some older systems its /usr/lib/syslinux/mbr.bin<br />
fdisk /dev/sda<br />
<br />
Make sure that /boot dir has a symlink pointing to itself. This is to handle the case when /boot is on separate partition.<br />
ln -sf . /boot/boot<br />
<br />
Create /boot/extlinux.conf with contents like (check the filesystem type for alpine_dev; kernel and initrd are relative to partition root):<br />
timeout 20<br />
prompt 1<br />
default grsec<br />
label grsec<br />
kernel /boot/grsec<br />
append initrd=/boot/grsec.gz alpine_dev=sda2:ext3 modloop=grsec.cmg modules=loop,cramfs,sd-mod,usb-storage,ext3 quiet<br />
<br />
From Alpine Linux 2.1 you can use the UUID of the partition that holds the apkovl and the ''apks'' directory, the current root. Use ''blkid'' to get the proper UUID. By using UUID we solve the problem when there are multiple disks and we don't knowing how kernel enumerates them after boot. Example extlinux.conf:<br />
timeout 20<br />
prompt 1<br />
default grsec<br />
label grsec<br />
kernel /boot/grsec<br />
append initrd=/boot/grsec.gz alpine_dev=UUID=44ea33e2-deb4-4a29-88e2-fc8a4ef80ab0:ext3 modloop=grsec.cmg modules=loop,cramfs,sd-mod,usb-storage,ext3 quiet<br />
<br />
[Comment added by IceCodeNew]<br />
<br />
I tried this instruction on Ubuntu 20.04, and I'm installing Alpine-virt 3.13.2.<br />
<br />
I found there is no such file named `*/syslinux/mbr.bin`, but even if I skip the step which issuing `dd if=/usr/share/syslinux/mbr.bin of=/dev/sda`, the machine was able to boot alpine without problem.<br />
<br />
Here is the extlinux.conf I use (since there are lots of files that had been renamed): <br />
timeout 20<br />
prompt 1<br />
default grsec<br />
label grsec<br />
kernel /boot/vmlinuz-virt<br />
append initrd=/boot/initramfs-virt alpine_dev=UUID=db153994-91fe-426f-bd88-f751e07f97f2:ext4 modloop=/boot/modloop-virt modules=loop,cramfs,sd-mod,usb-storage,ext4 quiet<br />
<br />
[End of comment]<br />
<br />
Finally make the /boot partition bootable by extlinux.<br />
extlinux -i /boot<br />
<br />
<br />
(Tested on 2.1.2 and higher) Make sure:<br />
* grsec.cmg is on /<br />
* [something].apkovl.tar.gz is on /<br />
* grsec.gz is on /boot<br />
* The apline_dev UUID value points to whatever is currently /<br />
* the partition for /boot is flagged as bootable<br />
* the output of extlinux was for the partition currently mounted at /boot<br />
<br />
== Install Alpine on hard-disk ==<br />
<br />
Reboot the box. And wait for it to come alive again. If it doesn't, tough luck. So dry practice with local box, with as identical hardware as possible.<br />
<br />
Once back in the box, we are running in Alpine Linux from tmpfs. So just do a regular installation of Alpine from network via ssh connection.<br />
<br />
Edit /etc/apk/repositories to contain your favorite Alpine mirror or just:<br />
http://dl-3.alpinelinux.org/alpine/v1.10/packages/main<br />
<br />
Finally run:<br />
/etc/init.d/modloop stop<br />
apk update<br />
setup-disk<br />
<br />
After hard disk setup is complete, '''copy ssh_authorized_keys to hard disk'''.<br />
<br />
Reboot once more, and you have the server with native Alpine hard disk installation.<br />
<br />
[[Category:Installation]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Alpine_Package_Keeper&diff=23807Alpine Package Keeper2023-07-18T13:48:43Z<p>Psykose: remove bad advice, use non-deprecated mirror</p>
<hr />
<div><!--For searching: apk, APK--><br />
<br />
{{TOC right}}<br />
<br />
Because Alpine Linux is designed to run from RAM, package management involves two phases:<br />
* Installing / Upgrading / Deleting packages on a running system.<br />
* Restoring a system to a previously configured state (e.g. after reboot), including all previously installed packages and locally modified configuration files. '''(RAM-Based Installs Only)'''<br />
<br /><br />
'''apk''' is the tool used to install, upgrade, or delete software on a running system.<br /><br />
'''lbu''' is the tool used to capture the data necessary to restore a system to a previously configured state.<br />
<br />
This page documents the [https://git.alpinelinux.org/apk-tools/ apk tool] - See the [[Alpine_local_backup|Alpine Local Backup page]] for the lbu tool.<br />
<br />
= Overview =<br />
<br />
The '''apk''' tool supports the following operations:<br />
<br />
{|<br />
| [[#Add a Package|add]] <br />
| Add new packages or upgrade packages to the running system<br />
|-<br />
| [[#Remove a Package|del]]<br />
| Delete packages from the running system<br />
|-<br />
| fix <br />
| Attempt to repair or upgrade an installed package <br />
|-<br />
| [[#Update the Package list|update]] <br />
| Update the index of available packages<br />
|-<br />
| [[#Information on Packages|info]]<br />
| Prints information about installed or available packages<br />
|-<br />
| [[#Search for Packages|search]] <br />
| Search for packages or descriptions with wildcard patterns<br />
|-<br />
| [[#Upgrade a Running System|upgrade]]<br />
| Upgrade the currently installed packages<br />
|-<br />
| [[#Cache maintenance|cache]]<br />
| Maintenance operations for locally cached package repository<br />
|-<br />
| version <br />
| Compare version differences between installed and available packages<br />
|-<br />
| index <br />
| create a repository index from a list of packages<br />
|-<br />
| fetch <br />
| download (but not install) packages<br />
|-<br />
| audit <br />
| List changes to the file system from pristine package install state<br />
|-<br />
| verify <br />
| Verify a package signature<br />
|- <br />
| dot<br />
| Create a [http://graphviz.org/ graphviz] graph description for a given package<br />
|- <br />
| [[#apk_policy|policy]]<br />
| Display the repository that updates a given package, plus repositories that also offer the package<br />
|- <br />
| stats <br />
| Display statistics, including number of packages installed and available, number of directories and files, etc.<br />
|- <br />
| manifest<br />
| Display checksums for files contained in a given package<br />
|}<br />
<br />
= Packages and Repositories =<br />
<br />
Software packages for Alpine Linux are digitally signed tar.gz archives containing programs, configuration files, and dependency metadata. They have the extension <code>.apk</code>, and are often called "a-packs".<br />
<br />
The packages are stored in one or more ''repositories''. A repository is simply a directory with a collection of *.apk files. The directory must include a special index file, named {{Path|APKINDEX.tar.gz}} to be considered a repository.<br />
<br />
The '''apk''' utility can install packages from multiple repositories. The list of repositories to check is stored in {{Path|/etc/apk/repositories}}, one repository per line. If you booted from a USB stick ({{Path|/media/sda1}}) or CD-ROM ({{Path|/media/cdrom}}), your repository file probably looks something like this:<br />
<br />
{{Cat|/etc/apk/repositories|/media/sda1/apks/}}<br />
<br />
In addition to local repositories, the '''apk''' utility uses '''busybox wget''' to fetch packages using ''http:'', ''https:'', ''ftp:'' or ''rsync:'' protocols. The following is a valid repository file:<br />
<br />
{{Cat|/etc/apk/repositories|<br />
/media/sda1/apks<br />
http://dl-3.alpinelinux.org/alpine/v2.6/main<br />
https://dl-3.alpinelinux.org/alpine/v2.6/main<br />
ftp://dl-3.alpinelinux.org/alpine/v2.6/main<br />
}}<br />
<br />
{{Note| A list of public repositories is in [https://mirrors.alpinelinux.org/ mirrors.alpinelinux.org]. Accepted protocols vary.}}<br />
<br />
== Repository pinning ==<br />
<br />
You can specify additional "tagged" repositories in {{Path|/etc/apk/repositories}}:<br />
<br />
{{Cat|/etc/apk/repositories|<br />
http://dl-cdn.alpinelinux.org/alpine/v3.18/main<br />
http://dl-cdn.alpinelinux.org/alpine/v3.18/community<br />
@personal http:/personal-repo.example.com/alpine-apks/<br />
}}<br />
<br />
After which you can "pin" dependencies to these tags using:<br />
<br />
{{cmd|apk add application@personal}}<br />
<br />
apk will by default only use the untagged repositories, but adding a package with a @tag:<br />
<br />
1. will prefer the repository with that tag for the named package, even if a later version of the package is available in another repository<br />
<br />
2. ''allows'' pulling in dependencies for the tagged package from the tagged repository (though it ''prefers'' to use untagged repositories to satisfy dependencies if possible)<br />
<br />
== Commandline repository options ==<br />
<br />
By default, the '''apk''' utility will use the system repositories for all operations. This behavior can be overridden by the following options:<br />
<br />
{|<br />
| --repositories-file REPOFILE<br />
| Override the system repositories by specifying a repositories file.<br />
|-<br />
| <nowiki>-X|--repository REPO</nowiki><br />
| Specify a supplemental repository that will be used in addition to the system repositories. This option can be provided multiple times.<br />
|}<br />
<br />
= Update the Package list =<br />
<br />
Remote repositories change as packages are added and upgraded. To get the latest list of available packages, use the ''update'' command. The command downloads the {{Path|APKINDEX.tar.gz}} from each repository and stores it in the local cache, typically {{Path|/var/cache/apk/}}, {{Path|/var/lib/apk/}} or {{Path|/etc/apk/cache/}}.<br />
<br />
{{Cmd|apk update}}<br />
<br />
<!--<br />
fetch http://dl-3.alpinelinux.org/alpine/v2.1/main/APKINDEX.tar.gz<br />
--><br />
<br />
Adding the <code>--update-cache</code>, or for short <code>-U</code> switch to another apk command, as in <code>apk --update-cache upgrade</code> or <code>apk -U add ...</code>, the command has the same effect as first running <code>apk update</code> before the other apk command.<br />
<br />
{{Tip|With remote repositories, it is a good idea to always do an '''update''' right '''before''' doing an '''upgrade or add''' command. That way the command will install the latest available packages.}}<br />
<br />
= Add a Package =<br />
<br />
Use '''add''' to install packages from a repository. Any necessary dependencies are also installed. If you have multiple repositories, the '''add''' command installs the newest package.<br />
<br />
{{Cmd|apk add openssh<br />
apk add openssh openntp vim}}<br />
<br />
If you only have the main repository enabled in your configuration, apk will not include packages from the other repositories. To install a package from the edge/testing repository without changing your repository configuration file, use the command below. This will tell apk to use that particular repository.<br />
<br />
{{cmd|apk add cherokee --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ --allow-untrusted}}<br />
<br />
{{Note|Be careful when using third-party or the testing repository. Your system can go down.}}<br />
<br />
= Add a local Package =<br />
<br />
To install a locally available apk package, for example if this device has no internet access but you can upload apk packages directly to it, use the '''--allow-untrusted''' flag:<br />
<br />
{{cmd|apk add --allow-untrusted /path/to/file.apk}}<br />
<br />
Note that multiple packages can be given. When installing a local package, all dependencies should also be specified. For example:<br />
<br />
{{cmd|apk add --allow-untrusted /var/tig-2.2-r0.apk /var/git-2.11.1-20.apk}}<br />
<br />
= Remove a Package =<br />
Use '''del''' to remove a package (and dependencies that are no longer needed.) <br />
<br />
{{cmd|apk del openssh<br />
apk del openssh openntp vim}}<br />
<br />
= Upgrade a Running System =<br />
<br />
=== Packages in general ===<br />
<br />
To get the latest security upgrades and bugfixes available for the ''installed'' packages of a running system, first '''update''' the list of available packages and then '''upgrade''' the installed packages:<br />
<br />
{{cmd|apk update<br />
apk upgrade<br />
}}<br />
<br />
Or, combining the same into one single command:<br />
<br />
{{cmd|apk -U upgrade<br />
}}<br />
<br />
Here is an example, showing the procedure on a system that has several additional [[#Repository_pinning|repositories pinned]]:<br />
<br />
# apk update<br />
fetch <nowiki>http://dl-3.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz</nowiki><br />
fetch <nowiki>http://dl-3.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz</nowiki><br />
fetch <nowiki>http://dl-3.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz</nowiki><br />
fetch <nowiki>http://dl-3.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz</nowiki><br />
fetch <nowiki>http://dl-3.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz</nowiki><br />
v3.6.2-191-gf98d79930f <nowiki>[http://dl-3.alpinelinux.org/alpine/v3.6/main]</nowiki><br />
v3.6.2-190-ga5d68c47df <nowiki>[http://dl-3.alpinelinux.org/alpine/v3.6/community]</nowiki><br />
v3.6.0-4618-g0bf77c9821 <nowiki>[http://dl-3.alpinelinux.org/alpine/edge/main]</nowiki><br />
v3.6.0-4605-g85ed51dd83 <nowiki>[http://dl-3.alpinelinux.org/alpine/edge/community]</nowiki><br />
v3.6.0-4624-g11f1b9c8ab <nowiki>[http://dl-3.alpinelinux.org/alpine/edge/testing]</nowiki><br />
OK: 20118 distinct packages available<br />
<br />
# apk upgrade<br />
(1/2) Upgrading extra-cmake-modules@testing (5.38.0-r0 -> 5.39.0-r0)<br />
(2/2) Upgrading extra-cmake-modules-doc@testing (5.38.0-r0 -> 5.39.0-r0)<br />
Executing mdocml-apropos-1.14.1-r0.trigger<br />
OK: 2635 MiB in 803 packages<br />
<br />
To upgrade only ''specific'' packages, use the '''upgrade''' command and specify them:<br />
<br />
{{cmd|apk update<br />
apk upgrade busybox<br />
}}<br />
<br />
<br />
<br />
To enable unattended, automatic upgrades of packages, see the {{pkg|apk-autoupdate}} package.<br />
<br />
To upgrade to a newer release, refer to the corresponding release notes and [[Upgrading_Alpine]].<br />
<br />
=== Upgrading "diskless" and "data" disk mode installs ===<br />
<br />
If booting a "diskless" system from a read-only device, or iso image on writable media, it's not possible to update the boot files (kernel, modules, firmware, ...) that reside on that device.<br />
<br />
It becomes possible to update the boot files, though, if using a boot device that is writable and has been prepared with <code>[[Alpine_setup_scripts#setup-bootable|setup-bootable]]</code>.<br />
<br />
However, even then, the kernel, with its modules and firmware files, can still not be updated directly through regular packages updates. Instead, there is the <code>update-kernel</code> script that can generate initfs images and install them together with upgraded kernels.<br />
<br />
Upgrading can be done as follows.<br />
{{cmd|apk add mkinitfs<br />
}}<br />
This package is required for the generation of the initial filesystem used during boot.<br />
* Additional initfs features that are missing in the default configuration, like the [[Btrfs|btrfs]] filesystem support (at the time of writing, to allow loading .apkovl configs and package cache during boot), may be enabled in <code>/etc/mkinitfs/mkinitfs.conf</code>.<br />
* Available initfs features may be listed with <code>ls /etc/mkinitfs/features.d</code><br />
{{cmd|ls /etc/mkinitfs/features.d<br />
apk add nano<br />
nano /etc/mkinitfs/mkinitfs.conf<br />
lbu commit<br />
}}<br />
Finally update the kernel and its boot environment.<br />
{{cmd|update-kernel /media/sdXY/boot/<br />
}}<br />
* An <code>update-kernel</code> run needs at least 8 GB free ram memory to avoid a broken modloop-image.<br />
* See <code>update-kernel --help</code> for options to manually add additional module or firmware packages.<br />
<br />
= Search for Packages =<br />
The '''search''' command searches the repository Index files for installable packages. <br />
<br />
The return format is '''Package'''-'''Version'''. Omit '''Version''' for ''apk add '''Package'''''<br />
<br />
Examples:<br />
* To list all packages available, along with their descriptions: {{cmd|apk search -v}}<br />
* To list all packages are part of the ACF system: {{cmd|apk search -v 'acf*' }}<br />
* To list all packages that list NTP as part of their description, use the ''-d'' or ''--description'' option: {{cmd|apk search -v --description 'NTP' }}<br />
<br />
= Information on Packages =<br />
<br />
== apk info ==<br />
<br />
The '''info''' command provides information on the contents of packages, their dependencies, and which files belong to a package.<br />
<br />
For a given package, each element can be chosen (for example, ''-w'' to show just the webpage information), or all information displayed with the ''-a'' command.<br />
<br />
Example: {{cmd|apk info -a zlib}}<br />
<br />
'''zlib-1.2.5-r1 description:'''<br />
A compression/decompression Library<br />
<br />
'''zlib-1.2.5-r1 webpage:'''<br />
<nowiki>http://zlib.net</nowiki><br />
<br />
'''zlib-1.2.5-r1 installed size:'''<br />
94208<br />
<br />
'''zlib-1.2.5-r1 depends on:'''<br />
libc0.9.32<br />
<br />
'''zlib-1.2.5-r1 is required by:'''<br />
libcrypto1.0-1.0.0-r0<br />
apk-tools-2.0.2-r4<br />
openssh-client-5.4_p1-r2<br />
openssh-5.4_p1-r2<br />
libssl1.0-1.0.0-r0<br />
freeswitch-1.0.6-r6<br />
atop-1.25-r0 <br />
<br />
'''zlib-1.2.5-r1 contains:'''<br />
lib/libz.so.1.2.5<br />
lib/libz.so.1<br />
lib/libz.so <br />
<br />
'''zlib-1.2.5-r1 triggers:'''<br />
<br />
As shown in the example you can determine<br />
* The '''description''' of the package (''-d'' or ''--description'')<br />
* The '''webpage''' where the application is hosted (''-w'' or ''--webpage'')<br />
* The '''size''' the package will require once installed (in bytes) (''-s'' or ''--size'')<br />
* What packages are required to use this one ('''depends''') (''-R'' or ''--depends'')<br />
* What packages require this one to be installed ('''required by''') (''-r'' or ''--rdepends'')<br />
* The '''contents''' of the package, that is, which files it installs (''-L'' or ''--contents'')<br />
* Any '''triggers''' this package sets. (''-t'' or ''--triggers'') Listed here are directories that are watched; if a change happens to the directory, then the trigger script is run at the end of the apk add/delete. For example, doing a depmod once after installing all packages that add kernel modules.<br />
<br />
{{Tip|The '''info''' command is also useful to determine which package a file belongs to. For example: {{cmd|apk info --who-owns /sbin/lbu}} will display<br />
<br />
/sbin/lbu is owned by alpine-conf-x.x-rx<br />
}}<br />
<br />
=== Listing installed packages ===<br />
<br />
To list all installed packages, use:<br />
<br />
{{Cmd|apk info}}<br />
<br />
To list all installed packages in alphabetical order, with a description of each, do:<br />
<br />
{{Cmd|apk -vv info|sort}}<br />
<br />
The apk tool does not have a subcommand to list manually-installed packages that do not have reverse dependencies. To get this information on a traditional system that is not using [[Alpine local backup|lbu]], try this script. Note that this approach will also list core packages like alpine-base that should not be removed.<br />
<br />
<pre>#!/bin/sh<br />
apk info | grep -ve '-doc$' | sort | while read pkg<br />
do<br />
rdep=`apk info -qr "$pkg"`<br />
[ -z "$rdep" ] && echo $pkg<br />
done</pre><br />
<br />
== apk policy ==<br />
<br />
To display the repository a package was installed from and will be updated from, plus any [[#Repository_pinning|tagged]] or enabled repositories where it is also offered, if any, for this architecture - its '''policy''':<br />
<br />
{{Cmd|apk policy ''package''}}<br />
<br />
For example:<br />
<pre><br />
$ apk policy vlc<br />
vlc policy:<br />
2.2.6-r1:<br />
lib/apk/db/installed<br />
http://dl-3.alpinelinux.org/alpine/v3.7/community<br />
3.0.0_rc2-r1:<br />
@edgecommunity http://dl-3.alpinelinux.org/alpine/edge/community<br />
</pre><br />
<br />
= Additional apk Commands =<br />
In progress...<br />
<br />
= Local Cache =<br />
<br />
{{:Local_APK_cache}}<br />
<br />
= Advanced APK Usage =<br />
<br />
== Holding a specific package back ==<br />
<br />
In certain cases, you may want to upgrade a system, but keep a specific package at a back level. It is possible to add "sticky" or versioned dependencies. For instance, to hold the ''asterisk'' package to the 1.6.2 level or lower:<br />
{{cmd|1=apk add asterisk=1.6.0.21-r0}}<br />
or<br />
{{cmd|apk add 'asterisk<1.6.1'}}<br />
<br />
after which a {{cmd|apk upgrade}}<br />
<br />
will upgrade the entire system, keeping the asterisk package at the 1.6.0 or lower level<br />
<br />
To later upgrade to the current version,<br />
<br />
{{cmd|apk add 'asterisk>1.6.1'}}<br />
<br />
will ensure that 1.6.1 is the minimum version used.<br />
<br />
You can also use "fuzzy" version matching to pin the version to a major/minor release. For example:<br />
<br />
{{cmd|1=apk add 'asterisk=~1.6'}}<br />
<br />
will match any version of asterisk that starts with 1.6 (such as 1.6.0.21-r0 or 1.6.9.31-r9) <ref>[https://git.alpinelinux.org/apk-tools/commit/?id=693b4bcdb0f22904a521a7c8ac4f13e697dc4d71 Alpine source commit message]</ref><br />
<br />
If you desire deterministic, repeatable package installation (such as with containerized environments) via package pinning, it is important to understand your package repo's version retention rules. For example, most Alpine package repos contain an "edge" branch, which may drop package versions that are not deemed fit to make it into a stable branch. This means that pinning to a version on the edge branch may stop working after the package version is revoked from the repo. Always pin to a package version that is intended for your current Alpine Linux version.<br />
<br />
<br><br />
<br />
= Table of comparison with other Linux/Unix-like OSes for packages =<br />
<br />
{| class="wikitable"<br />
|-<br />
! OS !! File Format !! Tools<br />
|-<br />
| Alpine || .apk || apk<br />
|-<br />
| Debian || .deb || apt, aptitude, dpkg<br />
|-<br />
| Gentoo || .tbz2 || emerge<br />
|-<br />
| FreeBSD || .txz || pkg<br />
|}<br />
<br />
<br><br />
<br />
= Troubleshooting =<br />
<br />
== "apk-tools is old" == <br />
<br />
'''apk update''', '''apk upgrade''' or '''apk add''' may report the following: <br />
WARNING: This apk-tools is OLD! Some packages might not function properly<br />
<br />
This may happen if you are running Alpine Linux stable version with a certain edge/main, edge/community or testing package(s) also installed. One resolution is to consider upgrading {{pkg|apk-tools}}. If edge is already [https://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management#Repository_pinning tagged] in your repositories, then try:<br />
<br />
{{Cmd|apk add --upgrade apk-tools@edge}}<br />
<br />
== ERROR: UNTRUSTED signature ==<br />
<br />
This happens when the release version changes. You need to update the local apk keys.<br />
<br />
If you have already updated your repositories, allow them to update without the trusted key:<br />
{{Cmd|apk update --allow-untrusted}}<br />
<br />
Then install the keys upgrade:<br />
{{Cmd|apk fix --upgrade --allow-untrusted alpine-keys}}<br />
<br />
Now updates and upgrades should proceed normally.<br />
<br />
Alternative, the updated alpine-keys package may be obtained, verified, installed directly, as covered earlier, prior to a repository update.<br />
<br />
= External Links =<br />
* [https://www.cyberciti.biz/faq/10-alpine-linux-apk-command-examples/ 10 Alpine Linux apk Command Examples] Vivek Gite 2019<br />
<br />
[[Category:Package Manager]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_cross_architecture_chroot&diff=23789How to make a cross architecture chroot2023-07-11T07:08:31Z<p>Psykose: type</p>
<hr />
<div>If you have an ARM computer, you will find that some software is only available for x86_64. One possible solution is to have a full x86_64 virtual machine, but that has quite a lot of overhead from having to emulate the entire system. Fortunately, there is [https://qemu-project.gitlab.io/qemu/user/main.html QEMU User space emulation] which still uses the host kernel, so there is less overhead. This guide will show you how to make a chroot and enable transparent x86_64 binary execution using qemu and binfmt_misc.<br />
<br />
== Prerequisites ==<br />
<br />
You should be familiar with the Linux command line.<br />
<br />
This guide is written assuming you have Alpine as the main install as well as putting Alpine in the chroot.<br />
<br />
Also, the commands shown assume you have '''root''' privileges. Either use <code>sudo/doas</code> as needed (or <code>su</code> first).<br />
<br />
== Installing necessary software ==<br />
<br />
'''[[Repositories#Managing_repositories| Enable the Community Repository]]''' and install the '''qemu''' user mode binaries for the architectures you want to use, in this case x86_64 and i386:<br />
<br />
{{Cmd|# apk add {{Pkg|qemu-x86_64}} {{Pkg|qemu-i386}} {{Pkg|qemu-openrc}}}}<br />
<br />
Please note there are the <code>qemu-system-*</code> packages, you don't want those since they are used for full virtual machine emulation.<br />
<br />
== Enable the <code>qemu-binfmt</code> service and start it ==<br />
<br />
The qemu-binfmt script is an OpenRC init script that registers the binfmt_misc handlers when the service starts and unregisters them when the service stops. Add the service to the default runlevel and start it immediately:<br />
<br />
{{Cmd|# rc-update add qemu-binfmt default<br />
&#35; rc-service qemu-binfmt start}}<br />
<br />
== Make the chroot folder ==<br />
<br />
To keep it simple, we're just going to use the apk repositories specified on the host system. This guide assumes the <code>$CHROOT</code> environment variable holds the directory where you want to make the chroot. Make the chroot directory and the <code>etc/apk</code> subdirectory (which we'll copy the apk repositories file to):<br />
<br />
{{Cmd|# mkdir -p $CHROOT/etc/apk/}}<br />
<br />
Now copy the host's apk repositories into the chroot folder:<br />
<br />
{{Cmd|# cp /etc/apk/repositories $CHROOT/etc/apk/}}<br />
<br />
You'll also need to copy the <code>resolv.conf</code> file into the chroot so it can have internet access:<br />
<br />
{{Cmd|# cp /etc/resolv.conf $CHROOT/etc/}}<br />
<br />
== Install <code>alpine-base</code> into the chroot folder ==<br />
<br />
The {{Pkg|alpine-base}} meta package is all that's needed to have a fully working alpine system. The apk invocation used here has a few more options than what you might be used to:<br />
<br />
{{Cmd|# apk add -p $CHROOT --initdb -U --arch x86_64 --allow-untrusted alpine-base}}<br />
<br />
Here's what all the options do:<br />
<br />
*<code>-p $CHROOT</code>: Sets the root of the install to <code>$CHROOT</code> instead of <code>/</code><br />
*<code>--initdb</code>: Initialize a new package database.<br />
*<code>-U</code>: Alias for <code>--cache-max-age 1</code>. Basically means don't install from cache.<br />
*<code>--arch x86_64</code>: Install x86_64 packages instead of native packages. Replace this with whichever architecture you want to emulate instead (e.g. <code>--arch x86</code>).<br />
*<code>--allow-untrusted</code>: Install packages with untrusted signature or no signature. (This is needed since the keys for different architectures are different than what will be on your host. If you have the correct keys, you can copy them into the <code>$CHROOT/etc/apk/keys/</code> directory and remove this flag).<br />
<br />
== Mount the virtual file systems into the chroot ==<br />
<br />
{{Cmd|# mount -t proc proc $CHROOT/proc/<br />
&#35; mount -t sysfs sys $CHROOT/sys/<br />
&#35; mount -o bind /dev/ $CHROOT/dev/<br />
&#35; mount -o bind /dev/pts/ $CHROOT/dev/pts/<br />
&#35; mount -o bind /run $CHROOT/run/}}<br />
<br />
==The exciting part: Enter the chroot==<br />
<br />
If you've followed all the steps, this part should be uneventful. The <code>chroot</code> invocation uses the special command of <code>ash -l</code> to run as a login shell and source <code>/etc/profile</code>:<br />
<br />
{{Cmd|# chroot $CHROOT/ ash -l}}<br />
<br />
==Troubleshooting==<br />
<br />
If you get a <code>ERROR: ${package_name}.post-install: script exited with error 127</code> while trying to add the alpine-base, that normally means that qemu binfmt_misc hasn't been setup properly. Check if the <code>qemu-$arch</code> package has been installed and see if the binfmt_misc service is running. You can also see if there is a <code>qemu-$arch</code> entry in <code>/proc/sys/fs/binfmt_misc/</code>.<br />
<br />
Programs that use [https://en.wikipedia.org/wiki/Netlink Netlink] (e.g. <code>ip addr</code>) don't seem to work properly since qemu doesn't emulate the Netlink protocol properly.<br />
<br />
==References==<br />
<br />
* [https://archive.is/ldO0C Transparently running binaries from any architecture in Linux with QEMU and binfmt_misc] (see the section titled <code>Emulating full ARM rootfs</code>)<br />
<br />
[[Category:System Administration]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=How_to_make_a_cross_architecture_chroot&diff=23788How to make a cross architecture chroot2023-07-11T07:08:18Z<p>Psykose: use qemu-openrc instead of linked script, as it only depends on socat+qemu (base) anyway</p>
<hr />
<div>If you have an ARM computer, you will find that some software is only available for x86_64. One possible solution is to have a full x86_64 virtual machine, but that has quite a lot of overhead from having to emulate the entire system. Fortunately, there is [https://qemu-project.gitlab.io/qemu/user/main.html QEMU User space emulation] which still uses the host kernel, so there is less overhead. This guide will show you how to make a chroot and enable transparent x86_64 binary execution using qemu and binfmt_misc.<br />
<br />
== Prerequisites ==<br />
<br />
You should be familiar with the Linux command line.<br />
<br />
This guide is written assuming you have Alpine as the main install as well as putting Alpine in the chroot.<br />
<br />
Also, the commands shown assume you have '''root''' privileges. Either use <code>sudo/doas</code> as needed (or <code>su</code> first).<br />
<br />
== Installing necessary software ==<br />
<br />
'''[[Repositories#Managing_repositories| Enable the Community Repository]]''' and install the '''qemu''' user mode binaries for the architectures you want to use, in this case x86_64 and i386:<br />
<br />
{{Cmd|# apk add {{Pkg|qemu-x86_64}} {{Pkg|qemu-i386}}}} {{Pkg|qemu-openrc}}<br />
<br />
Please note there are the <code>qemu-system-*</code> packages, you don't want those since they are used for full virtual machine emulation.<br />
<br />
== Enable the <code>qemu-binfmt</code> service and start it ==<br />
<br />
The qemu-binfmt script is an OpenRC init script that registers the binfmt_misc handlers when the service starts and unregisters them when the service stops. Add the service to the default runlevel and start it immediately:<br />
<br />
{{Cmd|# rc-update add qemu-binfmt default<br />
&#35; rc-service qemu-binfmt start}}<br />
<br />
== Make the chroot folder ==<br />
<br />
To keep it simple, we're just going to use the apk repositories specified on the host system. This guide assumes the <code>$CHROOT</code> environment variable holds the directory where you want to make the chroot. Make the chroot directory and the <code>etc/apk</code> subdirectory (which we'll copy the apk repositories file to):<br />
<br />
{{Cmd|# mkdir -p $CHROOT/etc/apk/}}<br />
<br />
Now copy the host's apk repositories into the chroot folder:<br />
<br />
{{Cmd|# cp /etc/apk/repositories $CHROOT/etc/apk/}}<br />
<br />
You'll also need to copy the <code>resolv.conf</code> file into the chroot so it can have internet access:<br />
<br />
{{Cmd|# cp /etc/resolv.conf $CHROOT/etc/}}<br />
<br />
== Install <code>alpine-base</code> into the chroot folder ==<br />
<br />
The {{Pkg|alpine-base}} meta package is all that's needed to have a fully working alpine system. The apk invocation used here has a few more options than what you might be used to:<br />
<br />
{{Cmd|# apk add -p $CHROOT --initdb -U --arch x86_64 --allow-untrusted alpine-base}}<br />
<br />
Here's what all the options do:<br />
<br />
*<code>-p $CHROOT</code>: Sets the root of the install to <code>$CHROOT</code> instead of <code>/</code><br />
*<code>--initdb</code>: Initialize a new package database.<br />
*<code>-U</code>: Alias for <code>--cache-max-age 1</code>. Basically means don't install from cache.<br />
*<code>--arch x86_64</code>: Install x86_64 packages instead of native packages. Replace this with whichever architecture you want to emulate instead (e.g. <code>--arch x86</code>).<br />
*<code>--allow-untrusted</code>: Install packages with untrusted signature or no signature. (This is needed since the keys for different architectures are different than what will be on your host. If you have the correct keys, you can copy them into the <code>$CHROOT/etc/apk/keys/</code> directory and remove this flag).<br />
<br />
== Mount the virtual file systems into the chroot ==<br />
<br />
{{Cmd|# mount -t proc proc $CHROOT/proc/<br />
&#35; mount -t sysfs sys $CHROOT/sys/<br />
&#35; mount -o bind /dev/ $CHROOT/dev/<br />
&#35; mount -o bind /dev/pts/ $CHROOT/dev/pts/<br />
&#35; mount -o bind /run $CHROOT/run/}}<br />
<br />
==The exciting part: Enter the chroot==<br />
<br />
If you've followed all the steps, this part should be uneventful. The <code>chroot</code> invocation uses the special command of <code>ash -l</code> to run as a login shell and source <code>/etc/profile</code>:<br />
<br />
{{Cmd|# chroot $CHROOT/ ash -l}}<br />
<br />
==Troubleshooting==<br />
<br />
If you get a <code>ERROR: ${package_name}.post-install: script exited with error 127</code> while trying to add the alpine-base, that normally means that qemu binfmt_misc hasn't been setup properly. Check if the <code>qemu-$arch</code> package has been installed and see if the binfmt_misc service is running. You can also see if there is a <code>qemu-$arch</code> entry in <code>/proc/sys/fs/binfmt_misc/</code>.<br />
<br />
Programs that use [https://en.wikipedia.org/wiki/Netlink Netlink] (e.g. <code>ip addr</code>) don't seem to work properly since qemu doesn't emulate the Netlink protocol properly.<br />
<br />
==References==<br />
<br />
* [https://archive.is/ldO0C Transparently running binaries from any architecture in Linux with QEMU and binfmt_misc] (see the section titled <code>Emulating full ARM rootfs</code>)<br />
<br />
[[Category:System Administration]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=OpenRC&diff=23787OpenRC2023-07-09T00:17:08Z<p>Psykose: remove pointless info</p>
<hr />
<div>== Quick-Start Information ==<br />
Alpine Linux uses [https://wiki.gentoo.org/wiki/OpenRC OpenRC] for its init system.<br />
<br />
The following commands are available to manage the init system:<br />
* Basics:<br />
{{Cmd|rc-update add <service> <runlevel>}}<br />
{{Cmd|rc-update del <service> <runlevel>}}<br />
{{Cmd|rc-service <service> <start stop restart> # ⇔ /etc/init.d/service <start stop restart>}}<br />
<br />
* To check services and their set runlevels:<br />
{{Cmd|rc-status}}<br />
<br />
* To change to a different runlevel:<br />
{{Cmd|rc <runlevel>}}<br />
<br />
* Reboot/Halt/Poweroff: (And their equivalent from traditional GNU/Linux systems)<br />
{{Cmd|reboot # ⇔ shutdown now -r}}<br />
{{Cmd|halt # ⇔ shutdown now -H}}<br />
{{Cmd|poweroff # ⇔ shutdown now -P}}<br />
<br />
== Available Runlevels ==<br />
The available runlevels are:<br />
* '''default''' - Used if no runlevel is specified. (This is generally the runlevel you want to add services to.)<br />
* '''hotplugged'''<br />
* '''manual'''<br />
<br />
The special runlevels are:<br />
* '''sysinit''' - Brings up system specific stuff such as <code>/dev</code>, <code>/proc</code> and optionally <code>/sys</code> for Linux based systems. It also mounts <code>/lib/rc/init.d</code> as a ramdisk using tmpfs where available unless <code>/</code> is mounted rw at boot. <code>'''rc'''</code> uses <code>/lib/rc/init.d</code> to hold state information about the services it runs. sysinit always runs when the host first starts and should not be run again.<br />
* '''boot''' - Generally the only services you should add to the boot runlevel are those which deal with the mounting of filesystems, set the initial state of attached peripherals and logging. Hotplugged services are added to the boot runlevel by the system. All services in the boot and sysinit runlevels are automatically included in all other runlevels except for those listed here.<br />
* '''single''' - Stops all services except for those in the sysinit runlevel.<br />
* '''reboot''' - Changes to the shutdown runlevel and then reboots the host.<br />
* '''shutdown''' - Changes to the shutdown runlevel and then halts the host.<br />
<br />
== rc-update usage ==<br />
Usage: rc-update [options] add service <runlevel><br />
rc-update [options] del service <runlevel><br />
rc-update [options] show<br />
<br />
Options: [suChqv]<br />
-s, --stack Stack a runlevel instead of a service<br />
-u, --update Force an update of the dependency tree<br />
-h, --help Display this help output<br />
-C, --nocolor Disable color output<br />
-v, --verbose Run verbosely<br />
-q, --quiet Run quietly<br />
<br />
== rc-status usage ==<br />
Usage: rc-status [options] [runlevel1] [runlevel2] ...<br />
<br />
Options: [aclrsuChqv]<br />
-a, --all Show services from all run levels<br />
-c, --crashed Show crashed services<br />
-l, --list Show list of run levels<br />
-r, --runlevel Show the name of the current runlevel<br />
-s, --servicelist Show service list<br />
-u, --unused Show services not assigned to any runlevel<br />
-h, --help Display this help output<br />
-C, --nocolor Disable color output<br />
-v, --verbose Run verbosely<br />
-q, --quiet Run quietly<br />
<br />
== rc-service usage ==<br />
Usage: rc-service [options]<br />
<br />
Options: [e:ilr:ChqVv]<br />
-e, --exists <arg> tests if the service exists or not<br />
-i, --ifexists if the service exists then run the command<br />
-l, --list list all available services<br />
-r, --resolve <arg> resolve the service name to an init script<br />
-h, --help Display this help output<br />
-C, --nocolor Disable color output<br />
-V, --version Display software version<br />
-v, --verbose Run verbosely<br />
-q, --quiet Run quietly<br />
<br />
== rc usage ==<br />
Usage: rc [options]<br />
<br />
Options: [a:o:s:SChqVv]<br />
-a, --applet <arg> runs the applet specified by the next argument<br />
-o, --override <arg> override the next runlevel to change into<br />
when leaving single user or boot runlevels<br />
-s, --service <arg> runs the service specified with the rest<br />
of the arguments<br />
-S, --sys output the RC system type, if any<br />
-h, --help Display this help output<br />
-C, --nocolor Disable color output<br />
-V, --version Display software version<br />
-v, --verbose Run verbosely<br />
-q, --quiet Run quietly<br />
<br />
== Preventing slow services from delaying boot ==<br />
<br />
Services that take a while to start will block the boot process until they complete. E.g.: <code>iwd</code> and <code>networking</code> might delay startup of an interactive system rather than start in the background.<br />
<br />
This can be remedied using [https://ptrcnull.me/posts/openrc-async-services/ async services]. See [https://wiki.gentoo.org/wiki/OpenRC/Stacked%20runlevel stacked runlevels] for more details on this.<br />
<br />
== cgroups v2 ==<br />
<br />
You can enable non-hybrid cgroups v2 by editing /etc/rc.conf and setting rc_cgroup_mode to unified.<br />
<br />
Then you should run<br />
{{Cmd|rc-service cgroups start}}<br />
to take effect<br />
<br />
and<br />
{{Cmd|rc-update add cgroups}}<br />
to auto mount the cgroup filesystem on boot<br />
<br />
[[Category:Booting]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Requirements&diff=23779Requirements2023-07-04T19:04:02Z<p>Psykose: more double ppc</p>
<hr />
<div>This page will tell you what requirements you will need to use the Alpine Linux operating system:<br />
__TOC__<br />
<br />
== Hardware requirements ==<br />
<br />
For installation and usage consider that Alpine can run on several kinds of devices, from the popular PC machine to video game consoles like the 3DS, and as such you must verify the details below:<br />
<br />
* CPU architecture<br />
* Memory<br />
* Storage<br />
* Peripherals<br />
<br />
=== Architectures ===<br />
<br />
CPU architecture is an instruction set design that defines how a processor is used by software. Widely used across desktops and servers are x86 (mostly i386) and x86_64 (also known as amd64). There are other supported computer architectures that are not "x86", like mainframes, servers, and embedded devices (such as routers like Sonicwall and Cisco ones). The table below represents architectures supported by Alpine:<br />
<br />
{| class="wikitable"<br />
|-<br />
! Supported architecture !! Available since !! Description<br />
|-<br />
| x86_64 || all || Widely spread AMD64 compatible 64-bit x86 instruction set.<br />
|-<br />
| x86 || all || Another widely used 32-bit instruction set.<br />
|-<br />
| ppc64le || v3.6 || For PowerPC devices with pure little-endian mode, mostly for POWER8 and POWER9<br />
|-<br />
| armhf || v3.0 || A 32-bit ARM instruction set with hard-float point extension.<br />
|-<br />
| armv7 || v3.9 || The 32-bit ARM only execution state of the ARMv7 devices machines.<br />
|-<br />
| aarch64 || v3.5 || The 64-bit ARM only execution state of the ARMv8+ device machines..<br />
|-<br />
| s390x || v3.6 || For IBM mainframes, especially IBM Z and IBM LinuxONE servers.<br />
|}<br />
<br />
=== Memory ===<br />
{{Obsolete|Most of these numbers seem to be guessed, if not outright fabricated}}<br />
Below are shown minimum RAM amounts for various installation types and phases:<br />
<br />
{| class="wikitable sortable"<br />
|-<br />
! Target Arch !! Minimum RAM to start !! Minimum RAM to install !! Minimum RAM for GUI desktop !! Enough for GUI work<br />
|-<br />
| x86_64 || 512 Megs || 512 Megs || 2 Gigs || 8 Gigs<br />
|-<br />
| x86_32 || 128 Megs || 256 Megs || 1 Gigs || 3 Gigs<br />
|-<br />
| ppc64le || 128 Megs || 256 Megs || 2 Gigs || 8 Gigs<br />
|-<br />
| armhf || 256 Megs || 512 Megs || 1 Gigs || 6 Gigs<br />
|-<br />
| armv7 || 256 Megs || 512 Megs || 1 Gigs || 6 Gigs<br />
|-<br />
| aarch64 || 256 Megs || 512 Megs || 2 Gigs || 8 Gigs<br />
|-<br />
| s390x || 128 Megs || 256 Megs || 2 Gigs || N/A<br />
|}<br />
<br />
=== Storage ===<br />
<br />
This means any external or internal storage device that can be added after or before installation to use by the Alpine Linux system. <br />
<br />
PATA and SATA hard disk drives are supported, as well as any USB or SD card that can be detected by the Linux during installation.<br />
<br />
=== Peripherals ===<br />
<br />
This means any external or internal device that can be added before or after installation and detected by Alpine Linux. The peripherals that are supported depends on the current version of the Linux kernel.<br />
<br />
Almost any GPU is supported, but certain features and 3D acceleration might depend on MESA drivers:<br />
<br />
* Intel: mostly any Intel by one exception, Intel i810/i815 will lack features since it has only 4Mb memory, support for it has been dropped by Mesa and Linux.<br />
* ATI/AMD, only Radeon series with exception of recent last two years, Rage r128/match64 series has limited support.<br />
* Nvidia: support for Nvidia GPUs is limited since their drivers are proprietary and built for GNU libc. Nouveau drivers are available as free alternative.<br />
* Matrox: not all features are supported.<br />
* Sis: limited features are supported, due to limited support from upstream.<br />
* Via: limited features are supported, due to limited support from upstream.<br />
<br />
== Software requirements ==<br />
<br />
=== Media ===<br />
<br />
Alpine boot images are provided on [https://alpinelinux.org/downloads/ downloads page] or on a [https://dl-cdn.alpinelinux.org/alpine/latest-stable/releases/ mirror]<br />
<br />
The images should be verified as in [[Installation]], to ensure the file wasn't corrupted during transfer.<br />
<br />
=== Booting ===<br />
<br />
The following table describes supported firmware types, for more information please check [[Alpine_and_UEFI|Alpine and UEFI]] wiki page.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Supported Arch !! Supported firmware !! Supported Types<br />
|-<br />
| x86_64 || Coreboot, Vendor/OEM || BIOS, UEFI<br />
|-<br />
| x86 || Coreboot, Vendor/OEM || BIOS, UEFI<br />
|-<br />
| ppc64le || Coreboot, Vendor/OEM || UEFI<br />
|-<br />
| armhf || Uboot, Vendor/OEM || UEFI<br />
|-<br />
| armv7 || Uboot, Vendor/OEM || UEFI<br />
|-<br />
| aarch64 || Vendor/OEM || UEFI<br />
|-<br />
| s390x || Vendor/OEM || unknown<br />
|}<br />
<br />
=== Space ===<br />
<br />
A default installation of Alpine requires at least 1GB of free space. You can see various partition configurations and their sizes on [[Alpine_and_UEFI#Alpine_disk_layout_for_UEFI|Alpine disk layout for UEFI/BIOS at Alpine and UEFI]] wiki page.<br />
<br />
= See Also =<br />
<br />
# [[Installation]]<br />
<br />
[[Category:Installation]]<br />
<br />
__FORCETOC__</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Requirements&diff=23778Requirements2023-07-04T19:03:36Z<p>Psykose: remove double fake ppc</p>
<hr />
<div>This page will tell you what requirements you will need to use the Alpine Linux operating system:<br />
__TOC__<br />
<br />
== Hardware requirements ==<br />
<br />
For installation and usage consider that Alpine can run on several kinds of devices, from the popular PC machine to video game consoles like the 3DS, and as such you must verify the details below:<br />
<br />
* CPU architecture<br />
* Memory<br />
* Storage<br />
* Peripherals<br />
<br />
=== Architectures ===<br />
<br />
CPU architecture is an instruction set design that defines how a processor is used by software. Widely used across desktops and servers are x86 (mostly i386) and x86_64 (also known as amd64). There are other supported computer architectures that are not "x86", like mainframes, servers, and embedded devices (such as routers like Sonicwall and Cisco ones). The table below represents architectures supported by Alpine:<br />
<br />
{| class="wikitable"<br />
|-<br />
! Supported architecture !! Available since !! Description<br />
|-<br />
| x86_64 || all || Widely spread AMD64 compatible 64-bit x86 instruction set.<br />
|-<br />
| x86 || all || Another widely used 32-bit instruction set.<br />
|-<br />
| ppc64le || v3.6 || For PowerPC devices with pure little-endian mode, mostly for POWER8 and POWER9<br />
|-<br />
| armhf || v3.0 || A 32-bit ARM instruction set with hard-float point extension.<br />
|-<br />
| armv7 || v3.9 || The 32-bit ARM only execution state of the ARMv7 devices machines.<br />
|-<br />
| aarch64 || v3.5 || The 64-bit ARM only execution state of the ARMv8+ device machines..<br />
|-<br />
| s390x || v3.6 || For IBM mainframes, especially IBM Z and IBM LinuxONE servers.<br />
|}<br />
<br />
=== Memory ===<br />
{{Obsolete|Most of these numbers seem to be guessed, if not outright fabricated}}<br />
Below are shown minimum RAM amounts for various installation types and phases:<br />
<br />
{| class="wikitable sortable"<br />
|-<br />
! Target Arch !! Minimum RAM to start !! Minimum RAM to install !! Minimum RAM for GUI desktop !! Enough for GUI work<br />
|-<br />
| x86_64 || 512 Megs || 512 Megs || 2 Gigs || 8 Gigs<br />
|-<br />
| x86_32 || 128 Megs || 256 Megs || 1 Gigs || 3 Gigs<br />
|-<br />
| ppc64le || 128 Megs || 256 Megs || 2 Gigs || 8 Gigs<br />
|-<br />
| armhf || 256 Megs || 512 Megs || 1 Gigs || 6 Gigs<br />
|-<br />
| armv7 || 256 Megs || 512 Megs || 1 Gigs || 6 Gigs<br />
|-<br />
| aarch64 || 256 Megs || 512 Megs || 2 Gigs || 8 Gigs<br />
|-<br />
| ppc64le || 256 Megs || 512 Megs || 1 Gigs || 6 Gigs<br />
|-<br />
| s390x || 128 Megs || 256 Megs || 2 Gigs || N/A<br />
|}<br />
<br />
=== Storage ===<br />
<br />
This means any external or internal storage device that can be added after or before installation to use by the Alpine Linux system. <br />
<br />
PATA and SATA hard disk drives are supported, as well as any USB or SD card that can be detected by the Linux during installation.<br />
<br />
=== Peripherals ===<br />
<br />
This means any external or internal device that can be added before or after installation and detected by Alpine Linux. The peripherals that are supported depends on the current version of the Linux kernel.<br />
<br />
Almost any GPU is supported, but certain features and 3D acceleration might depend on MESA drivers:<br />
<br />
* Intel: mostly any Intel by one exception, Intel i810/i815 will lack features since it has only 4Mb memory, support for it has been dropped by Mesa and Linux.<br />
* ATI/AMD, only Radeon series with exception of recent last two years, Rage r128/match64 series has limited support.<br />
* Nvidia: support for Nvidia GPUs is limited since their drivers are proprietary and built for GNU libc. Nouveau drivers are available as free alternative.<br />
* Matrox: not all features are supported.<br />
* Sis: limited features are supported, due to limited support from upstream.<br />
* Via: limited features are supported, due to limited support from upstream.<br />
<br />
== Software requirements ==<br />
<br />
=== Media ===<br />
<br />
Alpine boot images are provided on [https://alpinelinux.org/downloads/ downloads page] or on a [https://dl-cdn.alpinelinux.org/alpine/latest-stable/releases/ mirror]<br />
<br />
The images should be verified as in [[Installation]], to ensure the file wasn't corrupted during transfer.<br />
<br />
=== Booting ===<br />
<br />
The following table describes supported firmware types, for more information please check [[Alpine_and_UEFI|Alpine and UEFI]] wiki page.<br />
<br />
{| class="wikitable"<br />
|-<br />
! Supported Arch !! Supported firmware !! Supported Types<br />
|-<br />
| x86_64 || Coreboot, Vendor/OEM || BIOS, UEFI<br />
|-<br />
| x86 || Coreboot, Vendor/OEM || BIOS, UEFI<br />
|-<br />
| ppc64le || Coreboot, Vendor/OEM || UEFI<br />
|-<br />
| armhf || Uboot, Vendor/OEM || UEFI<br />
|-<br />
| armv7 || Uboot, Vendor/OEM || UEFI<br />
|-<br />
| aarch64 || Vendor/OEM || UEFI<br />
|-<br />
| s390x || Vendor/OEM || unknown<br />
|}<br />
<br />
=== Space ===<br />
<br />
A default installation of Alpine requires at least 1GB of free space. You can see various partition configurations and their sizes on [[Alpine_and_UEFI#Alpine_disk_layout_for_UEFI|Alpine disk layout for UEFI/BIOS at Alpine and UEFI]] wiki page.<br />
<br />
= See Also =<br />
<br />
# [[Installation]]<br />
<br />
[[Category:Installation]]<br />
<br />
__FORCETOC__</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=UniFi_Controller&diff=23766UniFi Controller2023-07-04T14:35:22Z<p>Psykose: remove terrible workaround info</p>
<hr />
<div>{{TOC right}}<br />
<br />
= '''''Notice''''' =<br />
<br />
The Ubiquiti Unifi controller linux self-contained java image relies on MongoDB, and MongoDB has been removed from alpine linux packages after version 3.9 due to SPL license changes, so this guide doesn't work.<br />
<br />
= Introduction =<br />
<br />
This guide explains how to install the generic Unix UniFi Controller, as available from [http://www.ui.com/ Ubiquiti Networks]. At the time of writing this, a native Alpine Linux package is not available.<br />
<br />
Furthermore, this guide uses the incredibly reliable and efficient [http://www.skarnet.org/software/s6/ s6] supervision suite to start and control the UniFi Controller.<br />
<br />
A summarized schematic of what will be installed on the filesystem.<br />
<br />
The choice of {{path|/srv}} for the UniFi Controller's root directory is based on the fact that it contains both run-time and configuration data, so installing to {{path|/usr/local}}, {{path|/opt}} or {{path|/home}} didn't seem appropriate. Feel free to adjust the steps below, replacing {{path|/srv/unifi}} with wherever you would prefer to install the UniFi Controller software.<br />
<br />
<pre><br />
/<br />
`--etc<br />
|-- unifi<br />
| `-- log<br />
|-- srv<br />
| `-- unifi<br />
| |-- bin<br />
| |-- conf<br />
| |-- data<br />
| |-- dl<br />
| |-- lib<br />
| |-- logs<br />
| |-- run<br />
| `-- webapps<br />
|-- run<br />
| `-- openrc<br />
| `-- s6-scan<br />
| `-- unifi --> /etc/unifi<br />
`-- var<br />
`-- log<br />
`-- unifi<br />
</pre><br />
<br />
= Prerequisite Packages =<br />
<br />
== OpenJDK 8 JRE ==<br />
<br />
Install <code>openjdk8-jre</code> from the community repository.<br />
<br />
Edit <code>/etc/apk/repositories</code> and uncomment the appropriate community repository for your Alpine version:<br />
<br />
<code><nowiki>http://host.name/alpine_version/community</nowiki></code><br />
<br />
Update the package cache.<br />
<br />
<code>apk update</code><br />
<br />
Install the package.<br />
<br />
<code>apk add openjdk8-jre</code><br />
<br />
== MongoDB ==<br />
<br />
Install MongoDB<br />
<br />
<code>apk add mongodb</code><br />
<br />
== s6 ==<br />
<br />
Install [http://www.skarnet.org/software/s6/ s6]<br />
<br />
<code>apk add s6</code> which is a service supervision suite, for reliably and efficiently starting, stopping and keeping services running.<br />
<br />
The below shows a schematic process tree of how the UniFi Controller will be started and supervised by s6. The controller is written in Java, hence the Java process and it in turn, launches a dedicated instance of MongoDB to store its configuration and run-time data.<br />
<br />
<pre><br />
init<br />
`-- s6-svscan<br />
`-- s6-supervise<br />
|-- s6-log<br />
`-- java<br />
`-- mongod<br />
</pre><br />
<br />
= Install UniFi Controller =<br />
<br />
Create the <code>unifi</code> user and group.<br />
<br />
<code>adduser -D -H -h /srv/unifi unifi</code><br />
<br />
Change to the parent folder within which you wish to install the UniFi Controller.<br />
<br />
<code>cd /srv</code><br />
<br />
Download the generic unix archive of the <code>VERSION</code> you wish to install.<br />
<br />
<code>wget http://www.ubnt.com/downloads/unifi/VERSION/UniFi.unix.zip</code><br />
<br />
Unpack the archive.<br />
<br />
<code>unzip UniFi.unix.zip</code><br />
<br />
Rename the unpacked directory.<br />
<br />
<code>mv UniFi unifi</code><br />
<br />
Change ownership.<br />
<br />
<code>chown -R unifi:unifi unifi</code><br />
<br />
Lock down permissions.<br />
<br />
<code>chmod o-rwx unifi</code><br />
<br />
Change into the UniFi bin directory.<br />
<br />
<code>cd /srv/unifi/bin</code><br />
<br />
Remove the existing file.<br />
<br />
<code>rm mongod</code><br />
<br />
Create a symlink to <code>/usr/bin/mongod</code><br />
<br />
<code>ln -s /usr/bin/mongod</code><br />
<br />
= Configure Service Management =<br />
<br />
== Create UniFi Service Directory and Files ==<br />
<br />
Create an s6 service directory for UniFi.<br />
<br />
<code>mkdir -p /etc/unifi/log</code><br />
<br />
Add the <code>run</code> script, using your favourite editor.<br />
<br />
<code>vim /etc/unifi/run</code><br />
<br />
Copy and paste the following into it.<br />
<br />
<pre><br />
#!/bin/ash<br />
<br />
user='unifi'<br />
group='unifi'<br />
<br />
exec 2>&1<br />
<br />
base='/srv/unifi'<br />
<br />
if [ -d $base ]; then<br />
cd $base<br />
chown -R $user:$group .<br />
version=`head -1 webapps/ROOT/app-unifi/.version`<br />
echo "Starting UniFi Controller $version"<br />
exec s6-setuidgid $user java -jar lib/ace.jar start<br />
else<br />
echo "Missing $base ... aborting"<br />
touch down<br />
fi<br />
</pre><br />
<br />
Ensure that the <code>run</code> script is executable:<br />
<br />
<code>chmod 755 /etc/unifi/run</code><br />
<br />
Add the <code>log/run</code> script, using your favourite editor.<br />
<br />
<code>vim /etc/unifi/log/run</code><br />
<br />
Copy and paste the following into it.<br />
<br />
<pre><br />
#!/bin/ash<br />
<br />
log_user='log'<br />
<br />
exec s6-setuidgid $log_user s6-log -b n20 s1000000 t /var/log/unifi<br />
</pre><br />
<br />
Ensure that the log/run script is executable:<br />
<br />
<code>chmod 755 /etc/unifi/log/run</code><br />
<br />
== Create log User and Directory ==<br />
<br />
Create the <code>log</code> user and group.<br />
<br />
<code>adduser -D -H -h /var/log log</code><br />
<br />
Create the <code>/var/log/unifi</code> directory<br />
<br />
<code>mkdir -p /var/log/unifi</code><br />
<br />
Update the directory ownership.<br />
<br />
<code>chown log:log /var/log/unifi</code><br />
<br />
Lock down the permissions.<br />
<br />
<code>chmod 750 /var/log/unifi</code><br />
<br />
== Create the OpenRC Service Script ==<br />
<br />
Open the script file using your favourite editor.<br />
<br />
<code>vim /etc/init.d/unifi</code><br />
<br />
Paste the following into it.<br />
<br />
<pre><br />
#!/sbin/openrc-run<br />
<br />
name="unifi"<br />
supervisor=s6<br />
s6_service_path="${RC_SVCDIR}/s6-scan/${name}"<br />
<br />
depend() {<br />
need net s6-svscan<br />
after firewall<br />
}<br />
<br />
start_pre() {<br />
if [ ! -L "${RC_SVCDIR}/s6-scan/${name}" ]; then<br />
ln -s "/etc/${name}" "${RC_SVCDIR}/s6-scan/${name}"<br />
fi<br />
}<br />
</pre><br />
<br />
Ensure that the script is executable.<br />
<br />
<code>chmod 755 /etc/init.d/unifi</code><br />
<br />
== Start the UniFi Controller Service ==<br />
<br />
<code>rc-service unifi start</code><br />
<br />
== Configure the UniFi Controller Service to start on boot ==<br />
<br />
<code>rc-update add unifi boot</code><br />
<br />
= Simple Backup Script =<br />
<br />
Create <code>/usr/local/bin/unifi-backup</code> using your favourite editor.<br />
<br />
'''Note:''' This script assumes the use of s6-svc to control unifi. I will modify it in time, to use rc-service instead.<br />
<br />
Paste the following into the file.<br />
<br />
<pre><br />
#!/bin/ash<br />
<br />
conf_dir='/etc/unifi'<br />
backup_dir='/srv/backup/unifi'<br />
service_dir='/run/openrc/s6-scan/unifi'<br />
<br />
start_state='down'<br />
<br />
if s6-svok $service_dir; then<br />
if s6-svstat -o up,ready $service_dir | grep -q true; then<br />
echo 'Stopping the UniFi Controller'<br />
start_state='up'<br />
s6-svc -d $service_dir<br />
sleep 3<br />
fi<br />
else<br />
echo 'Warning: The UniFi Controller is not supervised'<br />
exit 1<br />
fi<br />
<br />
if s6-svstat -o up $service_dir | grep -q false; then<br />
echo 'Success: The UniFi Controller was stopped'<br />
else<br />
echo 'Error: The UniFi Controller is still running'<br />
exit 1<br />
fi<br />
<br />
stamp=`date +%Y-%m-%d_%H%M%S`<br />
<br />
mkdir -p $backup_dir<br />
cd $backup_dir<br />
mkdir "data-$stamp"<br />
<br />
echo "Backing up to /srv/backup/unifi/data-$stamp.tar.gz"<br />
<br />
if rsync -az /srv/unifi/data/ "data-$stamp"; then<br />
echo '* rsync succeeded'<br />
if tar czf "data-$stamp.tar.gz" "data-$stamp"; then<br />
echo '* tar succeeded'<br />
rm -rf "data-$stamp"<br />
echo 'Backup succeeded'<br />
else<br />
echo 'Backup failed: tar failed'<br />
exit 1<br />
fi<br />
fi<br />
<br />
if [ "$start_state" == 'up' ]; then<br />
echo 'Starting the UniFi Controller'<br />
s6-svc -u $service_dir<br />
sleep 5<br />
s6-svstat $service_dir<br />
fi<br />
</pre><br />
<br />
<br />
[[category:Networking]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Template:Cmd&diff=23718Template:Cmd2023-07-02T20:39:31Z<p>Psykose: rev</p>
<hr />
<div><noinclude>{{Template}}<br />
== Template Documentation ==<br />
This template should be used for commands<br /><br />
Example:<br />
<nowiki>{{Cmd|apk add <var>package</var>}}</nowiki><br />
<br />
Will produce:<br />
{{Cmd|apk add <var>package</var>}}<br />
<br />
<!-- background-color:#eeeeee; color:#111111; padding:.05em .5em; margin:.5em; border:1px solid #dddddd; border-left:2px solid #dddddd; white-space:pre; font-family:monospace, Courier; font-size:10pt; <br />
<br />
background-color:#f9f9f9<br />
<br />
--><br />
<br />
</noinclude><includeonly><p style="background-color:#eeeeee; border:1px dashed #bbbbbb; line-height:1.1em; padding:1em; font-family:monospace, Courier; font-size:10pt; white-space:pre; overflow:auto;">{{{1}}}</p></includeonly></div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Template:Cmd&diff=23717Template:Cmd2023-07-02T20:24:53Z<p>Psykose: add nowiki tag</p>
<hr />
<div><noinclude>{{Template}}<br />
== Template Documentation ==<br />
This template should be used for commands<br /><br />
Example:<br />
<nowiki>{{Cmd|apk add <var>package</var>}}</nowiki><br />
<br />
Will produce:<br />
{{Cmd|apk add <var>package</var>}}<br />
<br />
<!-- background-color:#eeeeee; color:#111111; padding:.05em .5em; margin:.5em; border:1px solid #dddddd; border-left:2px solid #dddddd; white-space:pre; font-family:monospace, Courier; font-size:10pt; <br />
<br />
background-color:#f9f9f9<br />
<br />
--><br />
<br />
</noinclude><includeonly><p style="background-color:#eeeeee; border:1px dashed #bbbbbb; line-height:1.1em; padding:1em; font-family:monospace, Courier; font-size:10pt; white-space:pre; overflow:auto;">{{#tag:nowiki|{{{1}}}}}</p></includeonly></div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Package_Maintainers&diff=23690Package Maintainers2023-06-30T19:53:34Z<p>Psykose: typo</p>
<hr />
<div>{{Draft}}<br />
<br />
* You can be maintainer without having commit access. Committers can do commits and maintainers can send patches to committers. Any committers can apply patches from maintainers. (This is similar to what FreeBSD does)<br />
* The maintainer is responsible for the package and is expected to:<br />
** fix bugs in their package<br />
** keep it updated. This includes following upstream announcement list, RSS feeds etc., and providing updates to Alpine Linux in a timely fashion.<br />
*** it seems easier for maintainers to add their packages [https://release-monitoring.org/ Anitya] for automated release monitoring<br />
* Committers and others should confirm with the maintainer before making any changes to the package.<br />
<br />
<br />
[[Category:Development]] [[Category:Package Manager]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Raspberry_Pi&diff=23686Raspberry Pi2023-06-20T18:42:29Z<p>Psykose: clarify</p>
<hr />
<div>{{warning | 11 Feb 2021 - There is currently a known bug upstream <br />[https://github.com/raspberrypi/firmware/issues/1529 kernel/initramfs cannot be loaded from subdirectory with same name as volume label]. Since the kernel is installed to <code>boot/</code>, you must not use a label named <code>boot</code> for the fat32 partition. }}<br />
<br />
{{TOC right}}<br />
<br />
This tutorial explains how to install Alpine Linux on a Raspberry Pi. Alpine Linux will be installed in [[Installation#Diskless_Mode|diskless mode]], hence, [[Alpine local backup|Alpine Local Backup (lbu)]] is required to save modifications between reboots.<br />
<br />
For scenarios where there is not expected to be significant changes to disk after setup (like running a static HTTP server), this is likely preferable, as running the entire system from memory will improve performance (by avoiding the slow SD card) and improve the SD card life (by reducing the writes to the card, as all logging will happen in RAM). Diskless installations still allow you to install packages, save local files, and tune the system to your needs.<br />
<br />
If any of the following apply, then installation in [[Classic install or sys mode on Raspberry Pi|sys-mode installation]] is likely more appropriate.<br />
<br />
* There will be constant changes to the disk after initial setup (for example, if you expect people to login and save files to their home directories)<br />
* Logs should persists across reboots<br />
* Plan to install packages which consume more space than can be loaded into RAM<br />
* Plan to install kernel modules (such as ZFS)<br />
<br />
== Preparation ==<br />
<br />
# [http://alpinelinux.org/downloads/ Download] the Alpine for Raspberry Pi tarball. You should be safe using the '''armhf''' build on all versions of Raspberry Pi (including Pi Zero and Compute Modules); but it may perform less optimally on recent versions of Raspberry Pi. The '''armv7''' build is compatible with Raspberry Pi 2 Model B. The '''aarch64''' build should be compatible with Raspberry Pi 2 Model v1.2, Raspberry Pi 3 and Compute Module 3, and Raspberry Pi 4 model B.<br />
# [[Create_a_Bootable_Device#Manually_copying_Alpine_files|Create a bootable FAT32 partition on your SD card.]] The partitioning and formatting part of the instructions on the linked page could be done using a graphical partitioning tool such as [https://en.wikipedia.org/wiki/GNOME_Disks gnome-disks], just make sure the partition type is <code>W95 FAT32 (LBA)</code>. (The current type can be found in the "Type" column in the output of <code>fdisk -l</code>.)<br />
# Extract the tarball to the root of the bootable FAT32 partition.<br />
<br />
To setup a headless system, a bootstrapping configuration overlay file [https://github.com/macmpi/alpine-linux-headless-bootstrap headless.apkovl.tar.gz] may be added to enable basic networking, so that following configuration steps can be performed under <code>ssh</code>. Pi Zero may be configured with simple USB ethernet-gadget networking with another computer sharing its internet connection.<br />
<br />
Optionally create a '''usercfg.txt''' file on the partition to configure low-level system settings. Specifications can be found [https://www.raspberrypi.org/documentation/configuration/config-txt here]. However, note some settings can only be set directly in '''config.txt''', which may be overwritten after updates. In particular, <code>gpu_mem</code> will have no effect when specified in '''usercfg.txt''' ([https://github.com/raspberrypi/firmware/issues/1332 source]). Some interesting values include:<br />
* To enable the UART console: <code>enable_uart=1</code><br />
* To enable audio: <code>dtparam=audio=on</code><br />
* If you see black edges around your screen after booting the Pi, you can add <code>disable_overscan=1</code><br />
* If you plan to install on a Pi Compute Module 4 with I/O board, you may need to add: <code>otg_mode=1</code><br />
<br />
Recent versions include Broadcom firmware files. If you're using an older Alpine version, see [[#Wireless_support_with_older_Alpine_images|section below]].<br />
<br />
== Installation ==<br />
<br />
Follow these steps to install Alpine Linux in Diskless Mode:<br />
<br />
# Insert the SD card into the Raspberry Pi and power it on<br />
# Login into the Alpine system as root. Leave the password empty.<br />
# Type <code>setup-alpine</code><br />
# Once the installation is complete, commit the changes by typing <code>lbu commit -d</code><br />
<br />
Type <code>reboot</code> to verify that the installation was indeed successful.<br />
<br />
== Post Installation ==<br />
<br />
=== Update the System ===<br />
<br />
After installation, make sure your system is up-to-date:<br />
<br />
{{cmd|apk update<br />
apk upgrade}}<br />
<br />
Don't forget to save the changes:<br />
<br />
{{cmd|lbu commit -d}}<br />
<br />
Note: this does not upgrade the kernel. In order to upgrade the kernel, a full upgrade of the Alpine Linux version must be performed as described in [[Upgrading Alpine#Upgrading Alpine Linux on other removable media (such as CF/USB)|upgrading Alpine Linux for removable media]].<br />
<br />
=== Clock-related error messages ===<br />
<br />
During the booting time, you might notice errors related to the hardware clock. The Raspberry Pi does not have<br />
a hardware clock, thus you need to disable the hwclock daemon and enable swclock:<br />
<br />
{{cmd|rc-update add swclock boot # enable the software clock<br />
rc-update del hwclock boot # disable the hardware clock}}<br />
<br />
Since the Raspberry Pi does not have a clock, Alpine Linux needs to know what the time is by using a<br />
[https://en.wikipedia.org/wiki/Network_Time_Protocol Network Time Protocol (NTP)] daemon. Make sure you have a<br />
NTP daemon installed and running. If you are not sure, you can install an NTP client by running the following<br />
command:<br />
<br />
{{cmd|setup-ntp}}<br />
<br />
The Busybox NTP client might be the most lightweight solution. Save the changes and reboot, once the NTP software is<br />
installed and running:<br />
<br />
{{cmd|lbu commit -d<br />
reboot}}<br />
<br />
After reboot, make sure the <code>date</code> command outputs the correct date and time.<br />
<br />
=== WiFi on boot ===<br />
If you have already [[Connecting_to_a_wireless_access_point|configured WiFi]] during the setup, the connection will not return on reboot.<br />
You will need to start up a service to automatically connect to the wireless access point.<br />
# Run <code>rc-update add wpa_supplicant boot</code> to connect to the wireless access point during bootup.<br />
# Run it manually with <code>/etc/init.d/wpa_supplicant start</code>.<br />
<br />
=== Enable Graphics ===<br />
Remount the boot partition writeable (i.e. <code>/media/mmcblk0p1</code>):<br />
<br />
{{cmd|mount /media/mmcblk0p1 -o rw,remount}}<br />
<br />
Add the following lines to <code>/media/mmcblk0p1/config.txt</code>:<br />
<br />
dtoverlay=vc4-kms-v3d<br />
<br />
If you are experiencing graphical issues, you can also try:<br />
<br />
dtoverlay=vc4-fkms-v3d<br />
<br />
And perhaps also raising the default <code>gpu_mem</code>:<br />
<br />
gpu_mem=128<br />
<br />
Note that raising the gpu memory is not likely to [https://www.raspberrypi.com/documentation/computers/config_txt.html#gpu_mem actually improve performance on the Pi4]<br />
<br />
Install the Mesa drivers:<br />
<br />
{{cmd|<nowiki>apk add mesa-dri-gallium</nowiki>}}<br />
<br />
Then reboot:<br />
<br />
{{cmd|lbu_commit -d; reboot}}<br />
<br />
=== WiFi drivers ===<br />
As of Alpine 3.14, the WiFi drivers for the Raspberry Pi were moved from <code>linux-firmware-brcm</code> to the <code>linux-firmware-cypress</code> package (source?). Since the images seem to be an outdated version of the former, Wi-Fi will work during installation, but after the first update it will break.<br />
Use the ethernet interface to download the required packages:<br />
<br />
{{cmd|apk add linux-firmware-cypress}}<br />
<br />
And reboot.<br />
<br />
== Persistent storage ==<br />
=== Loopback image with overlayfs ===<br />
<br />
When you install Alpine in diskless mode, the entire system is loaded into memory at boot. If you want additional storage (for example, if you need more space than offered by your RAM) we need to create loop-back storage onto the SD card mounted with overlayfs.<br />
<br />
First, make the SD card writable again and change fstab to always do so:<br />
{{cmd|mount /media/mmcblk0p1 -o rw,remount<br />
sed -i 's/vfat\ ro,/vfat\ rw,/' /etc/fstab}}<br />
<br />
Create the loop-back file, this example is 1 GB:<br />
<br />
{{cmd|dd if&#61;/dev/zero of&#61;/media/mmcblk0p1/persist.img bs&#61;1024 count&#61;0 seek&#61;1048576}}<br />
<br />
Install the ext utilities:<br />
<br />
{{cmd|apk add e2fsprogs}}<br />
<br />
Format the loop-back file:<br />
<br />
{{cmd|mkfs.ext4 /media/mmcblk0p1/persist.img}}<br />
<br />
Mount the storage: <br />
<br />
{{cmd|echo "/media/mmcblk0p1/persist.img /media/persist ext4 rw,relatime,errors&#61;remount-ro 0 0" >> /etc/fstab<br />
mkdir /media/persist <br />
mount -a}}<br />
<br />
Make the overlay folders, we are using the /usr directory here, but you can use /home or anything else. <br />
{{Warning|Overlay workdir needs to be an empty directory on the same filesystem mount as the upper directory. So each overlay must use its own workdir.}}<br />
<br />
<br />
{{cmd|mkdir /media/persist/usr <br />
mkdir /media/persist/.work_usr <br />
echo "overlay /usr overlay lowerdir&#61;/usr,upperdir&#61;/media/persist/usr,workdir&#61;/media/persist/.work_usr 0 0" >> /etc/fstab <br />
mount -a}}<br />
<br />
Your /etc/fstab should look something like this:<br />
{{Cmd|/dev/cdrom /media/cdrom iso9660 noauto,ro 0 0<br />
/dev/usbdisk /media/usb vfat noauto,ro 0 0<br />
/dev/mmcblk0p1 /media/mmcblk0p1 vfat rw,relatime,fmask&#61;0022,dmask&#61;0022,errors&#61;remount-ro 0 0<br />
/media/mmcblk0p1/persist.img /media/persist ext4 rw,relatime,errors&#61;remount-ro 0 0<br />
overlay /usr overlay lowerdir&#61;/usr,upperdir&#61;/media/persist/usr,workdir&#61;/media/persist/.work_usr 0 0}}<br />
<br />
Now commit the changes: (optionally remove the e2fsprogs, but it does contain repair tools)<br />
{{cmd|lbu_commit -d}}<br />
<br />
Remember, with this setup if you install things and you have done this overlay for /usr, you must not commit the 'apk add', otherwise, while it boots it will try and install it to memory, not to the persistent storage.<br />
<br />
If you do want to install something small at boot, you can use `apk add` and `lbu commit -d`.<br />
<br />
If it is something a bit bigger, then you can use `apk add` but then not commit it. It will be persistent (in /user), but be sure to check everything you need is in that directory and not in folders you have not made persistent.<br />
<br />
=== Traditional disk-based (sys) installation ===<br />
{{Merge|Classic install or sys mode on Raspberry Pi|There's an existing page for sys-installations on RasPi.}}<br />
<br />
It is also possible to switch to a fully disk-based installation. This is not yet formally supported, but can be done somewhat manually. This frees all the memory otherwise needed for the root filesystem, allowing more installed packages.<br />
<br />
Split your SD card into two partitions: the FAT32 boot partition described above (in this example it'll be <code>mmcblk0p1</code>) , and a second partition to hold the root filesystem (here it'll be <code>mmcblk0p2</code>). Boot and configure your diskless system as above, then create a root filesystem:<br />
<br />
{{cmd|apk add e2fsprogs<br />
mkfs.ext4 /dev/mmcblk0p2}}<br />
<br />
Now do a disk install via a mountpoint. The <code>setup-disk</code> script will give some errors about syslinux/extlinux, but you can ignore them.<br />
The Raspberry Pi doesn't need them to boot.<br />
<br />
{{cmd|<nowiki>mkdir /stage<br />
mount /dev/mmcblk0p2 /stage<br />
setup-disk -o /media/mmcblk0p1/MYHOSTNAME.apkovl.tar.gz /stage<br />
# (ignore errors about syslinux/extlinux)</nowiki>}}<br />
<br />
Add a line to <code>/stage/etc/fstab</code> to mount the Pi's boot partition again:<br />
<br />
{{cmd|/dev/mmcblk0p1 /media/mmcblk0p1 vfat defaults 0 0}}<br />
<br />
Now add a <code>root=/dev/mmcblk0p2</code> parameter to the Pi's boot command line, either <code>cmdline-rpi2.txt</code> or <code>cmdline-rpi.txt</code> depending on model:<br />
<br />
{{cmd|<nowiki>mount -o remount,rw /media/mmcblk0p1<br />
sed -i '$ s/$/ root=\/dev\/mmcblk0p2/' /media/mmcblk0p1/cmdline-rpi2.txt</nowiki>}}<br />
<br />
You might also consider <code>overlaytmpfs=yes</code> here, which will cause the underlying SD card root filesystem to be mounted read-only, with an overlayed tmpfs for modifications which will be discarded at shutdown.<br />
<br />
N.B. <b>the contents of /boot will be ignored when the Pi boots</b>. It will use the kernel, initramfs, and modloop images from the FAT32 boot partition. To update the kernel, initfs or modules, you will need to manually (generate and) copy these to the boot partition or you could use bind mount, in which case,<br />
copying the files to boot partition manually, is not needed.<br />
<br />
{{cmd|<nowiki>echo /media/mmcblk0p1/boot /boot none defaults,bind 0 0 >> /etc/fstab</nowiki>}}<br />
<br />
=== Persistent Installation on Raspberry Pi 3 ===<br />
See [[Classic install or sys mode on Raspberry Pi]] and https://web.archive.org/web/20171125115835/https://forum.alpinelinux.org/comment/1084#comment-1084<br />
<br />
=== Persistent Installation on Raspberry Pi 4 ===<br />
As of 3.14, setup-alpine should ask you if you want to create a sys mode partition on your Raspberry Pi 4.<br />
<br />
== Netboot ==<br />
<br />
=== Netbooting Raspberry Pi 4 ===<br />
<br />
The Raspberry Pi 4 bootloader can be configured to boot from the network [https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-4-bootloader-configuration]. Configure the bootloader with at least<br />
<br />
{{cmd|<nowiki>BOOT_ORDER=0xf142<br />
TFTP_PREFIX=1</nowiki>}}<br />
<br />
and optionally also {{cmd|<nowiki>TFTP_IP=x.x.x.x</nowiki>}} where <code>x.x.x.x</code> is the IP address of your TFTP server.<br />
<br />
If not configuring <code>TFTP_IP</code> in the bootloader, you'll need to configure your DHCP server to advertise the TFTP server IP address. This varies depending on your DHCP server; use the following details if applicable:<br />
<br />
# Vendor class: <code>PXEClient:Arch:00000:UNDI:002001</code><br />
# Filename: <code>/</code><br />
<br />
The minimal set of files that your TFTP server needs to host are:<br />
<br />
# <code>bcm2711-rpi-4-b.dtb</code> (from [https://raw.githubusercontent.com/raspberrypi/firmware/master/boot/bcm2711-rpi-4-b.dtb raspberrypi/firmware/master/boot/bcm2711-rpi-4-b.dtb])<br />
# <code>cmdline.txt</code> (see below)<br />
# <code>config.txt</code> (see below)<br />
# <code>fixup4.dat</code> (from [https://raw.githubusercontent.com/raspberrypi/firmware/master/boot/fixup4.dat raspberrypi/firmware/master/boot/fixup4.dat], alternatively <code>fixup4cd.dat</code> for the cut down version)<br />
# <code>initramfs-rpi4</code> (from [http://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/initramfs-rpi4 alpine/edge/releases/aarch64/netboot/initramfs-rpi4])<br />
# <code>start4.elf</code> (from [https://raw.githubusercontent.com/raspberrypi/firmware/master/boot/start4.elf raspberrypi/firmware/master/boot/start4.elf], alternatively <code>start4cd.elf</code> for the cut down version)<br />
# <code>vmlinuz-rpi4</code> (from [http://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/vmlinuz-rpi4 alpine/edge/releases/aarch64/netboot/vmlinuz-rpi4])<br />
<br />
<code>config.txt</code>:<br />
{{cmd|<nowiki>[pi4]<br />
kernel=vmlinuz-rpi4<br />
initramfs initramfs-rpi4<br />
arm_64bit=1<br />
</nowiki>}}<br />
<br />
<code>cmdline.txt</code>:<br />
{{cmd|<nowiki>modules=loop,squashfs console=ttyAMA0,115200 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main modloop=http://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/modloop-rpi4</nowiki>}}<br />
<br />
Instead of using the http://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/ base URL above, pinning to a specific point in time is preferred. Raspberry Pi 4 netboot files are available from https://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot-20230329/ onward.<br />
<br />
With the above configured the Raspberry Pi 4 should be able to boot from the network without an SD card.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Long boot time when running headless ===<br />
<br />
If no peripherals are connected, the system might hang for an exceptionally long period of time while it attempts to accumulate entropy.<br />
<br />
If this is the case, simply plugging in any USB device should work around this issue, since it increases the amount of entropy available to the kernel via interrupts.<br />
<br />
=== apk indicating 'No space left on device' ===<br />
<br />
Note some models of the Raspberry Pi such as the 3A+ only have 512M of RAM, which on fresh Alpine deployment will only leave around 200M for tmpfs root. It's important to keep this limitation in mind when using these boards.<br />
<br />
=== Wireless support with older Alpine images ===<br />
<br />
If you need Wi-Fi, you'll need to [https://github.com/RPi-Distro/firmware-nonfree/tree/master/brcm download] the latest Broadcom drivers to your SD card.<br />
(Replace /mnt/sdcard with the correct mount point.)<br />
<br />
git clone --depth 1 https://github.com/RPi-Distro/firmware-nonfree.git<br />
cp firmware-nonfree/brcm/* /mnt/sdcard/firmware/brcm<br />
<br />
== See Also ==<br />
<br />
* [[Classic install or sys mode on Raspberry Pi]] - a variant.<br />
* [[Raspberry Pi 3 - Setting Up Bluetooth]]<br />
* [[Raspberry Pi 3 - Configuring it as wireless access point -AP Mode]]<br />
* [[Raspberry Pi 3 - Browser Client]]<br />
* [[Linux Router with VPN on a Raspberry Pi]]<br />
* [[Create a bootable SDHC from a Mac]]<br />
* Build custom Raspberry Pi images based on Alpine via [https://github.com/tolstoyevsky/pieman Pieman]<br />
* [[Tutorials and Howtos#Raspberry Pi]]<br />
<br />
[[Category:Installation]]<br />
[[Category: Raspberry]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Raspberry_Pi&diff=23685Raspberry Pi2023-06-20T18:41:49Z<p>Psykose: clarify</p>
<hr />
<div>{{warning | 11 Feb 2021 - There is currently a known bug upstream <br />[https://github.com/raspberrypi/firmware/issues/1529 kernel/initramfs cannot be loaded from subdirectory with same name as volume label]. Since the kernel is installed to <code>boot/</code>, you must not use a label named <code>boot</code> too. }}<br />
<br />
{{TOC right}}<br />
<br />
This tutorial explains how to install Alpine Linux on a Raspberry Pi. Alpine Linux will be installed in [[Installation#Diskless_Mode|diskless mode]], hence, [[Alpine local backup|Alpine Local Backup (lbu)]] is required to save modifications between reboots.<br />
<br />
For scenarios where there is not expected to be significant changes to disk after setup (like running a static HTTP server), this is likely preferable, as running the entire system from memory will improve performance (by avoiding the slow SD card) and improve the SD card life (by reducing the writes to the card, as all logging will happen in RAM). Diskless installations still allow you to install packages, save local files, and tune the system to your needs.<br />
<br />
If any of the following apply, then installation in [[Classic install or sys mode on Raspberry Pi|sys-mode installation]] is likely more appropriate.<br />
<br />
* There will be constant changes to the disk after initial setup (for example, if you expect people to login and save files to their home directories)<br />
* Logs should persists across reboots<br />
* Plan to install packages which consume more space than can be loaded into RAM<br />
* Plan to install kernel modules (such as ZFS)<br />
<br />
== Preparation ==<br />
<br />
# [http://alpinelinux.org/downloads/ Download] the Alpine for Raspberry Pi tarball. You should be safe using the '''armhf''' build on all versions of Raspberry Pi (including Pi Zero and Compute Modules); but it may perform less optimally on recent versions of Raspberry Pi. The '''armv7''' build is compatible with Raspberry Pi 2 Model B. The '''aarch64''' build should be compatible with Raspberry Pi 2 Model v1.2, Raspberry Pi 3 and Compute Module 3, and Raspberry Pi 4 model B.<br />
# [[Create_a_Bootable_Device#Manually_copying_Alpine_files|Create a bootable FAT32 partition on your SD card.]] The partitioning and formatting part of the instructions on the linked page could be done using a graphical partitioning tool such as [https://en.wikipedia.org/wiki/GNOME_Disks gnome-disks], just make sure the partition type is <code>W95 FAT32 (LBA)</code>. (The current type can be found in the "Type" column in the output of <code>fdisk -l</code>.)<br />
# Extract the tarball to the root of the bootable FAT32 partition.<br />
<br />
To setup a headless system, a bootstrapping configuration overlay file [https://github.com/macmpi/alpine-linux-headless-bootstrap headless.apkovl.tar.gz] may be added to enable basic networking, so that following configuration steps can be performed under <code>ssh</code>. Pi Zero may be configured with simple USB ethernet-gadget networking with another computer sharing its internet connection.<br />
<br />
Optionally create a '''usercfg.txt''' file on the partition to configure low-level system settings. Specifications can be found [https://www.raspberrypi.org/documentation/configuration/config-txt here]. However, note some settings can only be set directly in '''config.txt''', which may be overwritten after updates. In particular, <code>gpu_mem</code> will have no effect when specified in '''usercfg.txt''' ([https://github.com/raspberrypi/firmware/issues/1332 source]). Some interesting values include:<br />
* To enable the UART console: <code>enable_uart=1</code><br />
* To enable audio: <code>dtparam=audio=on</code><br />
* If you see black edges around your screen after booting the Pi, you can add <code>disable_overscan=1</code><br />
* If you plan to install on a Pi Compute Module 4 with I/O board, you may need to add: <code>otg_mode=1</code><br />
<br />
Recent versions include Broadcom firmware files. If you're using an older Alpine version, see [[#Wireless_support_with_older_Alpine_images|section below]].<br />
<br />
== Installation ==<br />
<br />
Follow these steps to install Alpine Linux in Diskless Mode:<br />
<br />
# Insert the SD card into the Raspberry Pi and power it on<br />
# Login into the Alpine system as root. Leave the password empty.<br />
# Type <code>setup-alpine</code><br />
# Once the installation is complete, commit the changes by typing <code>lbu commit -d</code><br />
<br />
Type <code>reboot</code> to verify that the installation was indeed successful.<br />
<br />
== Post Installation ==<br />
<br />
=== Update the System ===<br />
<br />
After installation, make sure your system is up-to-date:<br />
<br />
{{cmd|apk update<br />
apk upgrade}}<br />
<br />
Don't forget to save the changes:<br />
<br />
{{cmd|lbu commit -d}}<br />
<br />
Note: this does not upgrade the kernel. In order to upgrade the kernel, a full upgrade of the Alpine Linux version must be performed as described in [[Upgrading Alpine#Upgrading Alpine Linux on other removable media (such as CF/USB)|upgrading Alpine Linux for removable media]].<br />
<br />
=== Clock-related error messages ===<br />
<br />
During the booting time, you might notice errors related to the hardware clock. The Raspberry Pi does not have<br />
a hardware clock, thus you need to disable the hwclock daemon and enable swclock:<br />
<br />
{{cmd|rc-update add swclock boot # enable the software clock<br />
rc-update del hwclock boot # disable the hardware clock}}<br />
<br />
Since the Raspberry Pi does not have a clock, Alpine Linux needs to know what the time is by using a<br />
[https://en.wikipedia.org/wiki/Network_Time_Protocol Network Time Protocol (NTP)] daemon. Make sure you have a<br />
NTP daemon installed and running. If you are not sure, you can install an NTP client by running the following<br />
command:<br />
<br />
{{cmd|setup-ntp}}<br />
<br />
The Busybox NTP client might be the most lightweight solution. Save the changes and reboot, once the NTP software is<br />
installed and running:<br />
<br />
{{cmd|lbu commit -d<br />
reboot}}<br />
<br />
After reboot, make sure the <code>date</code> command outputs the correct date and time.<br />
<br />
=== WiFi on boot ===<br />
If you have already [[Connecting_to_a_wireless_access_point|configured WiFi]] during the setup, the connection will not return on reboot.<br />
You will need to start up a service to automatically connect to the wireless access point.<br />
# Run <code>rc-update add wpa_supplicant boot</code> to connect to the wireless access point during bootup.<br />
# Run it manually with <code>/etc/init.d/wpa_supplicant start</code>.<br />
<br />
=== Enable Graphics ===<br />
Remount the boot partition writeable (i.e. <code>/media/mmcblk0p1</code>):<br />
<br />
{{cmd|mount /media/mmcblk0p1 -o rw,remount}}<br />
<br />
Add the following lines to <code>/media/mmcblk0p1/config.txt</code>:<br />
<br />
dtoverlay=vc4-kms-v3d<br />
<br />
If you are experiencing graphical issues, you can also try:<br />
<br />
dtoverlay=vc4-fkms-v3d<br />
<br />
And perhaps also raising the default <code>gpu_mem</code>:<br />
<br />
gpu_mem=128<br />
<br />
Note that raising the gpu memory is not likely to [https://www.raspberrypi.com/documentation/computers/config_txt.html#gpu_mem actually improve performance on the Pi4]<br />
<br />
Install the Mesa drivers:<br />
<br />
{{cmd|<nowiki>apk add mesa-dri-gallium</nowiki>}}<br />
<br />
Then reboot:<br />
<br />
{{cmd|lbu_commit -d; reboot}}<br />
<br />
=== WiFi drivers ===<br />
As of Alpine 3.14, the WiFi drivers for the Raspberry Pi were moved from <code>linux-firmware-brcm</code> to the <code>linux-firmware-cypress</code> package (source?). Since the images seem to be an outdated version of the former, Wi-Fi will work during installation, but after the first update it will break.<br />
Use the ethernet interface to download the required packages:<br />
<br />
{{cmd|apk add linux-firmware-cypress}}<br />
<br />
And reboot.<br />
<br />
== Persistent storage ==<br />
=== Loopback image with overlayfs ===<br />
<br />
When you install Alpine in diskless mode, the entire system is loaded into memory at boot. If you want additional storage (for example, if you need more space than offered by your RAM) we need to create loop-back storage onto the SD card mounted with overlayfs.<br />
<br />
First, make the SD card writable again and change fstab to always do so:<br />
{{cmd|mount /media/mmcblk0p1 -o rw,remount<br />
sed -i 's/vfat\ ro,/vfat\ rw,/' /etc/fstab}}<br />
<br />
Create the loop-back file, this example is 1 GB:<br />
<br />
{{cmd|dd if&#61;/dev/zero of&#61;/media/mmcblk0p1/persist.img bs&#61;1024 count&#61;0 seek&#61;1048576}}<br />
<br />
Install the ext utilities:<br />
<br />
{{cmd|apk add e2fsprogs}}<br />
<br />
Format the loop-back file:<br />
<br />
{{cmd|mkfs.ext4 /media/mmcblk0p1/persist.img}}<br />
<br />
Mount the storage: <br />
<br />
{{cmd|echo "/media/mmcblk0p1/persist.img /media/persist ext4 rw,relatime,errors&#61;remount-ro 0 0" >> /etc/fstab<br />
mkdir /media/persist <br />
mount -a}}<br />
<br />
Make the overlay folders, we are using the /usr directory here, but you can use /home or anything else. <br />
{{Warning|Overlay workdir needs to be an empty directory on the same filesystem mount as the upper directory. So each overlay must use its own workdir.}}<br />
<br />
<br />
{{cmd|mkdir /media/persist/usr <br />
mkdir /media/persist/.work_usr <br />
echo "overlay /usr overlay lowerdir&#61;/usr,upperdir&#61;/media/persist/usr,workdir&#61;/media/persist/.work_usr 0 0" >> /etc/fstab <br />
mount -a}}<br />
<br />
Your /etc/fstab should look something like this:<br />
{{Cmd|/dev/cdrom /media/cdrom iso9660 noauto,ro 0 0<br />
/dev/usbdisk /media/usb vfat noauto,ro 0 0<br />
/dev/mmcblk0p1 /media/mmcblk0p1 vfat rw,relatime,fmask&#61;0022,dmask&#61;0022,errors&#61;remount-ro 0 0<br />
/media/mmcblk0p1/persist.img /media/persist ext4 rw,relatime,errors&#61;remount-ro 0 0<br />
overlay /usr overlay lowerdir&#61;/usr,upperdir&#61;/media/persist/usr,workdir&#61;/media/persist/.work_usr 0 0}}<br />
<br />
Now commit the changes: (optionally remove the e2fsprogs, but it does contain repair tools)<br />
{{cmd|lbu_commit -d}}<br />
<br />
Remember, with this setup if you install things and you have done this overlay for /usr, you must not commit the 'apk add', otherwise, while it boots it will try and install it to memory, not to the persistent storage.<br />
<br />
If you do want to install something small at boot, you can use `apk add` and `lbu commit -d`.<br />
<br />
If it is something a bit bigger, then you can use `apk add` but then not commit it. It will be persistent (in /user), but be sure to check everything you need is in that directory and not in folders you have not made persistent.<br />
<br />
=== Traditional disk-based (sys) installation ===<br />
{{Merge|Classic install or sys mode on Raspberry Pi|There's an existing page for sys-installations on RasPi.}}<br />
<br />
It is also possible to switch to a fully disk-based installation. This is not yet formally supported, but can be done somewhat manually. This frees all the memory otherwise needed for the root filesystem, allowing more installed packages.<br />
<br />
Split your SD card into two partitions: the FAT32 boot partition described above (in this example it'll be <code>mmcblk0p1</code>) , and a second partition to hold the root filesystem (here it'll be <code>mmcblk0p2</code>). Boot and configure your diskless system as above, then create a root filesystem:<br />
<br />
{{cmd|apk add e2fsprogs<br />
mkfs.ext4 /dev/mmcblk0p2}}<br />
<br />
Now do a disk install via a mountpoint. The <code>setup-disk</code> script will give some errors about syslinux/extlinux, but you can ignore them.<br />
The Raspberry Pi doesn't need them to boot.<br />
<br />
{{cmd|<nowiki>mkdir /stage<br />
mount /dev/mmcblk0p2 /stage<br />
setup-disk -o /media/mmcblk0p1/MYHOSTNAME.apkovl.tar.gz /stage<br />
# (ignore errors about syslinux/extlinux)</nowiki>}}<br />
<br />
Add a line to <code>/stage/etc/fstab</code> to mount the Pi's boot partition again:<br />
<br />
{{cmd|/dev/mmcblk0p1 /media/mmcblk0p1 vfat defaults 0 0}}<br />
<br />
Now add a <code>root=/dev/mmcblk0p2</code> parameter to the Pi's boot command line, either <code>cmdline-rpi2.txt</code> or <code>cmdline-rpi.txt</code> depending on model:<br />
<br />
{{cmd|<nowiki>mount -o remount,rw /media/mmcblk0p1<br />
sed -i '$ s/$/ root=\/dev\/mmcblk0p2/' /media/mmcblk0p1/cmdline-rpi2.txt</nowiki>}}<br />
<br />
You might also consider <code>overlaytmpfs=yes</code> here, which will cause the underlying SD card root filesystem to be mounted read-only, with an overlayed tmpfs for modifications which will be discarded at shutdown.<br />
<br />
N.B. <b>the contents of /boot will be ignored when the Pi boots</b>. It will use the kernel, initramfs, and modloop images from the FAT32 boot partition. To update the kernel, initfs or modules, you will need to manually (generate and) copy these to the boot partition or you could use bind mount, in which case,<br />
copying the files to boot partition manually, is not needed.<br />
<br />
{{cmd|<nowiki>echo /media/mmcblk0p1/boot /boot none defaults,bind 0 0 >> /etc/fstab</nowiki>}}<br />
<br />
=== Persistent Installation on Raspberry Pi 3 ===<br />
See [[Classic install or sys mode on Raspberry Pi]] and https://web.archive.org/web/20171125115835/https://forum.alpinelinux.org/comment/1084#comment-1084<br />
<br />
=== Persistent Installation on Raspberry Pi 4 ===<br />
As of 3.14, setup-alpine should ask you if you want to create a sys mode partition on your Raspberry Pi 4.<br />
<br />
== Netboot ==<br />
<br />
=== Netbooting Raspberry Pi 4 ===<br />
<br />
The Raspberry Pi 4 bootloader can be configured to boot from the network [https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-4-bootloader-configuration]. Configure the bootloader with at least<br />
<br />
{{cmd|<nowiki>BOOT_ORDER=0xf142<br />
TFTP_PREFIX=1</nowiki>}}<br />
<br />
and optionally also {{cmd|<nowiki>TFTP_IP=x.x.x.x</nowiki>}} where <code>x.x.x.x</code> is the IP address of your TFTP server.<br />
<br />
If not configuring <code>TFTP_IP</code> in the bootloader, you'll need to configure your DHCP server to advertise the TFTP server IP address. This varies depending on your DHCP server; use the following details if applicable:<br />
<br />
# Vendor class: <code>PXEClient:Arch:00000:UNDI:002001</code><br />
# Filename: <code>/</code><br />
<br />
The minimal set of files that your TFTP server needs to host are:<br />
<br />
# <code>bcm2711-rpi-4-b.dtb</code> (from [https://raw.githubusercontent.com/raspberrypi/firmware/master/boot/bcm2711-rpi-4-b.dtb raspberrypi/firmware/master/boot/bcm2711-rpi-4-b.dtb])<br />
# <code>cmdline.txt</code> (see below)<br />
# <code>config.txt</code> (see below)<br />
# <code>fixup4.dat</code> (from [https://raw.githubusercontent.com/raspberrypi/firmware/master/boot/fixup4.dat raspberrypi/firmware/master/boot/fixup4.dat], alternatively <code>fixup4cd.dat</code> for the cut down version)<br />
# <code>initramfs-rpi4</code> (from [http://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/initramfs-rpi4 alpine/edge/releases/aarch64/netboot/initramfs-rpi4])<br />
# <code>start4.elf</code> (from [https://raw.githubusercontent.com/raspberrypi/firmware/master/boot/start4.elf raspberrypi/firmware/master/boot/start4.elf], alternatively <code>start4cd.elf</code> for the cut down version)<br />
# <code>vmlinuz-rpi4</code> (from [http://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/vmlinuz-rpi4 alpine/edge/releases/aarch64/netboot/vmlinuz-rpi4])<br />
<br />
<code>config.txt</code>:<br />
{{cmd|<nowiki>[pi4]<br />
kernel=vmlinuz-rpi4<br />
initramfs initramfs-rpi4<br />
arm_64bit=1<br />
</nowiki>}}<br />
<br />
<code>cmdline.txt</code>:<br />
{{cmd|<nowiki>modules=loop,squashfs console=ttyAMA0,115200 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main modloop=http://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/modloop-rpi4</nowiki>}}<br />
<br />
Instead of using the http://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/ base URL above, pinning to a specific point in time is preferred. Raspberry Pi 4 netboot files are available from https://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot-20230329/ onward.<br />
<br />
With the above configured the Raspberry Pi 4 should be able to boot from the network without an SD card.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Long boot time when running headless ===<br />
<br />
If no peripherals are connected, the system might hang for an exceptionally long period of time while it attempts to accumulate entropy.<br />
<br />
If this is the case, simply plugging in any USB device should work around this issue, since it increases the amount of entropy available to the kernel via interrupts.<br />
<br />
=== apk indicating 'No space left on device' ===<br />
<br />
Note some models of the Raspberry Pi such as the 3A+ only have 512M of RAM, which on fresh Alpine deployment will only leave around 200M for tmpfs root. It's important to keep this limitation in mind when using these boards.<br />
<br />
=== Wireless support with older Alpine images ===<br />
<br />
If you need Wi-Fi, you'll need to [https://github.com/RPi-Distro/firmware-nonfree/tree/master/brcm download] the latest Broadcom drivers to your SD card.<br />
(Replace /mnt/sdcard with the correct mount point.)<br />
<br />
git clone --depth 1 https://github.com/RPi-Distro/firmware-nonfree.git<br />
cp firmware-nonfree/brcm/* /mnt/sdcard/firmware/brcm<br />
<br />
== See Also ==<br />
<br />
* [[Classic install or sys mode on Raspberry Pi]] - a variant.<br />
* [[Raspberry Pi 3 - Setting Up Bluetooth]]<br />
* [[Raspberry Pi 3 - Configuring it as wireless access point -AP Mode]]<br />
* [[Raspberry Pi 3 - Browser Client]]<br />
* [[Linux Router with VPN on a Raspberry Pi]]<br />
* [[Create a bootable SDHC from a Mac]]<br />
* Build custom Raspberry Pi images based on Alpine via [https://github.com/tolstoyevsky/pieman Pieman]<br />
* [[Tutorials and Howtos#Raspberry Pi]]<br />
<br />
[[Category:Installation]]<br />
[[Category: Raspberry]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Raspberry_Pi&diff=23683Raspberry Pi2023-06-20T18:26:29Z<p>Psykose: wireguard not external</p>
<hr />
<div>{{warning | 11 Feb 2021 - There is currently a known bug upstream <br />[https://github.com/raspberrypi/firmware/issues/1529 kernel/initramfs cannot be loaded from subdirectory with same name as volume label] }}<br />
<br />
{{TOC right}}<br />
<br />
This tutorial explains how to install Alpine Linux on a Raspberry Pi. Alpine Linux will be installed in [[Installation#Diskless_Mode|diskless mode]], hence, [[Alpine local backup|Alpine Local Backup (lbu)]] is required to save modifications between reboots.<br />
<br />
For scenarios where there is not expected to be significant changes to disk after setup (like running a static HTTP server), this is likely preferable, as running the entire system from memory will improve performance (by avoiding the slow SD card) and improve the SD card life (by reducing the writes to the card, as all logging will happen in RAM). Diskless installations still allow you to install packages, save local files, and tune the system to your needs.<br />
<br />
If any of the following apply, then installation in [[Classic install or sys mode on Raspberry Pi|sys-mode installation]] is likely more appropriate.<br />
<br />
* There will be constant changes to the disk after initial setup (for example, if you expect people to login and save files to their home directories)<br />
* Logs should persists across reboots<br />
* Plan to install packages which consume more space than can be loaded into RAM<br />
* Plan to install kernel modules (such as ZFS)<br />
<br />
== Preparation ==<br />
<br />
# [http://alpinelinux.org/downloads/ Download] the Alpine for Raspberry Pi tarball. You should be safe using the '''armhf''' build on all versions of Raspberry Pi (including Pi Zero and Compute Modules); but it may perform less optimally on recent versions of Raspberry Pi. The '''armv7''' build is compatible with Raspberry Pi 2 Model B. The '''aarch64''' build should be compatible with Raspberry Pi 2 Model v1.2, Raspberry Pi 3 and Compute Module 3, and Raspberry Pi 4 model B.<br />
# [[Create_a_Bootable_Device#Manually_copying_Alpine_files|Create a bootable FAT32 partition on your SD card.]] The partitioning and formatting part of the instructions on the linked page could be done using a graphical partitioning tool such as [https://en.wikipedia.org/wiki/GNOME_Disks gnome-disks], just make sure the partition type is <code>W95 FAT32 (LBA)</code>. (The current type can be found in the "Type" column in the output of <code>fdisk -l</code>.)<br />
# Extract the tarball to the root of the bootable FAT32 partition.<br />
<br />
To setup a headless system, a bootstrapping configuration overlay file [https://github.com/macmpi/alpine-linux-headless-bootstrap headless.apkovl.tar.gz] may be added to enable basic networking, so that following configuration steps can be performed under <code>ssh</code>. Pi Zero may be configured with simple USB ethernet-gadget networking with another computer sharing its internet connection.<br />
<br />
Optionally create a '''usercfg.txt''' file on the partition to configure low-level system settings. Specifications can be found [https://www.raspberrypi.org/documentation/configuration/config-txt here]. However, note some settings can only be set directly in '''config.txt''', which may be overwritten after updates. In particular, <code>gpu_mem</code> will have no effect when specified in '''usercfg.txt''' ([https://github.com/raspberrypi/firmware/issues/1332 source]). Some interesting values include:<br />
* To enable the UART console: <code>enable_uart=1</code><br />
* To enable audio: <code>dtparam=audio=on</code><br />
* If you see black edges around your screen after booting the Pi, you can add <code>disable_overscan=1</code><br />
* If you plan to install on a Pi Compute Module 4 with I/O board, you may need to add: <code>otg_mode=1</code><br />
<br />
Recent versions include Broadcom firmware files. If you're using an older Alpine version, see [[#Wireless_support_with_older_Alpine_images|section below]].<br />
<br />
== Installation ==<br />
<br />
Follow these steps to install Alpine Linux in Diskless Mode:<br />
<br />
# Insert the SD card into the Raspberry Pi and power it on<br />
# Login into the Alpine system as root. Leave the password empty.<br />
# Type <code>setup-alpine</code><br />
# Once the installation is complete, commit the changes by typing <code>lbu commit -d</code><br />
<br />
Type <code>reboot</code> to verify that the installation was indeed successful.<br />
<br />
== Post Installation ==<br />
<br />
=== Update the System ===<br />
<br />
After installation, make sure your system is up-to-date:<br />
<br />
{{cmd|apk update<br />
apk upgrade}}<br />
<br />
Don't forget to save the changes:<br />
<br />
{{cmd|lbu commit -d}}<br />
<br />
Note: this does not upgrade the kernel. In order to upgrade the kernel, a full upgrade of the Alpine Linux version must be performed as described in [[Upgrading Alpine#Upgrading Alpine Linux on other removable media (such as CF/USB)|upgrading Alpine Linux for removable media]].<br />
<br />
=== Clock-related error messages ===<br />
<br />
During the booting time, you might notice errors related to the hardware clock. The Raspberry Pi does not have<br />
a hardware clock, thus you need to disable the hwclock daemon and enable swclock:<br />
<br />
{{cmd|rc-update add swclock boot # enable the software clock<br />
rc-update del hwclock boot # disable the hardware clock}}<br />
<br />
Since the Raspberry Pi does not have a clock, Alpine Linux needs to know what the time is by using a<br />
[https://en.wikipedia.org/wiki/Network_Time_Protocol Network Time Protocol (NTP)] daemon. Make sure you have a<br />
NTP daemon installed and running. If you are not sure, you can install an NTP client by running the following<br />
command:<br />
<br />
{{cmd|setup-ntp}}<br />
<br />
The Busybox NTP client might be the most lightweight solution. Save the changes and reboot, once the NTP software is<br />
installed and running:<br />
<br />
{{cmd|lbu commit -d<br />
reboot}}<br />
<br />
After reboot, make sure the <code>date</code> command outputs the correct date and time.<br />
<br />
=== WiFi on boot ===<br />
If you have already [[Connecting_to_a_wireless_access_point|configured WiFi]] during the setup, the connection will not return on reboot.<br />
You will need to start up a service to automatically connect to the wireless access point.<br />
# Run <code>rc-update add wpa_supplicant boot</code> to connect to the wireless access point during bootup.<br />
# Run it manually with <code>/etc/init.d/wpa_supplicant start</code>.<br />
<br />
=== Enable Graphics ===<br />
Remount the boot partition writeable (i.e. <code>/media/mmcblk0p1</code>):<br />
<br />
{{cmd|mount /media/mmcblk0p1 -o rw,remount}}<br />
<br />
Add the following lines to <code>/media/mmcblk0p1/config.txt</code>:<br />
<br />
dtoverlay=vc4-kms-v3d<br />
<br />
If you are experiencing graphical issues, you can also try:<br />
<br />
dtoverlay=vc4-fkms-v3d<br />
<br />
And perhaps also raising the default <code>gpu_mem</code>:<br />
<br />
gpu_mem=128<br />
<br />
Note that raising the gpu memory is not likely to [https://www.raspberrypi.com/documentation/computers/config_txt.html#gpu_mem actually improve performance on the Pi4]<br />
<br />
Install the Mesa drivers:<br />
<br />
{{cmd|<nowiki>apk add mesa-dri-gallium</nowiki>}}<br />
<br />
Then reboot:<br />
<br />
{{cmd|lbu_commit -d; reboot}}<br />
<br />
=== WiFi drivers ===<br />
As of Alpine 3.14, the WiFi drivers for the Raspberry Pi were moved from <code>linux-firmware-brcm</code> to the <code>linux-firmware-cypress</code> package (source?). Since the images seem to be an outdated version of the former, Wi-Fi will work during installation, but after the first update it will break.<br />
Use the ethernet interface to download the required packages:<br />
<br />
{{cmd|apk add linux-firmware-cypress}}<br />
<br />
And reboot.<br />
<br />
== Persistent storage ==<br />
=== Loopback image with overlayfs ===<br />
<br />
When you install Alpine in diskless mode, the entire system is loaded into memory at boot. If you want additional storage (for example, if you need more space than offered by your RAM) we need to create loop-back storage onto the SD card mounted with overlayfs.<br />
<br />
First, make the SD card writable again and change fstab to always do so:<br />
{{cmd|mount /media/mmcblk0p1 -o rw,remount<br />
sed -i 's/vfat\ ro,/vfat\ rw,/' /etc/fstab}}<br />
<br />
Create the loop-back file, this example is 1 GB:<br />
<br />
{{cmd|dd if&#61;/dev/zero of&#61;/media/mmcblk0p1/persist.img bs&#61;1024 count&#61;0 seek&#61;1048576}}<br />
<br />
Install the ext utilities:<br />
<br />
{{cmd|apk add e2fsprogs}}<br />
<br />
Format the loop-back file:<br />
<br />
{{cmd|mkfs.ext4 /media/mmcblk0p1/persist.img}}<br />
<br />
Mount the storage: <br />
<br />
{{cmd|echo "/media/mmcblk0p1/persist.img /media/persist ext4 rw,relatime,errors&#61;remount-ro 0 0" >> /etc/fstab<br />
mkdir /media/persist <br />
mount -a}}<br />
<br />
Make the overlay folders, we are using the /usr directory here, but you can use /home or anything else. <br />
{{Warning|Overlay workdir needs to be an empty directory on the same filesystem mount as the upper directory. So each overlay must use its own workdir.}}<br />
<br />
<br />
{{cmd|mkdir /media/persist/usr <br />
mkdir /media/persist/.work_usr <br />
echo "overlay /usr overlay lowerdir&#61;/usr,upperdir&#61;/media/persist/usr,workdir&#61;/media/persist/.work_usr 0 0" >> /etc/fstab <br />
mount -a}}<br />
<br />
Your /etc/fstab should look something like this:<br />
{{Cmd|/dev/cdrom /media/cdrom iso9660 noauto,ro 0 0<br />
/dev/usbdisk /media/usb vfat noauto,ro 0 0<br />
/dev/mmcblk0p1 /media/mmcblk0p1 vfat rw,relatime,fmask&#61;0022,dmask&#61;0022,errors&#61;remount-ro 0 0<br />
/media/mmcblk0p1/persist.img /media/persist ext4 rw,relatime,errors&#61;remount-ro 0 0<br />
overlay /usr overlay lowerdir&#61;/usr,upperdir&#61;/media/persist/usr,workdir&#61;/media/persist/.work_usr 0 0}}<br />
<br />
Now commit the changes: (optionally remove the e2fsprogs, but it does contain repair tools)<br />
{{cmd|lbu_commit -d}}<br />
<br />
Remember, with this setup if you install things and you have done this overlay for /usr, you must not commit the 'apk add', otherwise, while it boots it will try and install it to memory, not to the persistent storage.<br />
<br />
If you do want to install something small at boot, you can use `apk add` and `lbu commit -d`.<br />
<br />
If it is something a bit bigger, then you can use `apk add` but then not commit it. It will be persistent (in /user), but be sure to check everything you need is in that directory and not in folders you have not made persistent.<br />
<br />
=== Traditional disk-based (sys) installation ===<br />
{{Merge|Classic install or sys mode on Raspberry Pi|There's an existing page for sys-installations on RasPi.}}<br />
<br />
It is also possible to switch to a fully disk-based installation. This is not yet formally supported, but can be done somewhat manually. This frees all the memory otherwise needed for the root filesystem, allowing more installed packages.<br />
<br />
Split your SD card into two partitions: the FAT32 boot partition described above (in this example it'll be <code>mmcblk0p1</code>) , and a second partition to hold the root filesystem (here it'll be <code>mmcblk0p2</code>). Boot and configure your diskless system as above, then create a root filesystem:<br />
<br />
{{cmd|apk add e2fsprogs<br />
mkfs.ext4 /dev/mmcblk0p2}}<br />
<br />
Now do a disk install via a mountpoint. The <code>setup-disk</code> script will give some errors about syslinux/extlinux, but you can ignore them.<br />
The Raspberry Pi doesn't need them to boot.<br />
<br />
{{cmd|<nowiki>mkdir /stage<br />
mount /dev/mmcblk0p2 /stage<br />
setup-disk -o /media/mmcblk0p1/MYHOSTNAME.apkovl.tar.gz /stage<br />
# (ignore errors about syslinux/extlinux)</nowiki>}}<br />
<br />
Add a line to <code>/stage/etc/fstab</code> to mount the Pi's boot partition again:<br />
<br />
{{cmd|/dev/mmcblk0p1 /media/mmcblk0p1 vfat defaults 0 0}}<br />
<br />
Now add a <code>root=/dev/mmcblk0p2</code> parameter to the Pi's boot command line, either <code>cmdline-rpi2.txt</code> or <code>cmdline-rpi.txt</code> depending on model:<br />
<br />
{{cmd|<nowiki>mount -o remount,rw /media/mmcblk0p1<br />
sed -i '$ s/$/ root=\/dev\/mmcblk0p2/' /media/mmcblk0p1/cmdline-rpi2.txt</nowiki>}}<br />
<br />
You might also consider <code>overlaytmpfs=yes</code> here, which will cause the underlying SD card root filesystem to be mounted read-only, with an overlayed tmpfs for modifications which will be discarded at shutdown.<br />
<br />
N.B. <b>the contents of /boot will be ignored when the Pi boots</b>. It will use the kernel, initramfs, and modloop images from the FAT32 boot partition. To update the kernel, initfs or modules, you will need to manually (generate and) copy these to the boot partition or you could use bind mount, in which case,<br />
copying the files to boot partition manually, is not needed.<br />
<br />
{{cmd|<nowiki>echo /media/mmcblk0p1/boot /boot none defaults,bind 0 0 >> /etc/fstab</nowiki>}}<br />
<br />
=== Persistent Installation on Raspberry Pi 3 ===<br />
See [[Classic install or sys mode on Raspberry Pi]] and https://web.archive.org/web/20171125115835/https://forum.alpinelinux.org/comment/1084#comment-1084<br />
<br />
=== Persistent Installation on Raspberry Pi 4 ===<br />
As of 3.14, setup-alpine should ask you if you want to create a sys mode partition on your Raspberry Pi 4.<br />
<br />
== Netboot ==<br />
<br />
=== Netbooting Raspberry Pi 4 ===<br />
<br />
The Raspberry Pi 4 bootloader can be configured to boot from the network [https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-4-bootloader-configuration]. Configure the bootloader with at least<br />
<br />
{{cmd|<nowiki>BOOT_ORDER=0xf142<br />
TFTP_PREFIX=1</nowiki>}}<br />
<br />
and optionally also {{cmd|<nowiki>TFTP_IP=x.x.x.x</nowiki>}} where <code>x.x.x.x</code> is the IP address of your TFTP server.<br />
<br />
If not configuring <code>TFTP_IP</code> in the bootloader, you'll need to configure your DHCP server to advertise the TFTP server IP address. This varies depending on your DHCP server; use the following details if applicable:<br />
<br />
# Vendor class: <code>PXEClient:Arch:00000:UNDI:002001</code><br />
# Filename: <code>/</code><br />
<br />
The minimal set of files that your TFTP server needs to host are:<br />
<br />
# <code>bcm2711-rpi-4-b.dtb</code> (from [https://raw.githubusercontent.com/raspberrypi/firmware/master/boot/bcm2711-rpi-4-b.dtb raspberrypi/firmware/master/boot/bcm2711-rpi-4-b.dtb])<br />
# <code>cmdline.txt</code> (see below)<br />
# <code>config.txt</code> (see below)<br />
# <code>fixup4.dat</code> (from [https://raw.githubusercontent.com/raspberrypi/firmware/master/boot/fixup4.dat raspberrypi/firmware/master/boot/fixup4.dat], alternatively <code>fixup4cd.dat</code> for the cut down version)<br />
# <code>initramfs-rpi4</code> (from [http://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/initramfs-rpi4 alpine/edge/releases/aarch64/netboot/initramfs-rpi4])<br />
# <code>start4.elf</code> (from [https://raw.githubusercontent.com/raspberrypi/firmware/master/boot/start4.elf raspberrypi/firmware/master/boot/start4.elf], alternatively <code>start4cd.elf</code> for the cut down version)<br />
# <code>vmlinuz-rpi4</code> (from [http://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/vmlinuz-rpi4 alpine/edge/releases/aarch64/netboot/vmlinuz-rpi4])<br />
<br />
<code>config.txt</code>:<br />
{{cmd|<nowiki>[pi4]<br />
kernel=vmlinuz-rpi4<br />
initramfs initramfs-rpi4<br />
arm_64bit=1<br />
</nowiki>}}<br />
<br />
<code>cmdline.txt</code>:<br />
{{cmd|<nowiki>modules=loop,squashfs console=ttyAMA0,115200 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main modloop=http://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/modloop-rpi4</nowiki>}}<br />
<br />
Instead of using the http://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot/ base URL above, pinning to a specific point in time is preferred. Raspberry Pi 4 netboot files are available from https://dl-cdn.alpinelinux.org/alpine/edge/releases/aarch64/netboot-20230329/ onward.<br />
<br />
With the above configured the Raspberry Pi 4 should be able to boot from the network without an SD card.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Long boot time when running headless ===<br />
<br />
If no peripherals are connected, the system might hang for an exceptionally long period of time while it attempts to accumulate entropy.<br />
<br />
If this is the case, simply plugging in any USB device should work around this issue, since it increases the amount of entropy available to the kernel via interrupts.<br />
<br />
=== apk indicating 'No space left on device' ===<br />
<br />
Note some models of the Raspberry Pi such as the 3A+ only have 512M of RAM, which on fresh Alpine deployment will only leave around 200M for tmpfs root. It's important to keep this limitation in mind when using these boards.<br />
<br />
=== Wireless support with older Alpine images ===<br />
<br />
If you need Wi-Fi, you'll need to [https://github.com/RPi-Distro/firmware-nonfree/tree/master/brcm download] the latest Broadcom drivers to your SD card.<br />
(Replace /mnt/sdcard with the correct mount point.)<br />
<br />
git clone --depth 1 https://github.com/RPi-Distro/firmware-nonfree.git<br />
cp firmware-nonfree/brcm/* /mnt/sdcard/firmware/brcm<br />
<br />
== See Also ==<br />
<br />
* [[Classic install or sys mode on Raspberry Pi]] - a variant.<br />
* [[Raspberry Pi 3 - Setting Up Bluetooth]]<br />
* [[Raspberry Pi 3 - Configuring it as wireless access point -AP Mode]]<br />
* [[Raspberry Pi 3 - Browser Client]]<br />
* [[Linux Router with VPN on a Raspberry Pi]]<br />
* [[Create a bootable SDHC from a Mac]]<br />
* Build custom Raspberry Pi images based on Alpine via [https://github.com/tolstoyevsky/pieman Pieman]<br />
* [[Tutorials and Howtos#Raspberry Pi]]<br />
<br />
[[Category:Installation]]<br />
[[Category: Raspberry]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Elogind&diff=23681Elogind2023-06-19T11:17:08Z<p>Psykose: recommend pam in installation</p>
<hr />
<div>[https://github.com/elogind/elogind '''elogind'''] is a login manager and provides support for <br />
<br />
* setting up necessary permissions for the desktop environment or window manager<br />
* handling poweroff, reboot, suspend and hibernate via '''loginctl''' command<br />
<br />
== Installation ==<br />
<br />
{{Cmd|# apk add {{Pkg|elogind}} {{Pkg|polkit-elogind}}<br />
# rc-update add elogind<br />
# rc-service elogind start }}<br />
<br />
Set up a [[PAM]] login.<br />
<br />
== Configuration ==<br />
<br />
=== logind.conf ===<br />
<br />
Edit {{Path|/etc/elogind/logind.conf}} to configure handling of power events, such as suspending the computer when power button is pressed:<br />
<br />
{{Cmd|<nowiki># sed -i 's|#HandlePowerKey=poweroff|HandlePowerKey=suspend|' /etc/elogind/logind.conf</nowiki>}}<br />
<br />
=== Working with Desktop Environments ===<br />
<br />
If using a Window Manager or Desktop Environment, such as [[Sway]], the user must ensure that login session is correctly configured. When correctly configured, the <code>loginctl</code> command should output the following:<br />
<br />
'''Using [[Sway]] and [[SDDM]]'''<br />
<br />
<p style="background-color:#f9f9f9; border:1px dashed #2f6fab; line-height:1.1em; padding:1em; font-family:monospace; font-size:10pt; white-space:pre; overflow:auto;"><span style="color:green;">~</span>'''$''' loginctl<br />
<br />
SESSION UID USER SEAT TTY <br />
c1 105 sddm seat0 <br />
c2 1000 User seat0 tty8<br />
<br />
2 sessions listed.<br />
</p><br />
<br />
If the output is <code>No session available.</code>, such as in the case of launching Sway from tty, suspend and many other functionality will not work. The user then must configure a display manager such as {{Pkg|greetd}}, [[SDDM]] or {{Pkg|lightdm|LightDM}}.<br />
<br />
== See also ==<br />
<br />
* [https://wiki.gentoo.org/wiki/Elogind elogind - Gentoo Wiki]<br />
<br />
[[Category:Desktop]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Wayland&diff=23680Wayland2023-06-19T11:12:12Z<p>Psykose: remove wrong information (there are no commented lines in /etc/pam.d/base-session, lines starting with - are not comments.)</p>
<hr />
<div>{{Expand|A more thorough guide to installing, configuring, and running {{Pkg|wayland}} on Alpine would be better. }}<br />
<br />
<br />
Wayland is a new display protocol that aims to replace X11.<br />
<br />
<br />
== XDG_RUNTIME_DIR ==<br />
<br />
As per the protocol spec, Wayland compositors require the <code>XDG_RUNTIME_DIR</code> variable to be set. There are a few ways to configure this variable:<br />
<br />
* A login manager such as [[Elogind]] can configure this and other XDG environment variables automatically.<br />
* [https://github.com/jjk-jacky/pam_rundir pam_rundir] can enable this for logins. To use this [[PAM]] is required.<br />
* Setting it up manually<br />
<br />
=== Configuring XDG_RUNTIME_DIR manually ===<br />
<br />
Generally, care should be taken when configuring the <code>XDG_*</code> variables manually as this configuration may have errors or conflict with other utilities that do this automatically.<br />
<br />
On a system that's not using elogind nor any pam module that handles this, it's often necessary to set up <code>XDG_RUNTIME_DIR</code> manually. This can be done by adding a snippet like this one to shell init scripts (e.g.: <code>~/.profile</code>):<br />
<br />
<pre><br />
if test -z "${XDG_RUNTIME_DIR}"; then<br />
export XDG_RUNTIME_DIR=/tmp/$(id -u)-runtime-dir<br />
if ! test -d "${XDG_RUNTIME_DIR}"; then<br />
mkdir "${XDG_RUNTIME_DIR}"<br />
chmod 0700 "${XDG_RUNTIME_DIR}"<br />
fi<br />
fi<br />
</pre><br />
<br />
== See also ==<br />
<br />
* [https://wiki.archlinux.org/title/Wayland Wayland - Arch Wiki]<br />
* [https://wiki.gentoo.org/wiki/Wayland Wayland - Gentoo Wiki]<br />
<br />
[[Category:Desktop]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Installation&diff=23673Installation2023-06-15T03:54:17Z<p>Psykose: update iso memory requirement</p>
<hr />
<div><br />
[[Image:hdd_mount.png|left|link=]]<br />
<br /><br />
<br />
<br />
<br />
<br />
This page exists to provide the basic overview to get started. But before actually installing, it can also help to skim through the [[Alpine_Linux:FAQ| Frequenty Asked Questions (FAQ)]], as well as to refer to the official installation guide at [https://docs.alpinelinux.org/ docs.alpinelinux.org].<br />
<br />
{{Tip|This is a wiki!<br />
If something isn't correct (anymore), or still incomplete, you will have to try figuring it out, or ask for the correct solution in the [https://alpinelinux.org/community/ community].<br />
<br />
And then carefully edit the wiki page.<br />
<br />
Just as those before you did it for you.<br />
}}<br />
<br />
<br />
== Minimal Hardware Requirements ==<br />
<br />
* At least 100 MB of RAM. [A graphical desktop system may require up to 1 GB minimum.]. Note that an installation itself (from iso) generally requires around 1GB during installation.<br />
* At least 0-700 MB space on a writable storage device. [Only required in "sys" or "data" mode installations (explained below). It is optional in "diskless" mode, where it may be used to save newer data and configurations states of a running system.]<br />
<br />
For more information please check [[Requirements]]<br />
<br />
== Installation Overview ==<br />
<br />
=== The general course of action ===<br />
{{Note|<br />
* For single-board-computer (SBC) architectures which can not boot .iso images, see [[Alpine_on_ARM|Alpine on ARM]] for peculiarities.<br />
* For headless system, initial network setup may be fed by pre-built <code>apkovl</code> overlay file, custom-made or via [https://github.com/macmpi/alpine-linux-headless-bootstrap/ 3rd party]}}<br />
<br />
As usual, starting an installation procedure requires some basic steps (additional details for all the steps follow [[Installation#Basic Installation Step Details|below]]):<br><br />
<br />
# Downloading and verifying the proper [https://alpinelinux.org/downloads/ stable-release ISO installation image-file] for the target computer's architecture with their corresponding <code>sha256</code> (checksum) and <code>GPG</code> (signature) files. <br />
# Either burning the ISO image-file onto a blank CD/DVD/Bluproper-ray disk with disk burning software, or flashing the installation image onto a bootable storage device (USB-device, CF-/MMC-/SD-card, floppy, ...).<br />
# Optionally, custom-made headless apkovl can be done by first booting the install media on some computer with a display and keyboard attached, or in a virtual machine, and doing an intermediate "diskless" setup of just the boot media (more details below), i.e. using the offical <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> to configure the system's network, possibly for dhcp if needed, a ssh server, and a login user. Choosing "disks=none" for now, yet, configure to store configs on the boot media (if it is writable, otherwise on a separate storage media). And afterwards calling <code>[[Alpine_local_backup|lbu commit]]</code> to store the configs as local backup. Then your completed setup, including its securely created own private keys, will readily get (re)loaded on every subsequent (headless) boot from your custom-build <code><hostname>.apkovl.tar.gz</code> stored on the boot media (or on an auxilary media or server location, in case the boot media is read-only).<br />
# Booting the target computer from the prepared disk or storage device.<br />
<br />
The boot process of the alpine installation image first copies the entire operating system into the RAM memory, and then already starts a complete Alpine Linux system from there. It will initially only provide a basic command line environment that does not depend on reading from any (possibly slow) initial boot media, anymore.<br />
<br />
Local log-in is possible as the user <code>root</code>. Initially, the root user has no password.<br />
<br />
At the command prompt, an interactive script named <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> is available to configure and install the initial Alpine Linux system.<br />
<br />
The question-and-answer dialog of <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> takes care of the base configuration and allows to configure the system to boot into one of three different '''Alpine Linux "disk" modes''': '''"diskless"'''(none), '''"data"''', or '''"sys"'''.<br />
<br />
These modes are explained in more detail in the following subsections.<br />
<br />
{{Note|It is really helpful for many cases that it is possible to first only complete a basic setup of the initial "diskless" installation media in order to prepare for the installation of the target system. For example, also to download and install some specific driver or software tool. And to possibly use more specific [[Alpine_setup_scripts|setup-scripts]] afterwards in order to proceed with the final installation in a custom way. A most basic pre-setup of just the "diskless" system may be completed by running <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> and answering "none" when asked for the disk to use, for where to store configs, and for the location of the package cache.<br />
<br />
Examples of preparation options:<br />
<br />
* Preparing a custom partitioning or filesystem scheme that avoids to use and/or overwrite an entire disk ([[Installation#Custom_partitioning_of_the_harddisk|details below]]).<br />
* Installing something that may be missing in the live system to configure the hardware, e.g. by using the alpine package manager <code>[[Alpine_Package_Keeper|apk]]</code>.<br />
<br />
Examples of proceeding options:<br />
<br />
* <code>[[Alpine_setup_scripts#setup-lbu|setup-lbu]]</code> to configure a "local backup" location for the diskless system, and <code>[[Alpine_local_backup|lbu commit]]</code> to then save the local configuration state.<br />
* <code>[[Alpine_setup_scripts#setup-apkcache|setup-apkcache]]</code> to configure a local package cache storage location.<br />
* <code>[[Alpine_setup_scripts#setup-disk|setup-disk]]</code> to add a "data" mode partition, or do a classic full install of the "diskless" system onto a "sys" disk or partition.<br />
<br />
There are many more [[Alpine_setup_scripts|setup-scripts]] available. All these tools may also be run later to adjust specific configurations. For example, to set up a graphical environment as covered under [[Installation#Post-Installation|Post-Installation]] below.<br />
}}<br />
<br />
==='''Diskless Mode'''=== <br />
This means the entire operating system with all applications are first loaded into RAM and then only run from there. This is the method already used to boot the .iso installation images, however <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> can also configure the installed system to continue to boot like this if "disk=none" is specified. The mode is extremely fast and can save on unnecessary disk spin-ups, power, and wear. It is similar to what other linux distributions may call a "frugal" install or boot into with a "toram" option. <br />
<br />
Custom configurations and package installations may optionally still be preserved or "persist" across reboots by using the Alpine local backup tool <code>[[Alpine_local_backup|lbu]]</code>. It enables committing and reverting system states by using .apkovl files that are saved to writable storage and loaded when booting. If additional or updated packages have been added to the system, these may also be made available for automatic (re)installation during the boot phase without any (re)downloading, by enabling a [[Alpine_Package_Keeper#Local_Cache|local package cache]] on the writable storage.<br />
<br />
[[https://gitlab.alpinelinux.org/alpine/alpine-conf/-/issues/10473 FIXME-1]: Storing local configs and the package cache on '''internal disks still require''' [[Alpine_local_backup#Saving_and_loading_ISO_image_customizations|some manual steps]] to have the partition listed, i.e. making a /etc/fstab entry, mountpoint, and mount, *before* running setup-alpine. The linked workaround also still requires to commit these configurations to disk manually before rebooting.]<br />
<br />
If a writable partition is available, <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> can be told to store the configs and the package cache on that writable partition. (Later, another directory on that same partition or another available partition may also be mounted as /home, or for example, for selected important applications to keep their run-time and user data on it.)<br />
<br />
The boot device of the newly configured local "diskless" system may remain the initial (and possibly read-only) installation media. But it is also possible to copy the boot system to a partition (e.g. /dev/sdXY) with <code>[[Alpine_setup_scripts#setup-bootable|setup-bootable]]</code>.<br />
<br />
==='''Data Disk Mode'''=== <br />
This mode also runs from system RAM, thus it enjoys the same accelerated operation speed as "diskless" mode. However, swap storage and the entire {{Path|/var}} directory tree get mounted from a persistent storage device (two newly created partitions). The directory {{Path|/var}} holds e.g. all log files, mailspools, databases, etc., as well as <code>[[Alpine_local_backup|lbu]]</code> backup commits and the package cache. This mode is useful for having RAM accelerated servers with variable amounts of user-data that exceed the available RAM size. It enables the entire current system state (not just the boot state) to survive a system crash in accordance with the particular filesystem guarantees. <br />
<br />
[[https://gitlab.alpinelinux.org/alpine/alpine-conf/-/issues/10474 FIXME-2]]: Setup-alpine will create the data partition and mount it as /var, but '''setup-alpine's "data" disk mode can not yet configure lbu config storage settings automatically'''. The '''current workaround''', is to select "none" at the 'where to store configs' prompt (as the new data partition is not listed anyway) and configure lbu manually after <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> exits, and before rebooting:<br />
<br />
# Identify the created data partition, e.g. <code>/dev/sd''XY''</code>, and its filesystemtype, e.g. using <code>''lsblk''</code><br />
# Manually edit the lbu backups location in <code>/etc/lbu/lbu.conf</code> and configure <code>LBU_MEDIA=sd''XY''</code> (according to the previous findings).<br />
# Save the configuration on that partition for the next boot with <code>lbu commit</code>.<br />
# If (a new) partition fails to get mounted, execute: <code>mkdir /media/''sdXY'' ; echo "/dev/sd''XY'' /media/sd''XY'' ''fstype'' noauto,rw 0 0" >> /etc/fstab</code>, and try <code>lbu commit</code> again.<br />
<br />
In data disk mode, the boot device may also remain the initial (and possibly read-only) installation media, or be copied to a partition (e.g. /dev/sdXY) with <code>[[Alpine_setup_scripts#setup-bootable|setup-bootable]]</code>.<br />
<br />
==='''System Disk Mode'''=== <br />
This is a traditional hard-disk install.<br />
<br />
If this mode is selected, the <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> script creates three partitions on the selected storage device, {{Path|/boot}}, {{Path|swap}} and {{Path|/}} (the filesystem root). This mode may, for example, be used for generic [[:Category:Desktop|desktop]] and development machines.<br />
<br />
For custom partitioning, see [[Setting up disks manually]].<br />
<br />
To install along side another operating systems, see [[Dualbooting]].<br />
<br />
== Basic Installation Step Details ==<br />
<br />
{{Expand| }}<br />
<br />
This "Additional Details" section needs to be consolidated with the work at '''[https://docs.alpinelinux.org https://docs.alpinelinux.org] (not finished)''' <br />
(Restructuring things there, moving and linking from here or there?). <br />
<br />
<br />
=== Verifying the downloaded image-file ===<br />
<br />
{| class="wikitable" style="width:95%; align=center"<br />
|+ Commands to verify the checksum and GPG signature of a downloaded image-file on different systems.<br />
|-<br />
! width=100px | OS type<br />
! <code>SHA256</code> check !! <code>SHA256</code> calculation (to be compared manually) !! <code>GPG</code> signature verification<br />
|-<br />
! Linux<br />
| <code>sha256sum -c alpine-*.iso.sha256</code> || || <code>curl https://alpinelinux.org/keys/ncopa.asc &#124; gpg --import ;</code><br />
<code> gpg --verify alpine-<version>.iso.asc alpine-<version>.iso</code><br />
|-<br />
! MACOS <br />
| - ? - || <code>shasum -a 256 alpine-*.iso</code> || - ? -<br />
|-<br />
! OpenBSD <br />
| <code>sha256 -C alpine-*.sha256 alpine-*.iso</code> || || <code>doas pkg_add gnupg;<br />
ftp -o - https://alpinelinux.org/keys/ncopa.asc &#124; gpg --import ;<br />
gpg --verify alpine-<version>.iso.asc alpine-<version>.iso</code><br />
|-<br />
! FreeBSD <br />
| - ? - || <code>/usr/local/bin/shasum -a 256 alpine-*.iso</code> || - ? -<br />
|-<br />
! NetBSD <br />
| - ? - || <code>/usr/local/bin/shasum -a 256 alpine-*.iso</code> || - ? -<br />
|-<br />
! Windows (PowerShell installed)<br />
| - ? - || <code>Get-FileHash .\alpine-<image-version>.iso -Algorithm SHA256</code> || - ? -<br />
|}<br />
<br />
=== Flashing (direct data writing) the installation image-file onto a device or media ===<br />
<br />
==== Unix/Linux ====<br />
<br />
Under Unix (and thus Linux), "everything is a file" and the data in the image-file can be written to a device or media with the <code>dd</code> command. Afterward, executing the <code>eject</code> command removes the target device from the system and ensures the write cache is completely flushed.<br />
<br />
dd if=<iso-file-to-read-in> of=<target-device-node-to-write-out-to> bs=4M oflag=sync status=progress; eject <target-device-node-to-write-to><br />
<br />
Be careful to correctly identify the target device as any data on it '''will''' be lost! All connected "bulk storage devices" can be listed with <code><nowiki>lsblk</nowiki></code> and <code><nowiki>blkid</nowiki></code>.<br />
<br />
# lsblk<br />
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT<br />
sdX 0:0 0 64,0G 0 disk <br />
├─sdX1 0:1 0 2G 0 part <br />
└─sdX2 0:2 0 30G 0 part /mnt/sdX2<br />
<br />
# blkid<br />
/dev/sdX1: LABEL="some" UUID="..." TYPE="vfat"<br />
/dev/sdX2: LABEL="other" UUID="..." TYPE="ext4"<br />
<br />
For example, if /dev/sdX is the desired target device, first make sure you un-mount all mounted partitions of the target device. For example sdX1 and sdX2:<br />
<br />
umount /dev/sdX1 /dev/sdX2<br />
<br />
<br />
For <code>dd</code>'s output-file (<code>of=</code>), however, do '''not''' specify a partition number. For example, write to sdX, '''not''' sdX1:<br />
<br />
Warning: '''This will overwrite the target device /dev/sdX''', so before executing, make sure you have a backup of the data if you can't afford to lose it.<br />
<br />
dd if=~/Downloads/alpine-standard-3.00.0-x86_64.iso of=/dev/sdX bs=4M oflag=sync status=progress; eject /dev/sdX<br />
<br />
==== Windows ====<br />
<br />
For example, there is the [https://rufus.ie/ Rufus] program. Rufus will enable you to create bootable USB flash drives under Windows. <br />
<br />
Rufus has been tested and works for Alpine Linux 3.12.x with the following settings:<br />
* '''Partition scheme''': <code>MBR</code><br />
* '''Target system''': <code>BIOS or UEFI</code><br />
* '''File system''': <code>FAT32</code><br />
* '''Cluster size''': <code>4096 bytes (default)</code><br />
<br />
=== Verifying the written installation media ===<br />
<br />
After detaching and re-attaching the device, a bit-wise comparison can verify the data written to the device (instead of just data buffered in RAM). If the comparison terminates with an end-of-file error on the .iso file side, all the contents from the image have been written (and re-read) successfully:<br />
<br />
# cmp ~/Downloads/alpine-standard-3.00.0-x86_64.iso /dev/sdX<br />
cmp: EOF on alpine-standard-3.00.0-x86_64.iso<br />
<br />
=== Booting from external devices ===<br />
<br />
Insert the boot media to a proper drive or port of the computer and turn the machine on, or restart it, if already running.<br />
<br />
If the computer does not automatically boot from the desired device, one needs to bring up the boot menu and choose the media to boot from. Depending on the computer, the menu may be accessed by repeatedly pressing a key quickly when booting starts. Some computers require that you press the button ''before'' starting the computer and hold it down while the computer boots. Typical keys are: `F9`-`F12`, sometimes `F7` or `F8`. If these don't bring up the boot menu, it may be necessary to enter the BIOS configuration and adjust the boot settings, for which typical keys are: `Del.` `F1` `F2` `F6` or `Esc.`<br />
<br />
=== Custom partitioning of the harddisk ===<br />
<br />
It is possible to specify configurations for RAID, encryption, LVM, etc. as well as manual partitioning.<br />
<br />
For "diskless" or "data disk" mode installs, manual partitioning may be needed to prepare the harddisk for committing local backups of the system state with <code>[[Alpine_local_backup|lbu commit]]</code>, to have a place for a package cache, or to use it for a /var mount. <br />
<br />
For a "sys" install, custom partitioning is needed only if the desired scheme differs from overwriting an entire disk, or using the default set of a /boot, swap and root partition on the disk.<br />
<br />
See [[Setting up disks manually]] for the alpine options for RAID, encryption, LVM, etc. and manual partitioning.<br />
<br />
=== Questions asked by <code>setup-alpine</code> ===<br />
[[File:Installation-alpine-alpine-setup-3-setup-scripts.png|350px|thumb|right|Example <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> session]]<br />
<br />
The <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> script offers the following configuration options:<br />
<br />
* '''Keyboard Layout''' (Local keyboard language and usage mode, e.g. ''us'' and variant of ''us-nodeadkeys''.)<br />
* '''Hostname''' (The name for the computer.)<br />
* '''Network''' (For example, automatic IP address discovery with the "DHCP" protocol.)<br />
* '''DNS Servers''' (Domain Name Servers to query. For privacy reasons it is NOT recommended to route every local request to servers like google's <s>8.8.8.8</s> .)<br />
* '''Timezone'''<br />
* '''Proxy''' (Proxy server to use for accessing the web. Use "none" for direct connections to the internet.)<br />
* '''Mirror''' (From where to download packages. Choose the organization you trust giving your usage patterns to.)<br />
* '''SSH''' (Secure SHell remote access server. "Openssh" is part of the default install image. Use "none" to disable remote login, e.g. on laptops.)<br />
* '''NTP''' (Network Time Protocol client used for keeping the system clock in sync with a time server. Package "chrony" is part of the default install image.)<br />
* '''Disk Mode''' (Select between diskless (disk="none"), "data" or "sys", as described above.) <br />
{{Warning|The data on a chosen device will be overwritten!}}<br />
<br />
=== Preparing for the first boot ===<br />
<br />
If <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> has finished configuring the "sys" disk mode, the system should be ready to reboot right away (see next subsection).<br />
<br />
If the new local system was configured to run in "diskless" or "data" mode, and you do not want keep booting from the initial (and possibly read-only) installation media, the boot system needs to be copied to another device or partition.<br />
<br />
The target partition may be identified using <code><nowiki>lsblk</nowiki></code> (after installing it with <code>apk add lsblk</code>) and/or <code>blkid</code>, similar to previously identifying the initial installation media device.<br />
<br />
The procedure to copy the boot system is explained at <code>[[Alpine_setup_scripts#setup-bootable|setup-bootable]]</code><br />
<br />
Once everything is in place, save your customized configuration with <code>lbu commit</code> before rebooting.<br />
<br />
=== Rebooting and testing the new system ===<br />
<br />
First, remove the initial installation media from the boot drive, or detach it from the port it's connected to.<br />
<br />
The system may now be power-cycled or rebooted to confirm everything is working correctly.<br />
<br />
The relevant commands for this are <code>poweroff</code> or <code>reboot</code>.<br />
<br />
=== Completing the installation ===<br />
<br />
The installation script installs only the base operating system. '''No''' applications e.g. web server, mail server, desktop environment, or web browsers are installed.<br />
<br />
Please look under [[Installation#Post-Installation|Post-Installation]] below, for some common things to do after installation.<br />
<br />
= Further Installation Instructions =<br />
<br />
{{Note| Specific topics should be kept on separate, individually manageable topic-pages and only get listed with a direct reference (link) on this general page.}}<br />
<br />
=== Installation ===<br />
<br />
* [[Kernels]] ''(kernel selection, e.g. for VMs or RPi)''<br />
* [[How to make a custom ISO image with mkimage]] ''(installation media with its own configuration)''<br />
* [[Directly booting an ISO file]] ''(without flashing it to a disk or device)''<br />
* [[Dualbooting|Dual/multi-boot install to HDD partition]]<br />
* [[Netboot Alpine Linux using iPXE]]<br />
Also see other [[:Category:Installation|Installation Category]] pages.<br />
<br />
=== Post-Installation ===<br />
<br />
<!-- COMMENT FOR EDITORS<br />
<br />
If you edit Post-Install,<br />
<br />
* Consider that there are already [[Tutorials_and_Howtos#Post-Install]], [[Developer_Documentation#Package_management]] and the Handbook, please work towards reducing duplication and providing an overview, and maintaining topic details of considerable size on their own pages.<br />
* Here, only the most relevant jumping off points are listed, not exact list duplicates!!!<br />
* Keep short-list of links here, as overview to more detailed topic specific pages.<br />
* Don't aggregate different topics at yet another place.<br />
<br />
--><br />
<br />
<br />
<br />
* [[Setting up a new user]] ''(to allow remote, console, or graphical logins)''<br />
* [[Tutorials_and_Howtos#Networking_2|Setting up Networking]] ''(including non-standard configurations)''<br />
* [[Alpine_Package_Keeper|Package Management (apk)]] ''(how to search/add/del packages etc.)''<br />
** [[Alpine_Package_Keeper#Upgrade_a_Running_System|Upgrading Alpine]] ''(checking for and installing updates)''<br />
** [[Repositories#Managing_repositories|Enable the community repository]] ''(access to additional packages)''<br />
* [[Alpine_Linux:FAQ#Why_don.27t_I_have_man_pages_or_where_is_the_.27man.27_command.3F|man command/man pages]]<br />
* [[Change default shell]]<br />
* [[Running glibc programs]] ''(installation and development)''<br />
<br><br />
<br />
* [[Alpine_local_backup|Local backup utility <code>lbu</code>]] ''(persisting RAM system configurations)''<br />
** [[Back Up a Flash Memory Installation]] ''("diskless mode" systems)''<br />
** [[Manually_editing_a_existing_apkovl]] ''(the stored custom configs)''<br />
<br><br />
<br />
* [[OpenRC|Init System (OpenRC)]] ''(configure a service to automatically boot at next reboot)''<br />
** [[Writing Init Scripts]]<br />
** [[Multiple Instances of Services]]<br />
<br><br />
<br />
* [[Alpine setup scripts#setup-xorg-base|<code>setup-xorg-base</code>]] ''(setup graphical base environment)''<br />
** [[Tutorials_and_Howtos#Desktop|Desktop Environments]]<br />
<br><br />
<br />
* [[Hosting services on Alpine]] ''(links to several mail/web/ssh server setup pages)''<br />
<br><br />
<br />
* [[How to get regular stuff working]] ''(things one may miss in a too lightweight installation )''<br />
* Running applications and services in their own [[Firejail Security Sandbox]]<br />
<br />
=== Broader Usage Guides ===<br />
<br />
* See: [[Tutorials and Howtos]]<br />
<br />
= General Documentation =<br />
<br />
{{Tip| Alpine Linux packages stay close to the upstream design. Therefore, all upstream documentation about configuring a software package, as well as good configuration guides from other distributions that stay close to upstream, e.g. those in the [https://wiki.archlinux.org/ ArchWiki], are to a large degree, also applicable to configuring the software on Alpine Linux, thus can be very useful.}}<br />
<br />
* [[Alpine_Linux:FAQ|FAQs]]<br />
* [[Alpine_Linux:Contribute|How to Contribute]]<br />
* [[:Category_talk:Developer_Documentation|Developer Documentation]]<br />
* [[Alpine_Linux:Wiki_etiquette|Wiki etiquette]] ''(to collaborate on this documentation)''<br />
* [[Comparison with other distros]] ''(how common things are done on Alpine)''<br />
<br />
----<br />
[[Category:Installation]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Release_Notes_for_Alpine_3.19.0&diff=23667Release Notes for Alpine 3.19.02023-06-10T15:40:09Z<p>Psykose: expand on save</p>
<hr />
<div>== Base System ==<br />
<br />
=== iptables-nft ===<br />
<br />
the <code>/sbin/iptables{,-save,-restore}</code> symlinks now point to xtables-nft-multi instead of xtables-legacy-multi. this means they use the nftables kernel backend instead of the legacy iptables one.<br />
<br />
since the new iptables- binaries also don't use the iptables backend, to work with any existing rules and save them, you need to install <code>iptables-legacy</code> and use <code>iptables-legacy-save</code>.<br />
<br />
because mixing backends is not supported, you should reboot your system if you have to use the iptables commands after upgrading.</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Bootstrapping_Alpine_Linux&diff=23661Bootstrapping Alpine Linux2023-06-07T01:40:17Z<p>Psykose: use link not from repo so it doesn't disappear on pkgrel bumps</p>
<hr />
<div><br />
<br />
= VPS =<br />
This section is to provide a means to bootstrap Alpine Linux on any VPS.<br />
<br />
== Process ==<br />
<br />
=== Prepare ===<br />
<ol><br />
<li>Download apk-tools-static for your architecture.</li><br />
<pre>wget https://gitlab.alpinelinux.org/api/v4/projects/5/packages/generic/v2.14.0/x86_64/apk.static</pre><br />
<br />
<li>Unpack .apk</li><br />
<pre>tar zxf apk-tools-static-*.apk</pre><br />
<br />
</ol><br />
<br />
=== Install ===<br />
<code>sudo ./sbin/apk.static --arch $(arch) -X http://dl-cdn.alpinelinux.org/alpine/latest-stable/main/ -U --allow-untrusted --root /tmp/target --initdb add alpine-base</code><br />
<br />
=== Bootloader ===<br />
<br />
<br />
== References ==<br />
* [https://www.linode.com/docs/tools-reference/custom-kernels-distros/running-a-custom-linux-distro-on-a-linode-vps Running a Custom Linux Distribution on a Linode]<br />
* [https://www.linode.com/docs/tools-reference/custom-kernels-distros/run-a-custom-compiled-kernel-with-pvgrub Run a Custom Compiled Kernel with PV-GRUB]<br />
* [[Replacing non-Alpine Linux with Alpine remotely]]<br />
* [[Install Alpine on Amazon EC2]]<br />
* [[Install Alpine on coLinux]]<br />
* [[Install Alpine on Rackspace]]<br />
* [[Alpine setup scripts]]<br />
* [http://serverfault.com/questions/98950/how-do-i-chain-boot-from-grub-to-syslinux How do I chain boot from grub to syslinux?]<br />
* [http://uggedal.com/journal/alpine-linux-on-linode/ Alpine Linux on Linode]<br />
* [[Installing Alpine Linux in a chroot]]<br />
<br />
[[Category:Installation]]<br />
[[Category:Virtualization]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Two_Factor_Authentication_With_OpenSSH&diff=23660Two Factor Authentication With OpenSSH2023-06-07T01:37:56Z<p>Psykose: remove stale rename flag</p>
<hr />
<div>== Configure OpenSSH to use PAM==<br />
OpenSSH allows us to configure PAM to handle authentication duties, working nicely with the {{pkg|google-authenticator}} package.<br />
<br />
{{cmd|# apk add google-authenticator openssh-server-pam}}<br />
<br />
First, configure the SSH daemon to use PAM authentication:<br />
{{cmd|# cat /etc/ssh/sshd_config}}<br />
<pre><br />
AuthenticationMethods publickey,keyboard-interactive<br />
ChallengeResponseAuthentication yes<br />
PermitRootLogin yes<br />
UsePAM yes<br />
</pre><br />
{{Note|This configuration does NOT allow password authentication globally}}<br />
<br />
Then, configure PAM by adding the following lines, enabling google-authenticator as the package handling authentication:<br />
<br />
* For Alpine 3.14 or newer:<br><br />
{{cmd|# cat /etc/pam.d/sshd.pam #create the file if needed}}<br />
* For Alpine 3.13 or older:<br />
{{cmd|# cat /etc/pam.d/sshd #create the file if needed}}<br />
<pre><br />
account include base-account<br />
<br />
auth required pam_env.so<br />
auth required pam_nologin.so successok<br />
auth include google-authenticator<br />
</pre><br />
<br />
== Time-based One Time Password authentication (TOTP RFC 6238) ==<br />
As the root user:<br />
{{cmd|# google-authenticator}}<br />
{{Note|Please take note of <secret>}}<br />
<pre><br />
Do you want authentication tokens to be time-based (y/n) y<br />
https://www.google.com/<pruned><br />
Your new secret key is: <secret><br />
Your verification code is <pruned><br />
Your emergency scratch codes are:<br />
<pruned><br />
<pruned><br />
<pruned><br />
<pruned><br />
<pruned><br />
<br />
Do you want me to update your "/root/.google_authenticator" file? (y/n) y<br />
<br />
Do you want to disallow multiple uses of the same authentication<br />
token? This restricts you to one login about every 30s, but it increases<br />
your chances to detect or prevent man-in-the-middle attacks (y/n) n<br />
<br />
By default, tokens are good for 30 seconds. In order to compensate for<br />
possible time-skew between the client and server, we allow an extra<br />
token before and after the current time. If you experience problems with<br />
poor time synchronization, you can increase the window from its default<br />
size of ±1min (window size of 3) to about ±4min (window size of<br />
17 acceptable tokens).<br />
Do you want to do so? (y/n) n<br />
<br />
If the computer that you are logging into isn't hardened against brute force<br />
login attempts, you can enable rate-limiting for the authentication module.<br />
By default, this limits attackers to no more than 3 login attempts every 30s.<br />
Do you want to enable rate-limiting (y/n) n<br />
</pre><br />
<br />
{{Tip|You might want to answer questions 2, 3 and 4 differently based on your paranoia level and firewall settings :)}}<br />
<br />
Re-run <code>google-authenticator</code> for each user that needs to login via SSH. Don't forget to include <code>.google_authenticator</code> files in your [[Alpine_local_backup|LBU]] if you're running from RAM.<br />
<br />
== Authentication token ==<br />
Download the '''Google Authenticator''' app from the ''App Store''. Startup '''Google Authenticator''' and manually enter your <secret> key.<br />
<br />
== Login ==<br />
{{cmd|$ ssh -v root@yourbox}}<br />
The last lines should say:<br />
<pre><br />
Authenticated with partial success.<br />
debug1: Authentications that can continue: keyboard-interactive<br />
debug1: Next authentication method: keyboard-interactive<br />
Verification code: <br />
</pre><br />
<code>Authenticated with partial success</code> means that pubkey authentication was successful and now the verifier is asking for the verification code generated from the '''Google Authenticator''' app.<br />
<br />
[[Category:Authentication]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Two_Factors_Authentication_With_OpenSSH&diff=23659Two Factors Authentication With OpenSSH2023-06-07T01:37:40Z<p>Psykose: Psykose moved page Two Factors Authentication With OpenSSH to Two Factor Authentication With OpenSSH: spelling</p>
<hr />
<div>#REDIRECT [[Two Factor Authentication With OpenSSH]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Two_Factor_Authentication_With_OpenSSH&diff=23658Two Factor Authentication With OpenSSH2023-06-07T01:37:40Z<p>Psykose: Psykose moved page Two Factors Authentication With OpenSSH to Two Factor Authentication With OpenSSH: spelling</p>
<hr />
<div>{{Move|Two-Factor Authentication with OpenSSH|Spelling/Grammar}}<br />
<br />
== Configure OpenSSH to use PAM==<br />
OpenSSH allows us to configure PAM to handle authentication duties, working nicely with the {{pkg|google-authenticator}} package.<br />
<br />
{{cmd|# apk add google-authenticator openssh-server-pam}}<br />
<br />
First, configure the SSH daemon to use PAM authentication:<br />
{{cmd|# cat /etc/ssh/sshd_config}}<br />
<pre><br />
AuthenticationMethods publickey,keyboard-interactive<br />
ChallengeResponseAuthentication yes<br />
PermitRootLogin yes<br />
UsePAM yes<br />
</pre><br />
{{Note|This configuration does NOT allow password authentication globally}}<br />
<br />
Then, configure PAM by adding the following lines, enabling google-authenticator as the package handling authentication:<br />
<br />
* For Alpine 3.14 or newer:<br><br />
{{cmd|# cat /etc/pam.d/sshd.pam #create the file if needed}}<br />
* For Alpine 3.13 or older:<br />
{{cmd|# cat /etc/pam.d/sshd #create the file if needed}}<br />
<pre><br />
account include base-account<br />
<br />
auth required pam_env.so<br />
auth required pam_nologin.so successok<br />
auth include google-authenticator<br />
</pre><br />
<br />
== Time-based One Time Password authentication (TOTP RFC 6238) ==<br />
As the root user:<br />
{{cmd|# google-authenticator}}<br />
{{Note|Please take note of <secret>}}<br />
<pre><br />
Do you want authentication tokens to be time-based (y/n) y<br />
https://www.google.com/<pruned><br />
Your new secret key is: <secret><br />
Your verification code is <pruned><br />
Your emergency scratch codes are:<br />
<pruned><br />
<pruned><br />
<pruned><br />
<pruned><br />
<pruned><br />
<br />
Do you want me to update your "/root/.google_authenticator" file? (y/n) y<br />
<br />
Do you want to disallow multiple uses of the same authentication<br />
token? This restricts you to one login about every 30s, but it increases<br />
your chances to detect or prevent man-in-the-middle attacks (y/n) n<br />
<br />
By default, tokens are good for 30 seconds. In order to compensate for<br />
possible time-skew between the client and server, we allow an extra<br />
token before and after the current time. If you experience problems with<br />
poor time synchronization, you can increase the window from its default<br />
size of ±1min (window size of 3) to about ±4min (window size of<br />
17 acceptable tokens).<br />
Do you want to do so? (y/n) n<br />
<br />
If the computer that you are logging into isn't hardened against brute force<br />
login attempts, you can enable rate-limiting for the authentication module.<br />
By default, this limits attackers to no more than 3 login attempts every 30s.<br />
Do you want to enable rate-limiting (y/n) n<br />
</pre><br />
<br />
{{Tip|You might want to answer questions 2, 3 and 4 differently based on your paranoia level and firewall settings :)}}<br />
<br />
Re-run <code>google-authenticator</code> for each user that needs to login via SSH. Don't forget to include <code>.google_authenticator</code> files in your [[Alpine_local_backup|LBU]] if you're running from RAM.<br />
<br />
== Authentication token ==<br />
Download the '''Google Authenticator''' app from the ''App Store''. Startup '''Google Authenticator''' and manually enter your <secret> key.<br />
<br />
== Login ==<br />
{{cmd|$ ssh -v root@yourbox}}<br />
The last lines should say:<br />
<pre><br />
Authenticated with partial success.<br />
debug1: Authentications that can continue: keyboard-interactive<br />
debug1: Next authentication method: keyboard-interactive<br />
Verification code: <br />
</pre><br />
<code>Authenticated with partial success</code> means that pubkey authentication was successful and now the verifier is asking for the verification code generated from the '''Google Authenticator''' app.<br />
<br />
[[Category:Authentication]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=GNOME&diff=23657GNOME2023-06-07T01:32:44Z<p>Psykose: remove stale info; bash already exists as a dependency and isn't relevant, setup-desktop sets up udev</p>
<hr />
<div><br />
= Prerequisites =<br />
<br />
* [[Installation|Install]] AlpineLinux<br />
* [[Setting_up_a_new_user#Creating_a_new_user|Create a user account]] (optional but recommended)<br />
* [[Repositories#Enabling_the_community_repository|Enable the Community repository]]<br />
<br />
= Installing packages =<br />
<br />
Install basic desktop system and gnome packages.<br />
{{Cmd|# setup-desktop gnome}}<br />
<br />
It will take care of installing the basic packages and setting up the display manager. <br />
<br />
If you want, you can install additional GNOME apps for a more complete GNOME experience with:<br />
{{Cmd|# apk add gnome-apps-extra}}<br />
<br />
And even all of GNOME games with:<br />
{{Cmd|# apk add gnome-games-collection}}<br />
<br />
= Enabling GNOME Shell screen recording =<br />
For the embedded screen recording in GNOME Shell to work, you will need some additional packages: {{cmd|# apk add pipewire wireplumber gst-plugin-pipewire}}<br />
<br />
= Enabling GNOME Software =<br />
For GNOME Software to be able to manage APK packages, it needs the <code>apk-polkit-server</code> service working. To enable it and start it up:<br />
{{cmd|# rc-update add apk-polkit-server default && rc-service apk-polkit-server start}}<br />
<br />
= Troubleshooting =<br />
<br />
If you are unable to log in, check /var/log/gdm/greeter.log, there may be info there from X that indicates failed modules, etc.<br />
<br />
If GNOME Terminal doesn't start, add the following to /etc/profile.d/locale.sh: <code>LANG=en_US.UTF-8</code> and reboot.<br />
<br />
If the on-screen keyboard shows up in GDM after installing other UIs such as Phosh, you need to disable it by opening the Accessibility menu (top right) when you are in the GDM login screen. You can disable the on-screen keyboard there. Or set <code>org.gnome.desktop.a11y.applications screen-keyboard-enabled</code> to <code>false</code> for the <code>gdm</code> user with <code>dconf</code><br />
<br />
[[Category:Desktop]]<br />
[[Category:Desktop Environments]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=S390x&diff=23656S390x2023-06-07T01:25:01Z<p>Psykose: style</p>
<hr />
<div>{{TOC right}}<br />
<br />
= Installation guide =<br />
Visit: [[S390x/Installation]]<br />
<br />
= Docker with Alpine =<br />
Running Alpine s390x containers on Docker: [[S390x/Docker]]<br />
<br />
= Known Issues =<br />
[[S390x/Known_Issues]]<br />
<br />
= Tips =<br />
<br />
On a default Alpine installation, some firmware packages (<code>linux-firmware-*</code>) will get installed. On s390x, most of these are not needed.<br />
<br />
In order to remove them, install the package <code>linux-firmware-none</code> by running:<br />
<br />
<pre>apk add linux-firmware-none</pre><br />
<br />
= =<br />
* [https://fwupd.org/ LVFS - Linux Vendor Firmware Service]<br />
<br />
<br />
[[category:IBM]]<br />
<br />
<br />
[[category:IBM]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Alpine_Linux:FAQ&diff=23648Alpine Linux:FAQ2023-06-05T02:41:43Z<p>Psykose: /* Fix lacking lsusb / lspci output */</p>
<hr />
<div>[[Image:filetypes.svg|64px|left|link=]]<br />
This is a list of '''frequently asked questions''' about Alpine Linux.<br /><br />
If your question is not answered on this page, use the search box above to find work in progress pages not linked here, or in case of no answer, edit this page and write down your question.<br />
{{Tip| Prepare your question. Think it through. Make it simple and understandable.}} <br />
<br />
=General=<br />
<br />
Alpine Linux is used heavily in containers (e.g. Docker images) on servers, so many of its main packages are focused on server services.<br />
<br />
== Where to start? ==<br />
<br />
The [[Installation]] page and the [[Installation#Post-Installation|Post Installation]] section on that page, provide a basic orientation.<br />
<br />
A broader overview may be found on the official [https://alpinelinux.org/about About] page and at the [[Alpine Linux:Overview|wiki overview]].<br />
<br />
Please note that testing is safer on your own virtual machine or on a public [https://distrotest.net/AlpineLinux/ DistroTest.net].<br />
<br />
== I have found a bug, where can I report it? ==<br />
<br />
You can report it on the [https://gitlab.alpinelinux.org/groups/alpine/-/issues bugtracker], but search it first to see if the issue has already been reported.<br />
<br />
== Are there any details about the releases available? ==<br />
Yes, please check the [https://alpinelinux.org/releases/ releases] page.<br />
<br />
== How can I contribute? ==<br />
You can contribute by:<br />
* Using the software and giving [https://gitlab.alpinelinux.org/groups/alpine/-/issues feedback].<br />
* Documenting your [https://www.alpinelinux.org Alpine Linux] experiences on this [[Main_Page|wiki]].<br />
* Flag packages as outdated in the [https://pkgs.alpinelinux.org/packages package database], or even better enable release monitoring in [https://release-monitoring.org/ Anitya] for them.<br />
* In many other ways.<br />
Please visit [[Contribute|Contribute page]] to read more about this topic.<br />
<br />
== Why don't I have man pages or where is the 'man' command? ==<br />
The <code>man</code> command and '''man pages''' are not installed by default.<br />
<br />
Install the <code>man</code> command:<br />
{{cmd|# apk add mandoc}}<br />
Install basic manual pages. {{pkg|man-pages}} package provides the system's ''core'' manual pages:<br />
{{cmd|# apk add man-pages}}<br />
Install the <code>apropos</code> command to search in '''man pages''':<br />
{{cmd|# apk add mandoc-apropos}}<br />
Once installed, add documentation for the package where you need it. For example, say you installed {{pkg|nftables}} and you now require its '''man pages''':<br />
{{cmd|# apk add nftables-doc}}<br />
To always install the documentation companion package add the {{pkg|docs}} meta package. Keep in mind not all packages have a corresponding documentation package and even when it has one it may not include '''man pages''':<br />
{{cmd|# apk add docs}}<br />
<br />
== What is the difference between edge and stable releases? ==<br />
Stable releases are just what they sound like: initially a point-in-time snapshot of the package archives, but then maintained with bugfixes only in order to keep a stable environment.<br />
<br />
[[Repositories#Edge|Edge]] is more of a rolling-release, with the latest and greatest packages available in the online repositories.<br /><br />
Occasionally, snapshot ISO images of the then-current state of [[Repositories#Edge|edge]] are made and are available for download.<br /><br />
Typically these are made when there are major kernel upgrades or package upgrades that require initramfs rebuilds.<br />
<br />
== What architectures does Alpine Linux support? ==<br />
* '''aarch64''': 64-bit ARM processors (e.g. Raspberry Pi 4)<br />
* '''armhf''': 32-bit ARM processors with a floating point unit (e.g. Raspberry Pi 1)<br />
* '''armv7''': 32-bit ARM processors without a floating point unit<br />
* '''s390x''': IBM mainframes using the z/Architecture<br />
* '''ppc64le''': 64-bit little-endian POWER devices (e.g. Raptor Talos II)<br />
* '''x86''': 32-bit Intel and AMD processors commonly found in older personal computers (e.g. Pentium III, Athlon XP). Can also run on x86_64 machines<br />
* '''x86_64''': 64-bit Intel and AMD processors commonly found in personal computers (e.g. Core i7, Ryzen 7)<br />
'''Please check [https://alpinelinux.org/downloads Download] page for media availability on each one''' and check [https://alpinelinux.org/releases/ Release Branches] page for latest.<br />
<br />
== What kinds of release of Alpine Linux are available? ==<br />
Please check the [https://alpinelinux.org/releases/ Release Branches] page for more information.<br />
<br />
=Setup=<br />
<br />
== What is the difference between ''sys'', ''data'', and ''diskless'' when running <code>setup-alpine</code> or <code>setup-disk</code>? ==<br />
<br />
'''sys:''' This mode is a traditional disk install. The following partitions will be created on the disk: ''/boot/'', ''/'' (filesystem root) and ''swap''.<br />
This mode may be used for development boxes, desktops, virtual servers, etc.<br />
<br />
'''data:''' This mode uses your disk(s) for data storage, not for the operating system. Runs from the media and only a ''/var/'' is created on disk. The system itself will run from a ''tmpfs'' (RAM). Use this mode if you only want to use the disk(s) for data, like ''mailspool'', ''databases'', ''logs'', etc.<br />
<br />
'''diskless:''' No disks are to be used. [[Alpine local backup]] may still be used in this mode.<br />
<br />
These modes are explained further on the [[Installation#Installation_Overview|'''Installation''']] page.<br />
<br />
== How do I upgrade Alpine? ==<br />
<br />
To upgrade to a new stable release or edge:<br />
<code>apk upgrade --available</code><br />
<br />
==Why don't my cron jobs run?==<br />
<br />
Start service ''crond'' and add it to runlevel:<br />
<br />
: {{cmd|rc-service crond start && rc-update add crond}}<br />
<br />
After that the cron daemon is started automatically on system boot and executes the scripts placed in the folders under ''/etc/periodic/'' - there are folders for ''15min'', ''hourly'', ''daily'', ''weekly'' and ''monthly'' scripts.<br />
<br />
To check whether your scripts are likely to run, use the ''run-parts'' command, for example:<br />
<br />
: {{cmd|run-parts --test /etc/periodic/15min}}<br />
<br />
This command will tell you what should run but will not actually execute the scripts.<br />
<br />
If the results of the test are not as expected, check the following:<br />
<br />
* Make sure the script is executable - if unsure, issue the command {{cmd|chmod +x /etc/periodic/[path/scriptname]}}<br />
* Make sure the first line of your script is <code>#!/bin/sh</code><br />
* Do not use periods on your script file names - this stops them from working; for example: {{Path|/etc/periodic/daily/myscript}} will run, but {{Path|/etc/periodic/daily/myscript.sh}} won't.<br />
<br />
= Time and timezones =<br />
<br />
== How do I set the local timezone? ==<br />
<br />
If you wish to edit the ''timezone'' (TZ) after installation, run the [[Alpine_setup_scripts#setup-timezone|setup-timezone]] script.<br />
<br />
= Packages =<br />
<br />
== Can you build an APK package for ...? ==<br />
Please create an [https://gitlab.alpinelinux.org/alpine/aports/issues/new issue] in the [https://gitlab.alpinelinux.org bugtracker]. Prefix it with "package request:" in the title and include a short description (one-line), a URL for the home page, why you need it, and a URL for the source package.<br />
<br />
== How can I build my own package? ==<br />
Please see the [[Creating an Alpine package]] page.<br />
<br />
== What does "required by: world[$pkgname]" mean? ==<br />
<br />
It means that the package you tried to install does not exist in the repositories you have configured. <br />
<br />
Maybe you forgot to add community, testing or unmaintained to ''/etc/apk/repositories''? <br />
<br />
Or is the package in a [[Alpine_Linux_package_management#Repository_pinning|pinned repository]] and you forgot to suffix the package with the repo tag? Example:<br />
<br />
{{cmd|apk add experimental-package@testing}}<br />
<br />
== How can I find out if a certain package exists in Alpine? ==<br />
<br />
If you want to only search repositories you have configured in /etc/apk/repositories, then <code>apk search $pkgname</code> should get you sorted. If you want to search all repositories have a look at the [https://pkgs.alpinelinux.org/ online pkg oracle]<br />
<br />
== WARNING: Ignoring APKINDEX.xxxx.tar.gz ==<br />
If you get <code>WARNING: Ignoring APKINDEX.xxxx.tar.gz: No such file or directory</code> while running [[Alpine_Linux_package_management|package related tools]], check your {{Path|/etc/apk/repositories}} file.<br />
<br />
To check the content of the repositories file<br />
{{Cmd|cat /etc/apk/repositories}}<br />
<br />
or <br />
{{Cmd|setup-apkrepos}}<br />
<br />
= Dynamic DNS =<br />
== How do I schedule a regular dynamic DNS update? ==<br />
You'll want to install the {{pkg|ez-ipupdate}} package:<br />
{{cmd|apk add ez-ipupdate}}<br />
<br />
After that, create a new file at {{path|/etc/ez-ipupdate.conf}} with contents similar to:<br />
service-type=dyndns<br />
user=myusername:mypassword<br />
interface=eth1<br />
host=myhostname.dyndns.org<br />
<br />
Make the new ip cache directory:<br />
{{cmd|mkdir /var/cache/ez-ipupdate<br />
lbu add /var/cache/ez-ipupdate}}<br />
<br />
Then schedule a new cron job with this command:<br />
{{cmd|echo >> /var/log/ez-ipupdate && \<br />/bin/date >> /var/log/ez-ipupdate && \<br />ez-ipupdate --config-file /etc/ez-ipupdate.conf -f -F /var/run/ez-ipupdate.pid \<br /> --cache-file /var/cache/ez-ipupdate/ipcache --quiet >> /var/log/ez-ipupdate 2>&1}}<br />
<br />
Don't forget to backup your settings!<br />
{{cmd|lbu ci}}<br />
<br />
= Terminal =<br />
<br />
== How to enable/fix colors for git? ==<br />
<br />
The problem is not in git itself or terminal, but in the <tt>less</tt> command.<br />
Busybox’s <tt>less</tt> doesn’t support <tt>-r</tt> (<tt>--raw-control-chars</tt>) and <tt>-R</tt> (<tt>--RAW-CONTROL-CHARS</tt>) options.<br />
<br />
The simplest (yet not ideal) solution is to install GNU less:<br />
<br />
{{cmd|apk add less}}<br />
<br />
== Fix lacking lsusb / lspci output ==<br />
<br />
If you launch <code>lsusb</code> or <code>lspci</code> on a minimal installation, there's no device descriptions, and the latter doesn't exist.<br />
This can be fixed by installing the hwdata tables, '''hwdata-uwb''' or '''hwdata-pci''' respectively. For <code>lspci</code>, add '''pciutils'''.<br />
<br />
= Old questions, no longer frequently asked =<br />
<br />
== Alpine freezes during boot from Compact Flash, how can I fix? ==<br />
Most Compact Flash card readers do not support proper DMA.<br /><br />
You should append '''nodma''' to the ''append'' line in {{path|syslinux.cfg}}.<br />
<br />
== How do I remove the CD-ROM? ==<br />
Since the modloop loopback device is on CD-ROM you cannot just run <code>eject</code>. You need to unmount the modloop first.<br /><br />
Unmounting both the modloop and the CDROM in one step can be done by executing:<br />
{{Cmd|/etc/init.d/modloop stop}}<br />
<br />
Then it's possible to eject the CD-ROM:<br />
{{Cmd|eject}}<br />
<br />
== How can I install custom firmware in a diskless system? ==<br />
<br />
The modules and firmware are both special images which are mounted as read-only.<br /><br />
To fix this issue you can copy the firmware directory to your writeable media (cf/usb) and copy your custom firmware to it.<br /><br />
After reboot Alpine should automatically use the directory on your local storage instead of the loopback device.<br />
<br />
== OpenNTPD reports an error with "adjtime" ==<br />
Your log contains something like:<br />
reply from 85.214.86.126: offset 865033148.784255 delay 0.055466, next query 32s<br />
reply from 202.150.212.24: offset 865033148.779314 delay 0.400771, next query 3s<br />
adjusting local clock by 865033148.779835s <br />
adjtime failed: Invalid argument <br />
<br />
{{pkg|openntpd}} is supposed to make small adjustments in the time without causing time jumps.<br /><br />
If the adjustment is too big then something is clearly wrong and ntpd gives up. (its actually adjtime(3) that has a limit on how big adjustments are allowed)<br />
<br />
You can make ntpd set the time at startup by adding ''-s'' option to ntpd. This is done by setting '''NTPD_OPTS="-s"''' in {{path|/etc/conf.d/ntpd}}.<br />
<br />
== Using a cron job to keep the time in sync ==<br />
Add the following to {{path|/etc/periodic/daily}} (or use another folder under the {{path|/etc/periodic}} hierarchy if you want to run the script more/less frequently)<br />
<br />
Example: file called {{path|do-ntp}}<br />
<pre><br />
#!/bin/sh<br />
ntpd -d -q -n -p uk.pool.ntp.org</pre><br />
<br />
This queries the uk time server pool - you can modify this to suit your localisation, or just use ''pool.ntp.org''. More info here: [http://www.pool.ntp.org/zone/@ http://www.pool.ntp.org/zone/@]<br />
<br />
== Windows clients reports an error when trying to sync ==<br />
{{pkg|openntpd}} needs to run for a while before it is satisfied it is in sync.<br />
Until then it will set a flag "clock not synchronized" and Windows will report an error while trying to sync with your {{pkg|openntpd}} server.<br />
<br />
Only thing to do is wait, do something else for 15-20mins and then check.<br />
<br />
<br />
[[Category:Newbie]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Alpine_Linux:FAQ&diff=23647Alpine Linux:FAQ2023-06-05T02:39:54Z<p>Psykose: /* Can you build an APK package for ...? */</p>
<hr />
<div>[[Image:filetypes.svg|64px|left|link=]]<br />
This is a list of '''frequently asked questions''' about Alpine Linux.<br /><br />
If your question is not answered on this page, use the search box above to find work in progress pages not linked here, or in case of no answer, edit this page and write down your question.<br />
{{Tip| Prepare your question. Think it through. Make it simple and understandable.}} <br />
<br />
=General=<br />
<br />
Alpine Linux is used heavily in containers (e.g. Docker images) on servers, so many of its main packages are focused on server services.<br />
<br />
== Where to start? ==<br />
<br />
The [[Installation]] page and the [[Installation#Post-Installation|Post Installation]] section on that page, provide a basic orientation.<br />
<br />
A broader overview may be found on the official [https://alpinelinux.org/about About] page and at the [[Alpine Linux:Overview|wiki overview]].<br />
<br />
Please note that testing is safer on your own virtual machine or on a public [https://distrotest.net/AlpineLinux/ DistroTest.net].<br />
<br />
== I have found a bug, where can I report it? ==<br />
<br />
You can report it on the [https://gitlab.alpinelinux.org/groups/alpine/-/issues bugtracker], but search it first to see if the issue has already been reported.<br />
<br />
== Are there any details about the releases available? ==<br />
Yes, please check the [https://alpinelinux.org/releases/ releases] page.<br />
<br />
== How can I contribute? ==<br />
You can contribute by:<br />
* Using the software and giving [https://gitlab.alpinelinux.org/groups/alpine/-/issues feedback].<br />
* Documenting your [https://www.alpinelinux.org Alpine Linux] experiences on this [[Main_Page|wiki]].<br />
* Flag packages as outdated in the [https://pkgs.alpinelinux.org/packages package database], or even better enable release monitoring in [https://release-monitoring.org/ Anitya] for them.<br />
* In many other ways.<br />
Please visit [[Contribute|Contribute page]] to read more about this topic.<br />
<br />
== Why don't I have man pages or where is the 'man' command? ==<br />
The <code>man</code> command and '''man pages''' are not installed by default.<br />
<br />
Install the <code>man</code> command:<br />
{{cmd|# apk add mandoc}}<br />
Install basic manual pages. {{pkg|man-pages}} package provides the system's ''core'' manual pages:<br />
{{cmd|# apk add man-pages}}<br />
Install the <code>apropos</code> command to search in '''man pages''':<br />
{{cmd|# apk add mandoc-apropos}}<br />
Once installed, add documentation for the package where you need it. For example, say you installed {{pkg|nftables}} and you now require its '''man pages''':<br />
{{cmd|# apk add nftables-doc}}<br />
To always install the documentation companion package add the {{pkg|docs}} meta package. Keep in mind not all packages have a corresponding documentation package and even when it has one it may not include '''man pages''':<br />
{{cmd|# apk add docs}}<br />
<br />
== What is the difference between edge and stable releases? ==<br />
Stable releases are just what they sound like: initially a point-in-time snapshot of the package archives, but then maintained with bugfixes only in order to keep a stable environment.<br />
<br />
[[Repositories#Edge|Edge]] is more of a rolling-release, with the latest and greatest packages available in the online repositories.<br /><br />
Occasionally, snapshot ISO images of the then-current state of [[Repositories#Edge|edge]] are made and are available for download.<br /><br />
Typically these are made when there are major kernel upgrades or package upgrades that require initramfs rebuilds.<br />
<br />
== What architectures does Alpine Linux support? ==<br />
* '''aarch64''': 64-bit ARM processors (e.g. Raspberry Pi 4)<br />
* '''armhf''': 32-bit ARM processors with a floating point unit (e.g. Raspberry Pi 1)<br />
* '''armv7''': 32-bit ARM processors without a floating point unit<br />
* '''s390x''': IBM mainframes using the z/Architecture<br />
* '''ppc64le''': 64-bit little-endian POWER devices (e.g. Raptor Talos II)<br />
* '''x86''': 32-bit Intel and AMD processors commonly found in older personal computers (e.g. Pentium III, Athlon XP). Can also run on x86_64 machines<br />
* '''x86_64''': 64-bit Intel and AMD processors commonly found in personal computers (e.g. Core i7, Ryzen 7)<br />
'''Please check [https://alpinelinux.org/downloads Download] page for media availability on each one''' and check [https://alpinelinux.org/releases/ Release Branches] page for latest.<br />
<br />
== What kinds of release of Alpine Linux are available? ==<br />
Please check the [https://alpinelinux.org/releases/ Release Branches] page for more information.<br />
<br />
=Setup=<br />
<br />
== What is the difference between ''sys'', ''data'', and ''diskless'' when running <code>setup-alpine</code> or <code>setup-disk</code>? ==<br />
<br />
'''sys:''' This mode is a traditional disk install. The following partitions will be created on the disk: ''/boot/'', ''/'' (filesystem root) and ''swap''.<br />
This mode may be used for development boxes, desktops, virtual servers, etc.<br />
<br />
'''data:''' This mode uses your disk(s) for data storage, not for the operating system. Runs from the media and only a ''/var/'' is created on disk. The system itself will run from a ''tmpfs'' (RAM). Use this mode if you only want to use the disk(s) for data, like ''mailspool'', ''databases'', ''logs'', etc.<br />
<br />
'''diskless:''' No disks are to be used. [[Alpine local backup]] may still be used in this mode.<br />
<br />
These modes are explained further on the [[Installation#Installation_Overview|'''Installation''']] page.<br />
<br />
== How do I upgrade Alpine? ==<br />
<br />
To upgrade to a new stable release or edge:<br />
<code>apk upgrade --available</code><br />
<br />
==Why don't my cron jobs run?==<br />
<br />
Start service ''crond'' and add it to runlevel:<br />
<br />
: {{cmd|rc-service crond start && rc-update add crond}}<br />
<br />
After that the cron daemon is started automatically on system boot and executes the scripts placed in the folders under ''/etc/periodic/'' - there are folders for ''15min'', ''hourly'', ''daily'', ''weekly'' and ''monthly'' scripts.<br />
<br />
To check whether your scripts are likely to run, use the ''run-parts'' command, for example:<br />
<br />
: {{cmd|run-parts --test /etc/periodic/15min}}<br />
<br />
This command will tell you what should run but will not actually execute the scripts.<br />
<br />
If the results of the test are not as expected, check the following:<br />
<br />
* Make sure the script is executable - if unsure, issue the command {{cmd|chmod +x /etc/periodic/[path/scriptname]}}<br />
* Make sure the first line of your script is <code>#!/bin/sh</code><br />
* Do not use periods on your script file names - this stops them from working; for example: {{Path|/etc/periodic/daily/myscript}} will run, but {{Path|/etc/periodic/daily/myscript.sh}} won't.<br />
<br />
= Time and timezones =<br />
<br />
== How do I set the local timezone? ==<br />
<br />
If you wish to edit the ''timezone'' (TZ) after installation, run the [[Alpine_setup_scripts#setup-timezone|setup-timezone]] script.<br />
<br />
= Packages =<br />
<br />
== Can you build an APK package for ...? ==<br />
Please create an [https://gitlab.alpinelinux.org/alpine/aports/issues/new issue] in the [https://gitlab.alpinelinux.org bugtracker]. Prefix it with "package request:" in the title and include a short description (one-line), a URL for the home page, why you need it, and a URL for the source package.<br />
<br />
== How can I build my own package? ==<br />
Please see the [[Creating an Alpine package]] page.<br />
<br />
== What does "required by: world[$pkgname]" mean? ==<br />
<br />
It means that the package you tried to install does not exist in the repositories you have configured. <br />
<br />
Maybe you forgot to add community, testing or unmaintained to ''/etc/apk/repositories''? <br />
<br />
Or is the package in a [[Alpine_Linux_package_management#Repository_pinning|pinned repository]] and you forgot to suffix the package with the repo tag? Example:<br />
<br />
{{cmd|apk add experimental-package@testing}}<br />
<br />
== How can I find out if a certain package exists in Alpine? ==<br />
<br />
If you want to only search repositories you have configured in /etc/apk/repositories, then <code>apk search $pkgname</code> should get you sorted. If you want to search all repositories have a look at the [https://pkgs.alpinelinux.org/ online pkg oracle]<br />
<br />
== WARNING: Ignoring APKINDEX.xxxx.tar.gz ==<br />
If you get <code>WARNING: Ignoring APKINDEX.xxxx.tar.gz: No such file or directory</code> while running [[Alpine_Linux_package_management|package related tools]], check your {{Path|/etc/apk/repositories}} file.<br />
<br />
To check the content of the repositories file<br />
{{Cmd|cat /etc/apk/repositories}}<br />
<br />
or <br />
{{Cmd|setup-apkrepos}}<br />
<br />
= Dynamic DNS =<br />
== How do I schedule a regular dynamic DNS update? ==<br />
You'll want to install the {{pkg|ez-ipupdate}} package:<br />
{{cmd|apk add ez-ipupdate}}<br />
<br />
After that, create a new file at {{path|/etc/ez-ipupdate.conf}} with contents similar to:<br />
service-type=dyndns<br />
user=myusername:mypassword<br />
interface=eth1<br />
host=myhostname.dyndns.org<br />
<br />
Make the new ip cache directory:<br />
{{cmd|mkdir /var/cache/ez-ipupdate<br />
lbu add /var/cache/ez-ipupdate}}<br />
<br />
Then schedule a new cron job with this command:<br />
{{cmd|echo >> /var/log/ez-ipupdate && \<br />/bin/date >> /var/log/ez-ipupdate && \<br />ez-ipupdate --config-file /etc/ez-ipupdate.conf -f -F /var/run/ez-ipupdate.pid \<br /> --cache-file /var/cache/ez-ipupdate/ipcache --quiet >> /var/log/ez-ipupdate 2>&1}}<br />
<br />
Don't forget to backup your settings!<br />
{{cmd|lbu ci}}<br />
<br />
= Terminal =<br />
<br />
== How to enable/fix colors for git? ==<br />
<br />
The problem is not in git itself or terminal, but in the <tt>less</tt> command.<br />
Busybox’s <tt>less</tt> doesn’t support <tt>-r</tt> (<tt>--raw-control-chars</tt>) and <tt>-R</tt> (<tt>--RAW-CONTROL-CHARS</tt>) options.<br />
<br />
The simplest (yet not ideal) solution is to install GNU less:<br />
<br />
{{cmd|apk add less}}<br />
<br />
== Fix lacking lsusb / lspci output ==<br />
<br />
If you launch <code>lsusb</code> or <code>lspci</code> on a minimal installation, there's no device descriptions.<br />
This can be fixed with installing '''usbutils''' or '''pciutils''' packages respectively.<br />
<br />
= Old questions, no longer frequently asked =<br />
<br />
== Alpine freezes during boot from Compact Flash, how can I fix? ==<br />
Most Compact Flash card readers do not support proper DMA.<br /><br />
You should append '''nodma''' to the ''append'' line in {{path|syslinux.cfg}}.<br />
<br />
== How do I remove the CD-ROM? ==<br />
Since the modloop loopback device is on CD-ROM you cannot just run <code>eject</code>. You need to unmount the modloop first.<br /><br />
Unmounting both the modloop and the CDROM in one step can be done by executing:<br />
{{Cmd|/etc/init.d/modloop stop}}<br />
<br />
Then it's possible to eject the CD-ROM:<br />
{{Cmd|eject}}<br />
<br />
== How can I install custom firmware in a diskless system? ==<br />
<br />
The modules and firmware are both special images which are mounted as read-only.<br /><br />
To fix this issue you can copy the firmware directory to your writeable media (cf/usb) and copy your custom firmware to it.<br /><br />
After reboot Alpine should automatically use the directory on your local storage instead of the loopback device.<br />
<br />
== OpenNTPD reports an error with "adjtime" ==<br />
Your log contains something like:<br />
reply from 85.214.86.126: offset 865033148.784255 delay 0.055466, next query 32s<br />
reply from 202.150.212.24: offset 865033148.779314 delay 0.400771, next query 3s<br />
adjusting local clock by 865033148.779835s <br />
adjtime failed: Invalid argument <br />
<br />
{{pkg|openntpd}} is supposed to make small adjustments in the time without causing time jumps.<br /><br />
If the adjustment is too big then something is clearly wrong and ntpd gives up. (its actually adjtime(3) that has a limit on how big adjustments are allowed)<br />
<br />
You can make ntpd set the time at startup by adding ''-s'' option to ntpd. This is done by setting '''NTPD_OPTS="-s"''' in {{path|/etc/conf.d/ntpd}}.<br />
<br />
== Using a cron job to keep the time in sync ==<br />
Add the following to {{path|/etc/periodic/daily}} (or use another folder under the {{path|/etc/periodic}} hierarchy if you want to run the script more/less frequently)<br />
<br />
Example: file called {{path|do-ntp}}<br />
<pre><br />
#!/bin/sh<br />
ntpd -d -q -n -p uk.pool.ntp.org</pre><br />
<br />
This queries the uk time server pool - you can modify this to suit your localisation, or just use ''pool.ntp.org''. More info here: [http://www.pool.ntp.org/zone/@ http://www.pool.ntp.org/zone/@]<br />
<br />
== Windows clients reports an error when trying to sync ==<br />
{{pkg|openntpd}} needs to run for a while before it is satisfied it is in sync.<br />
Until then it will set a flag "clock not synchronized" and Windows will report an error while trying to sync with your {{pkg|openntpd}} server.<br />
<br />
Only thing to do is wait, do something else for 15-20mins and then check.<br />
<br />
<br />
[[Category:Newbie]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Alpine_Linux:FAQ&diff=23646Alpine Linux:FAQ2023-06-05T02:38:46Z<p>Psykose: simplify support</p>
<hr />
<div>[[Image:filetypes.svg|64px|left|link=]]<br />
This is a list of '''frequently asked questions''' about Alpine Linux.<br /><br />
If your question is not answered on this page, use the search box above to find work in progress pages not linked here, or in case of no answer, edit this page and write down your question.<br />
{{Tip| Prepare your question. Think it through. Make it simple and understandable.}} <br />
<br />
=General=<br />
<br />
Alpine Linux is used heavily in containers (e.g. Docker images) on servers, so many of its main packages are focused on server services.<br />
<br />
== Where to start? ==<br />
<br />
The [[Installation]] page and the [[Installation#Post-Installation|Post Installation]] section on that page, provide a basic orientation.<br />
<br />
A broader overview may be found on the official [https://alpinelinux.org/about About] page and at the [[Alpine Linux:Overview|wiki overview]].<br />
<br />
Please note that testing is safer on your own virtual machine or on a public [https://distrotest.net/AlpineLinux/ DistroTest.net].<br />
<br />
== I have found a bug, where can I report it? ==<br />
<br />
You can report it on the [https://gitlab.alpinelinux.org/groups/alpine/-/issues bugtracker], but search it first to see if the issue has already been reported.<br />
<br />
== Are there any details about the releases available? ==<br />
Yes, please check the [https://alpinelinux.org/releases/ releases] page.<br />
<br />
== How can I contribute? ==<br />
You can contribute by:<br />
* Using the software and giving [https://gitlab.alpinelinux.org/groups/alpine/-/issues feedback].<br />
* Documenting your [https://www.alpinelinux.org Alpine Linux] experiences on this [[Main_Page|wiki]].<br />
* Flag packages as outdated in the [https://pkgs.alpinelinux.org/packages package database], or even better enable release monitoring in [https://release-monitoring.org/ Anitya] for them.<br />
* In many other ways.<br />
Please visit [[Contribute|Contribute page]] to read more about this topic.<br />
<br />
== Why don't I have man pages or where is the 'man' command? ==<br />
The <code>man</code> command and '''man pages''' are not installed by default.<br />
<br />
Install the <code>man</code> command:<br />
{{cmd|# apk add mandoc}}<br />
Install basic manual pages. {{pkg|man-pages}} package provides the system's ''core'' manual pages:<br />
{{cmd|# apk add man-pages}}<br />
Install the <code>apropos</code> command to search in '''man pages''':<br />
{{cmd|# apk add mandoc-apropos}}<br />
Once installed, add documentation for the package where you need it. For example, say you installed {{pkg|nftables}} and you now require its '''man pages''':<br />
{{cmd|# apk add nftables-doc}}<br />
To always install the documentation companion package add the {{pkg|docs}} meta package. Keep in mind not all packages have a corresponding documentation package and even when it has one it may not include '''man pages''':<br />
{{cmd|# apk add docs}}<br />
<br />
== What is the difference between edge and stable releases? ==<br />
Stable releases are just what they sound like: initially a point-in-time snapshot of the package archives, but then maintained with bugfixes only in order to keep a stable environment.<br />
<br />
[[Repositories#Edge|Edge]] is more of a rolling-release, with the latest and greatest packages available in the online repositories.<br /><br />
Occasionally, snapshot ISO images of the then-current state of [[Repositories#Edge|edge]] are made and are available for download.<br /><br />
Typically these are made when there are major kernel upgrades or package upgrades that require initramfs rebuilds.<br />
<br />
== What architectures does Alpine Linux support? ==<br />
* '''aarch64''': 64-bit ARM processors (e.g. Raspberry Pi 4)<br />
* '''armhf''': 32-bit ARM processors with a floating point unit (e.g. Raspberry Pi 1)<br />
* '''armv7''': 32-bit ARM processors without a floating point unit<br />
* '''s390x''': IBM mainframes using the z/Architecture<br />
* '''ppc64le''': 64-bit little-endian POWER devices (e.g. Raptor Talos II)<br />
* '''x86''': 32-bit Intel and AMD processors commonly found in older personal computers (e.g. Pentium III, Athlon XP). Can also run on x86_64 machines<br />
* '''x86_64''': 64-bit Intel and AMD processors commonly found in personal computers (e.g. Core i7, Ryzen 7)<br />
'''Please check [https://alpinelinux.org/downloads Download] page for media availability on each one''' and check [https://alpinelinux.org/releases/ Release Branches] page for latest.<br />
<br />
== What kinds of release of Alpine Linux are available? ==<br />
Please check the [https://alpinelinux.org/releases/ Release Branches] page for more information.<br />
<br />
=Setup=<br />
<br />
== What is the difference between ''sys'', ''data'', and ''diskless'' when running <code>setup-alpine</code> or <code>setup-disk</code>? ==<br />
<br />
'''sys:''' This mode is a traditional disk install. The following partitions will be created on the disk: ''/boot/'', ''/'' (filesystem root) and ''swap''.<br />
This mode may be used for development boxes, desktops, virtual servers, etc.<br />
<br />
'''data:''' This mode uses your disk(s) for data storage, not for the operating system. Runs from the media and only a ''/var/'' is created on disk. The system itself will run from a ''tmpfs'' (RAM). Use this mode if you only want to use the disk(s) for data, like ''mailspool'', ''databases'', ''logs'', etc.<br />
<br />
'''diskless:''' No disks are to be used. [[Alpine local backup]] may still be used in this mode.<br />
<br />
These modes are explained further on the [[Installation#Installation_Overview|'''Installation''']] page.<br />
<br />
== How do I upgrade Alpine? ==<br />
<br />
To upgrade to a new stable release or edge:<br />
<code>apk upgrade --available</code><br />
<br />
==Why don't my cron jobs run?==<br />
<br />
Start service ''crond'' and add it to runlevel:<br />
<br />
: {{cmd|rc-service crond start && rc-update add crond}}<br />
<br />
After that the cron daemon is started automatically on system boot and executes the scripts placed in the folders under ''/etc/periodic/'' - there are folders for ''15min'', ''hourly'', ''daily'', ''weekly'' and ''monthly'' scripts.<br />
<br />
To check whether your scripts are likely to run, use the ''run-parts'' command, for example:<br />
<br />
: {{cmd|run-parts --test /etc/periodic/15min}}<br />
<br />
This command will tell you what should run but will not actually execute the scripts.<br />
<br />
If the results of the test are not as expected, check the following:<br />
<br />
* Make sure the script is executable - if unsure, issue the command {{cmd|chmod +x /etc/periodic/[path/scriptname]}}<br />
* Make sure the first line of your script is <code>#!/bin/sh</code><br />
* Do not use periods on your script file names - this stops them from working; for example: {{Path|/etc/periodic/daily/myscript}} will run, but {{Path|/etc/periodic/daily/myscript.sh}} won't.<br />
<br />
= Time and timezones =<br />
<br />
== How do I set the local timezone? ==<br />
<br />
If you wish to edit the ''timezone'' (TZ) after installation, run the [[Alpine_setup_scripts#setup-timezone|setup-timezone]] script.<br />
<br />
= Packages =<br />
<br />
== Can you build an APK package for ...? ==<br />
Yes, we probably can.<br /><br />
Please create an [https://gitlab.alpinelinux.org/alpine/aports/issues/new issue] in the [https://gitlab.alpinelinux.org bugtracker]. Prefix it with "feat" in the title and include a short description (one-line), a URL for the home page, and a URL for the source package.<br />
<br />
== How can I build my own package? ==<br />
Please see the [[Creating an Alpine package]] page.<br />
<br />
== What does "required by: world[$pkgname]" mean? ==<br />
<br />
It means that the package you tried to install does not exist in the repositories you have configured. <br />
<br />
Maybe you forgot to add community, testing or unmaintained to ''/etc/apk/repositories''? <br />
<br />
Or is the package in a [[Alpine_Linux_package_management#Repository_pinning|pinned repository]] and you forgot to suffix the package with the repo tag? Example:<br />
<br />
{{cmd|apk add experimental-package@testing}}<br />
<br />
== How can I find out if a certain package exists in Alpine? ==<br />
<br />
If you want to only search repositories you have configured in /etc/apk/repositories, then <code>apk search $pkgname</code> should get you sorted. If you want to search all repositories have a look at the [https://pkgs.alpinelinux.org/ online pkg oracle]<br />
<br />
== WARNING: Ignoring APKINDEX.xxxx.tar.gz ==<br />
If you get <code>WARNING: Ignoring APKINDEX.xxxx.tar.gz: No such file or directory</code> while running [[Alpine_Linux_package_management|package related tools]], check your {{Path|/etc/apk/repositories}} file.<br />
<br />
To check the content of the repositories file<br />
{{Cmd|cat /etc/apk/repositories}}<br />
<br />
or <br />
{{Cmd|setup-apkrepos}}<br />
<br />
= Dynamic DNS =<br />
== How do I schedule a regular dynamic DNS update? ==<br />
You'll want to install the {{pkg|ez-ipupdate}} package:<br />
{{cmd|apk add ez-ipupdate}}<br />
<br />
After that, create a new file at {{path|/etc/ez-ipupdate.conf}} with contents similar to:<br />
service-type=dyndns<br />
user=myusername:mypassword<br />
interface=eth1<br />
host=myhostname.dyndns.org<br />
<br />
Make the new ip cache directory:<br />
{{cmd|mkdir /var/cache/ez-ipupdate<br />
lbu add /var/cache/ez-ipupdate}}<br />
<br />
Then schedule a new cron job with this command:<br />
{{cmd|echo >> /var/log/ez-ipupdate && \<br />/bin/date >> /var/log/ez-ipupdate && \<br />ez-ipupdate --config-file /etc/ez-ipupdate.conf -f -F /var/run/ez-ipupdate.pid \<br /> --cache-file /var/cache/ez-ipupdate/ipcache --quiet >> /var/log/ez-ipupdate 2>&1}}<br />
<br />
Don't forget to backup your settings!<br />
{{cmd|lbu ci}}<br />
<br />
= Terminal =<br />
<br />
== How to enable/fix colors for git? ==<br />
<br />
The problem is not in git itself or terminal, but in the <tt>less</tt> command.<br />
Busybox’s <tt>less</tt> doesn’t support <tt>-r</tt> (<tt>--raw-control-chars</tt>) and <tt>-R</tt> (<tt>--RAW-CONTROL-CHARS</tt>) options.<br />
<br />
The simplest (yet not ideal) solution is to install GNU less:<br />
<br />
{{cmd|apk add less}}<br />
<br />
== Fix lacking lsusb / lspci output ==<br />
<br />
If you launch <code>lsusb</code> or <code>lspci</code> on a minimal installation, there's no device descriptions.<br />
This can be fixed with installing '''usbutils''' or '''pciutils''' packages respectively.<br />
<br />
= Old questions, no longer frequently asked =<br />
<br />
== Alpine freezes during boot from Compact Flash, how can I fix? ==<br />
Most Compact Flash card readers do not support proper DMA.<br /><br />
You should append '''nodma''' to the ''append'' line in {{path|syslinux.cfg}}.<br />
<br />
== How do I remove the CD-ROM? ==<br />
Since the modloop loopback device is on CD-ROM you cannot just run <code>eject</code>. You need to unmount the modloop first.<br /><br />
Unmounting both the modloop and the CDROM in one step can be done by executing:<br />
{{Cmd|/etc/init.d/modloop stop}}<br />
<br />
Then it's possible to eject the CD-ROM:<br />
{{Cmd|eject}}<br />
<br />
== How can I install custom firmware in a diskless system? ==<br />
<br />
The modules and firmware are both special images which are mounted as read-only.<br /><br />
To fix this issue you can copy the firmware directory to your writeable media (cf/usb) and copy your custom firmware to it.<br /><br />
After reboot Alpine should automatically use the directory on your local storage instead of the loopback device.<br />
<br />
== OpenNTPD reports an error with "adjtime" ==<br />
Your log contains something like:<br />
reply from 85.214.86.126: offset 865033148.784255 delay 0.055466, next query 32s<br />
reply from 202.150.212.24: offset 865033148.779314 delay 0.400771, next query 3s<br />
adjusting local clock by 865033148.779835s <br />
adjtime failed: Invalid argument <br />
<br />
{{pkg|openntpd}} is supposed to make small adjustments in the time without causing time jumps.<br /><br />
If the adjustment is too big then something is clearly wrong and ntpd gives up. (its actually adjtime(3) that has a limit on how big adjustments are allowed)<br />
<br />
You can make ntpd set the time at startup by adding ''-s'' option to ntpd. This is done by setting '''NTPD_OPTS="-s"''' in {{path|/etc/conf.d/ntpd}}.<br />
<br />
== Using a cron job to keep the time in sync ==<br />
Add the following to {{path|/etc/periodic/daily}} (or use another folder under the {{path|/etc/periodic}} hierarchy if you want to run the script more/less frequently)<br />
<br />
Example: file called {{path|do-ntp}}<br />
<pre><br />
#!/bin/sh<br />
ntpd -d -q -n -p uk.pool.ntp.org</pre><br />
<br />
This queries the uk time server pool - you can modify this to suit your localisation, or just use ''pool.ntp.org''. More info here: [http://www.pool.ntp.org/zone/@ http://www.pool.ntp.org/zone/@]<br />
<br />
== Windows clients reports an error when trying to sync ==<br />
{{pkg|openntpd}} needs to run for a while before it is satisfied it is in sync.<br />
Until then it will set a flag "clock not synchronized" and Windows will report an error while trying to sync with your {{pkg|openntpd}} server.<br />
<br />
Only thing to do is wait, do something else for 15-20mins and then check.<br />
<br />
<br />
[[Category:Newbie]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Alpine_Linux:FAQ&diff=23645Alpine Linux:FAQ2023-06-05T02:37:55Z<p>Psykose: remove ancient OSS section (oss isn't relevant anymore and all listed things use alsa)</p>
<hr />
<div>[[Image:filetypes.svg|64px|left|link=]]<br />
This is a list of '''frequently asked questions''' about Alpine Linux.<br /><br />
If your question is not answered on this page, use the search box above to find work in progress pages not linked here, or in case of no answer, edit this page and write down your question.<br />
{{Tip| Prepare your question. Think it through. Make it simple and understandable.}} <br />
<br />
=General=<br />
<br />
Alpine Linux is used heavily in containers (e.g. Docker images) on servers, so many of its main packages are focused on server services.<br />
<br />
== Where to start? ==<br />
<br />
The [[Installation]] page and the [[Installation#Post-Installation|Post Installation]] section on that page, provide a basic orientation.<br />
<br />
A broader overview may be found on the official [https://alpinelinux.org/about About] page and at the [[Alpine Linux:Overview|wiki overview]].<br />
<br />
Please note that testing is safer on your own virtual machine or on a public [https://distrotest.net/AlpineLinux/ DistroTest.net].<br />
<br />
== I have found a bug, where can I report it? ==<br />
<br />
You can report it on the [https://gitlab.alpinelinux.org/groups/alpine/-/issues bugtracker], but search it first to see if the issue has already been reported.<br />
<br />
== Are there any details about the releases available? ==<br />
Yes, please check the [https://alpinelinux.org/releases/ releases] page.<br />
<br />
== How can I contribute? ==<br />
You can contribute by:<br />
* Using the software and giving [https://gitlab.alpinelinux.org/groups/alpine/-/issues feedback].<br />
* Documenting your [https://www.alpinelinux.org Alpine Linux] experiences on this [[Main_Page|wiki]].<br />
* Flag packages as outdated in the [https://pkgs.alpinelinux.org/packages package database], or even better enable release monitoring in [https://release-monitoring.org/ Anitya] for them.<br />
* In many other ways.<br />
Please visit [[Contribute|Contribute page]] to read more about this topic.<br />
<br />
== Why don't I have man pages or where is the 'man' command? ==<br />
The <code>man</code> command and '''man pages''' are not installed by default.<br />
<br />
Install the <code>man</code> command:<br />
{{cmd|# apk add mandoc}}<br />
Install basic manual pages. {{pkg|man-pages}} package provides the system's ''core'' manual pages:<br />
{{cmd|# apk add man-pages}}<br />
Install the <code>apropos</code> command to search in '''man pages''':<br />
{{cmd|# apk add mandoc-apropos}}<br />
Once installed, add documentation for the package where you need it. For example, say you installed {{pkg|nftables}} and you now require its '''man pages''':<br />
{{cmd|# apk add nftables-doc}}<br />
To always install the documentation companion package add the {{pkg|docs}} meta package. Keep in mind not all packages have a corresponding documentation package and even when it has one it may not include '''man pages''':<br />
{{cmd|# apk add docs}}<br />
<br />
== What is the difference between edge and stable releases? ==<br />
Stable releases are just what they sound like: initially a point-in-time snapshot of the package archives, but then maintained with bugfixes only in order to keep a stable environment.<br />
<br />
[[Repositories#Edge|Edge]] is more of a rolling-release, with the latest and greatest packages available in the online repositories.<br /><br />
Occasionally, snapshot ISO images of the then-current state of [[Repositories#Edge|edge]] are made and are available for download.<br /><br />
Typically these are made when there are major kernel upgrades or package upgrades that require initramfs rebuilds.<br />
<br />
== What architectures does Alpine support? ==<br />
As Alpine uses the Linux kernel, it supports:<br />
* '''aarch64''': 64-bit ARM processors (e.g. Raspberry Pi 4)<br />
* '''armhf''': 32-bit ARM processors with a floating point unit (e.g. Raspberry Pi 1)<br />
* '''armv7''': 32-bit ARM processors without a floating point unit<br />
* '''s390x''': IBM mainframes using the z/Architecture<br />
* '''ppc64le''': 64-bit little-endian POWER devices (e.g. Raptor Talos II)<br />
* '''x86''': 32-bit Intel and AMD processors commonly found in older personal computers (e.g. Pentium III, Athlon XP). Can also run on x86_64 machines<br />
* '''x86_64''': 64-bit Intel and AMD processors commonly found in personal computers (e.g. Core i7, Ryzen 7)<br />
'''Please check [https://alpinelinux.org/downloads Download] page for media availability on each one''' and check [https://alpinelinux.org/releases/ Release Branches] page for latest.<br />
<br />
== What kinds of release of Alpine Linux are available? ==<br />
Please check the [https://alpinelinux.org/releases/ Release Branches] page for more information.<br />
<br />
=Setup=<br />
<br />
== What is the difference between ''sys'', ''data'', and ''diskless'' when running <code>setup-alpine</code> or <code>setup-disk</code>? ==<br />
<br />
'''sys:''' This mode is a traditional disk install. The following partitions will be created on the disk: ''/boot/'', ''/'' (filesystem root) and ''swap''.<br />
This mode may be used for development boxes, desktops, virtual servers, etc.<br />
<br />
'''data:''' This mode uses your disk(s) for data storage, not for the operating system. Runs from the media and only a ''/var/'' is created on disk. The system itself will run from a ''tmpfs'' (RAM). Use this mode if you only want to use the disk(s) for data, like ''mailspool'', ''databases'', ''logs'', etc.<br />
<br />
'''diskless:''' No disks are to be used. [[Alpine local backup]] may still be used in this mode.<br />
<br />
These modes are explained further on the [[Installation#Installation_Overview|'''Installation''']] page.<br />
<br />
== How do I upgrade Alpine? ==<br />
<br />
To upgrade to a new stable release or edge:<br />
<code>apk upgrade --available</code><br />
<br />
==Why don't my cron jobs run?==<br />
<br />
Start service ''crond'' and add it to runlevel:<br />
<br />
: {{cmd|rc-service crond start && rc-update add crond}}<br />
<br />
After that the cron daemon is started automatically on system boot and executes the scripts placed in the folders under ''/etc/periodic/'' - there are folders for ''15min'', ''hourly'', ''daily'', ''weekly'' and ''monthly'' scripts.<br />
<br />
To check whether your scripts are likely to run, use the ''run-parts'' command, for example:<br />
<br />
: {{cmd|run-parts --test /etc/periodic/15min}}<br />
<br />
This command will tell you what should run but will not actually execute the scripts.<br />
<br />
If the results of the test are not as expected, check the following:<br />
<br />
* Make sure the script is executable - if unsure, issue the command {{cmd|chmod +x /etc/periodic/[path/scriptname]}}<br />
* Make sure the first line of your script is <code>#!/bin/sh</code><br />
* Do not use periods on your script file names - this stops them from working; for example: {{Path|/etc/periodic/daily/myscript}} will run, but {{Path|/etc/periodic/daily/myscript.sh}} won't.<br />
<br />
= Time and timezones =<br />
<br />
== How do I set the local timezone? ==<br />
<br />
If you wish to edit the ''timezone'' (TZ) after installation, run the [[Alpine_setup_scripts#setup-timezone|setup-timezone]] script.<br />
<br />
= Packages =<br />
<br />
== Can you build an APK package for ...? ==<br />
Yes, we probably can.<br /><br />
Please create an [https://gitlab.alpinelinux.org/alpine/aports/issues/new issue] in the [https://gitlab.alpinelinux.org bugtracker]. Prefix it with "feat" in the title and include a short description (one-line), a URL for the home page, and a URL for the source package.<br />
<br />
== How can I build my own package? ==<br />
Please see the [[Creating an Alpine package]] page.<br />
<br />
== What does "required by: world[$pkgname]" mean? ==<br />
<br />
It means that the package you tried to install does not exist in the repositories you have configured. <br />
<br />
Maybe you forgot to add community, testing or unmaintained to ''/etc/apk/repositories''? <br />
<br />
Or is the package in a [[Alpine_Linux_package_management#Repository_pinning|pinned repository]] and you forgot to suffix the package with the repo tag? Example:<br />
<br />
{{cmd|apk add experimental-package@testing}}<br />
<br />
== How can I find out if a certain package exists in Alpine? ==<br />
<br />
If you want to only search repositories you have configured in /etc/apk/repositories, then <code>apk search $pkgname</code> should get you sorted. If you want to search all repositories have a look at the [https://pkgs.alpinelinux.org/ online pkg oracle]<br />
<br />
== WARNING: Ignoring APKINDEX.xxxx.tar.gz ==<br />
If you get <code>WARNING: Ignoring APKINDEX.xxxx.tar.gz: No such file or directory</code> while running [[Alpine_Linux_package_management|package related tools]], check your {{Path|/etc/apk/repositories}} file.<br />
<br />
To check the content of the repositories file<br />
{{Cmd|cat /etc/apk/repositories}}<br />
<br />
or <br />
{{Cmd|setup-apkrepos}}<br />
<br />
= Dynamic DNS =<br />
== How do I schedule a regular dynamic DNS update? ==<br />
You'll want to install the {{pkg|ez-ipupdate}} package:<br />
{{cmd|apk add ez-ipupdate}}<br />
<br />
After that, create a new file at {{path|/etc/ez-ipupdate.conf}} with contents similar to:<br />
service-type=dyndns<br />
user=myusername:mypassword<br />
interface=eth1<br />
host=myhostname.dyndns.org<br />
<br />
Make the new ip cache directory:<br />
{{cmd|mkdir /var/cache/ez-ipupdate<br />
lbu add /var/cache/ez-ipupdate}}<br />
<br />
Then schedule a new cron job with this command:<br />
{{cmd|echo >> /var/log/ez-ipupdate && \<br />/bin/date >> /var/log/ez-ipupdate && \<br />ez-ipupdate --config-file /etc/ez-ipupdate.conf -f -F /var/run/ez-ipupdate.pid \<br /> --cache-file /var/cache/ez-ipupdate/ipcache --quiet >> /var/log/ez-ipupdate 2>&1}}<br />
<br />
Don't forget to backup your settings!<br />
{{cmd|lbu ci}}<br />
<br />
= Terminal =<br />
<br />
== How to enable/fix colors for git? ==<br />
<br />
The problem is not in git itself or terminal, but in the <tt>less</tt> command.<br />
Busybox’s <tt>less</tt> doesn’t support <tt>-r</tt> (<tt>--raw-control-chars</tt>) and <tt>-R</tt> (<tt>--RAW-CONTROL-CHARS</tt>) options.<br />
<br />
The simplest (yet not ideal) solution is to install GNU less:<br />
<br />
{{cmd|apk add less}}<br />
<br />
== Fix lacking lsusb / lspci output ==<br />
<br />
If you launch <code>lsusb</code> or <code>lspci</code> on a minimal installation, there's no device descriptions.<br />
This can be fixed with installing '''usbutils''' or '''pciutils''' packages respectively.<br />
<br />
= Old questions, no longer frequently asked =<br />
<br />
== Alpine freezes during boot from Compact Flash, how can I fix? ==<br />
Most Compact Flash card readers do not support proper DMA.<br /><br />
You should append '''nodma''' to the ''append'' line in {{path|syslinux.cfg}}.<br />
<br />
== How do I remove the CD-ROM? ==<br />
Since the modloop loopback device is on CD-ROM you cannot just run <code>eject</code>. You need to unmount the modloop first.<br /><br />
Unmounting both the modloop and the CDROM in one step can be done by executing:<br />
{{Cmd|/etc/init.d/modloop stop}}<br />
<br />
Then it's possible to eject the CD-ROM:<br />
{{Cmd|eject}}<br />
<br />
== How can I install custom firmware in a diskless system? ==<br />
<br />
The modules and firmware are both special images which are mounted as read-only.<br /><br />
To fix this issue you can copy the firmware directory to your writeable media (cf/usb) and copy your custom firmware to it.<br /><br />
After reboot Alpine should automatically use the directory on your local storage instead of the loopback device.<br />
<br />
== OpenNTPD reports an error with "adjtime" ==<br />
Your log contains something like:<br />
reply from 85.214.86.126: offset 865033148.784255 delay 0.055466, next query 32s<br />
reply from 202.150.212.24: offset 865033148.779314 delay 0.400771, next query 3s<br />
adjusting local clock by 865033148.779835s <br />
adjtime failed: Invalid argument <br />
<br />
{{pkg|openntpd}} is supposed to make small adjustments in the time without causing time jumps.<br /><br />
If the adjustment is too big then something is clearly wrong and ntpd gives up. (its actually adjtime(3) that has a limit on how big adjustments are allowed)<br />
<br />
You can make ntpd set the time at startup by adding ''-s'' option to ntpd. This is done by setting '''NTPD_OPTS="-s"''' in {{path|/etc/conf.d/ntpd}}.<br />
<br />
== Using a cron job to keep the time in sync ==<br />
Add the following to {{path|/etc/periodic/daily}} (or use another folder under the {{path|/etc/periodic}} hierarchy if you want to run the script more/less frequently)<br />
<br />
Example: file called {{path|do-ntp}}<br />
<pre><br />
#!/bin/sh<br />
ntpd -d -q -n -p uk.pool.ntp.org</pre><br />
<br />
This queries the uk time server pool - you can modify this to suit your localisation, or just use ''pool.ntp.org''. More info here: [http://www.pool.ntp.org/zone/@ http://www.pool.ntp.org/zone/@]<br />
<br />
== Windows clients reports an error when trying to sync ==<br />
{{pkg|openntpd}} needs to run for a while before it is satisfied it is in sync.<br />
Until then it will set a flag "clock not synchronized" and Windows will report an error while trying to sync with your {{pkg|openntpd}} server.<br />
<br />
Only thing to do is wait, do something else for 15-20mins and then check.<br />
<br />
<br />
[[Category:Newbie]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Release_Notes_for_Alpine_3.18.0&diff=23643Release Notes for Alpine 3.18.02023-06-02T04:24:47Z<p>Psykose: suid readded on chromium</p>
<hr />
<div>== Base System ==<br />
<br />
=== Linux Kernel ===<br />
<br />
{{pkg|linux-lts}} was updated from 5.15 to 6.1. [https://lkml.org/lkml/2022/12/11/206 release notes]<br />
<br />
Kernel modules are now signed.<br />
<br />
''Note: {{pkg|akms}} (Alpine Kernel Module Support) doesn't support modules signing yet, it will be implemented later.''<br />
<br />
=== musl 1.2.4 ===<br />
<br />
Support for DNS lookups over TCP. [https://www.openwall.com/lists/musl/2023/05/02/1 release notes]<br />
<br />
=== DT_RELR ===<br />
<br />
on x86, x86_64, and ppc64le, <code>-Wl,-z,pack-relative-relocs</code> is now added to the base LDFLAGS. this reduces elf (executable/shared-library) size by 10% on average. <br />
<br />
however, these binaries are now not portable to other musl-based systems that have a musl older than 1.2.4, because older versions are incapable of loading these binaries.<br />
<br />
=== OpenSSL 3.1 ===<br />
<br />
[https://www.openssl.org/news/openssl-3.1-notes.html release notes]<br />
<br />
=== Experimental headless installer ===<br />
<br />
Support for head-less installs with [https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud tiny-cloud] was added. This is done via a volume with label <code>cidata</code>, similar to cloud-init's [https://cloudinit.readthedocs.io/en/latest/reference/datasources/nocloud.html NoCloud] provider. If this volume is found during boot, the network will be auto configured and provided, a default user named <code>alpine</code> will be created and ssh keys provided in meta-data will be added. This is experimental and may change without prior notice.<br />
<br />
=== e2fsprogs 1.47.0 ===<br />
<br />
The {{pkg|e2fsprogs}} package shipped with Alpine 3.18 changed the behaviour of <code>mke2fs</code> so that newly created filesystems have two additional features enabled.<br />
<br />
From [https://e2fsprogs.sourceforge.net/e2fsprogs-release.html#1.47.0 release notes]:<br />
<br />
<blockquote>The mke2fs program (via the mke2fs.conf file) now enables the metadata_csum_seed and orphan_file features by default.</blockquote><br />
<br />
However, whilst the <code>metadata_csum_seed</code> feature is known about by older versions of e2fsck the <code>orphan_file</code> feature was both added to e2fsprogs 1.47.0 '''and''' enabled at the same time. Therefore older versions of e2fsck are unable to fsck a filesystem created by mke2fs 1.47.0.<br />
<br />
== Compilers and Runtimes ==<br />
<br />
<!-- stuff in main --><br />
=== LLVM 16 ===<br />
<br />
{{pkg|llvm16}} was added. [https://releases.llvm.org/16.0.0/docs/ReleaseNotes.html release notes]<br />
<br />
=== Lua ===<br />
<br />
{{pkg|luarocks}}, the package manager for Lua, was updated from 2.x to 3x. [https://github.com/luarocks/luarocks/blob/master/CHANGELOG.md#whats-new-in-luarocks-300 release notes]<br />
<br />
=== Python ===<br />
<br />
{{pkg|python3}} was updated from 3.10 to 3.11. [https://docs.python.org/3/whatsnew/3.11.html release notes]<br />
<br />
==== splitting of python pycache .pyc files ====<br />
<br />
Most python modules split their <code>__pycache__</code> to a <code>-pyc</code> subpackage, pulled by default. To save space and not pull it (incurring python interpreter startup costs, as it generates it each run), run <code>apk add !python3-pyc</code><br />
<br />
=== Ruby 3.2 ===<br />
<br />
{{pkg|ruby}} was updated from 3.1 to 3.2. [https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/ release notes]<br />
<br />
<br />
<!-- community --><br />
<br />
=== Crystal 1.8 ===<br />
<br />
{{pkg|crystal}} was updated from 1.6 to 1.8. [https://crystal-lang.org/2023/01/09/1.7.0-released/ release notes for 1.7], [https://crystal-lang.org/2023/04/14/1.8.0-released/ release notes for 1.8]<br />
<br />
=== Go 1.20 ===<br />
<br />
{{pkg|go}} [https://go.dev/blog/go1.20 release notes]<br />
<br />
=== PHP 8.2 ===<br />
<br />
Added 8.2 packages with a subset of the most common extensions. Version 8.1 still remains the primary provider priority, but some web applications started to use 8.2.<br />
<br />
=== R 4.3 ===<br />
<br />
{{pkg|R}} was updated from 4.2 to 4.3. [https://www.r-bloggers.com/2023/04/whats-new-in-r-4-3-0/ release notes]<br />
<br />
=== Rust 1.69 ===<br />
<br />
{{pkg|rust}} was updated from 1.64 to 1.69.<br />
<br />
== Desktop ==<br />
<br />
=== gdk-pixbuf-loaders ===<br />
<br />
A few gdk-pixbuf loaders were added, and they were all added to an <code>install_if</code> metapackage rule. Run <code>apk add gdk-pixbuf-loaders</code> to enable the loaders for the corresponding image libraries you have installed.<br />
<br />
=== GNOME 44 ===<br />
<br />
[https://release.gnome.org/44/ release notes]<br />
<br />
The {{pkg|gnome}} metapackage was reworked and the packages {{pkg|gnome-apps-extra}} and {{pkg|gnome-games-collection}} were removed to avoid opinionated lists in metapackages. It is advised to remove those from <code>/etc/apk/world</code> before performing the upgrade. Additionally, the new subpackage {{pkg|gnome-dev-tools}} was added following the upstream's recommendations.<br />
<br />
On related news, to make use of GNOME Software, it is necessary to enable the <code>apk-polkit-server</code> openrc service. More info in the [https://wiki.alpinelinux.org/wiki/Gnome#Enabling_GNOME_Software wiki]<br />
<br />
=== Plasma 5.27 ===<br />
<br />
{{pkg|plasma}} was updated from 5.26 to 5.27. This includes some new packages like {{pkg|plasma-welcome}} (a welcoming application that shows up on the first boot to configure some initial settings) and {{pkg|flatpak-kcm}} (a configuration page for the system settings to control Flatpak permissions, much like GNOME's Flatseal).<br />
This Plasma release is the last one that will be built on Qt5 and will probably remain in use for Alpine 3.19 as well.<br />
<br />
=== Sway 1.8 ===<br />
<br />
{{pkg|sway}} was updated from 1.7 to 1.8. [https://github.com/swaywm/sway/releases/tag/1.8 release notes]<br />
<br />
== Others ==<br />
<br />
=== dbus ===<br />
<br />
dbus-activation has been removed from packages {{pkg|openrc-settingsd}} and {{pkg|apk-polkit-rs}}. To make use of their services, make sure to start and enable the <code>openrc-settingsd</code> and <code>apk-polkit-server</code> services, respectively.<br />
<br />
=== nginx 1.24 ===<br />
<br />
{{pkg|nginx}} was updated to the new stable branch 1.24.x. [https://nginx.org/en/CHANGES-1.24 release notes]<br />
<br />
=== Removal of pipewire-media-session ===<br />
<br />
{{pkg|pipewire-media-session}} was removed, as upstream explicitly recommends not to use it, and it's completely superceded by wireplumber.<br />
if you used it, make sure you don't have {{pkg|pipewire-media-session}} in <code>/etc/apk/world</code>, and configure any scripts you might've had to launch <code>wireplumber</code> instead.<br />
<br />
=== QEMU 8 ===<br />
<br />
QEMU was updated from 7.1 to 8.0. [https://www.qemu.org/2023/04/20/qemu-8-0-0/ release notes]<br />
<br />
=== Docker 23 ===<br />
<br />
The {{pkg|docker}} package shipped with Alpine 3.18 has a dependency on {{pkg|docker-cli-buildx}}, as Docker 23 now uses it for builds.<br />
<br />
Also, Docker 23 no longer enables the <code>overlay</code> storage driver, as it has been deprecated for a long time and is nearing removal. if your deployment is still configured to use it, <code>dockerd</code> will fail to start. To fix this, either...<br />
<br />
* migrate to <code>overlay2</code> in <code>/etc/docker/daemon.json</code><br />
* hardcode it to <code>overlay</code> in the same file (instead of blank), though this will eventually break in a future upgrade<br />
<br />
For more detailed information about Docker 23, please refer to the [https://docs.docker.com/engine/release-notes/23.0/ release notes].<br />
<br />
=== AWS CLI v2 ===<br />
<br />
The {{pkg|aws-cli}} package has been upgraded from v1 to v2 which results in changed behaviour in how certain commands behave.<br />
<br />
Please follow [https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html this guide] for migrating between versions.<br />
<br />
=== ppp 2.5.0 ===<br />
<br />
pppd (<code>ppp-daemon</code>, <code>ppp-pppoe</code>, ..) was updated to 2.5. in 2.4.9, the <code>rp-pppoe.so</code> plugin was renamed to <code>pppoe.so</code> <br />
<br />
if you have <code>plugin rp-pppoe.so ...</code> configuration lines, you should update them accordingly.<br />
<br />
=== 7-zip ===<br />
<br />
<code>p7zip</code> was removed in favor of the linux port of 7-zip. they both provide the <code>7z</code> command, so nothing should be affected in usage.</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Flatpak&diff=23631Flatpak2023-06-01T03:26:31Z<p>Psykose: reword permission group error</p>
<hr />
<div>{{Draft|More documentation and testing is needed, but everything currently here should be safe to follow.}}<br />
<br />
Flatpak is a technology for building and distributing applications with the goal of having a universal package format for all Linux distributons, it is similar to [https://en.wikipedia.org/wiki/Snap_(software) Snap], <br />
<br />
<br />
= Setup / Installation =<br />
<br />
''From: https://flatpak.org/setup/Alpine/''<br />
<br />
{{Note|To install Flatpak you will need to enable the Community repository, See: [[Repositories#Managing_repositories|Repositories - Managing repositories]]}}<br />
<br />
To install Flatpak run:<br />
<br />
{{cmd|# apk add flatpak}}<br />
<br />
Next you need to add a repository, for this guide we will use the recommended repository, [https://flathub.org Flathub].<br />
<br />
{{cmd|flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo}}<br />
<br />
Now reboot to complete setup<br />
<br />
{{Note|graphical installation of Flatpak apps may not be possible with Alpine.}}<br />
<br />
<br><br />
<br />
= Usage =<br />
<br />
To get all of the available options to use with the '''flatpak''' command run: '''flatpak --help''' or '''flatpak -h''',<br />
<br />
<br><br />
<br />
==== Search ====<br />
<br />
To search for applications run '''flatpak search <appplicationname>'''<br />
<br />
Example:<br />
{{cat|flatpak search chromium|Name Description Application ID Version Branch Remotes<br />
Chromium Web Browser The web browser from Chromium project org.chromium.Chromium 96.0.4664.93 stable flathub<br />
Chromium B.S.U. Fast paced, arcade-style, top-scrolling space shooter net.sourceforge.chromium-bsu 0.9.16.1 stable flathub<br />
ungoogled-chromium A lightweight approach to removing Google web service dependency com.github.Eloston.UngoogledChromium 96.0.4664.45 stable flathub}}<br />
<br />
<br><br />
<br />
==== Install ====<br />
<br />
To install a package run '''flatpak install <applicationname>'''<br />
<br />
{{cat|$ flatpak install com.github.Eloston.UngoogledChromium|Looking for matches…<br />
<br />
com.github.Eloston.UngoogledChromium permissions:<br />
ipc network cups pulseaudio wayland x11<br />
devices file access [1] dbus access [2] bus ownership [3] system dbus access [4]<br />
<br />
[1] /run/.heim_org.h5l.kcm-socket, home, xdg-run/pipewire-0<br />
[2] org.freedesktop.FileManager1, org.freedesktop.Notifications, org.freedesktop.secrets, org.gnome.SessionManager<br />
[3] org.mpris.MediaPlayer2.chromium.*<br />
[4] org.freedesktop.Avahi, org.freedesktop.UPower<br />
<br />
<br />
ID Branch Op Remote Download<br />
1. com.github.Eloston.UngoogledChromium.Codecs stable i flathub < 1.1 MB<br />
2. com.github.Eloston.UngoogledChromium.Locale stable i flathub < 112.8 kB<br />
3. com.github.Eloston.UngoogledChromium stable i flathub < 119.0 MB<br />
<br />
Proceed with these changes to the system installation? [Y/n]:}}<br />
<br />
or if you dont know or dont want to type the exact package name:<br />
<br />
{{cat|$ flatpak install chromium|Looking for matches…<br />
Similar refs found for ‘chromium’ in remote ‘flathub’ (system):<br />
<br />
1) app/net.sourceforge.chromium-bsu/x86_64/stable<br />
2) runtime/com.github.Eloston.UngoogledChromium.Codecs/x86_64/stable<br />
3) runtime/org.chromium.Chromium.Codecs/x86_64/stable<br />
4) app/org.chromium.Chromium/x86_64/stable<br />
5) app/com.github.Eloston.UngoogledChromium/x86_64/stable<br />
<br />
Which do you want to use (0 to abort)? [0-5]:}}<br />
<br />
<br><br />
<br />
==== Remove ====<br />
<br />
To remove a package run: '''flatpak remove <applicationname>'''<br />
<br />
{{cat|$ flatpak remove com.github.Eloston.UngoogledChromium|<br />
<br />
ID Branch Op<br />
1. com.github.Eloston.UngoogledChromium stable r<br />
2. com.github.Eloston.UngoogledChromium.Codecs stable r<br />
3. com.github.Eloston.UngoogledChromium.Locale stable r<br />
<br />
Proceed with these changes to the system installation? [Y/n]:}}<br />
<br />
or if you dont know or dont want to type the exact package name:<br />
<br />
{{cat|$ flatpak remove chromium|Similar installed refs found for ‘chromium’:<br />
<br />
1) app/com.github.Eloston.UngoogledChromium/x86_64/stable (system)<br />
2) runtime/com.github.Eloston.UngoogledChromium.Codecs/x86_64/stable (system)<br />
3) All of the above<br />
<br />
Which do you want to use (0 to abort)? [0-3]:}}<br />
<br />
<br><br />
<br />
= Developers =<br />
<br />
* [https://docs.flatpak.org/en/latest/available-runtimes.html Flatpak - available runtimes]<br />
<br />
These are all hosted on [https://flathub.org/ Flathub.org].<br />
<br />
= Troubleshooting =<br />
<br />
==== Permission errors ====<br />
<br />
If you receive errors about permissions then you may need to add your user to the '''flatpak''' group.<br />
<br />
{{Note|You need to log out and log back in or reboot for the group change(s) to take effect}}<br />
<br />
<br />
<br><br />
<br />
==== Fixing audio issues ====<br />
<br />
If you have a minimal setup and don't have access to audio devices you will need to set the XDG_RUNTIME_DIR variable. Save the following script in /etc/profile.d/xdg_runtime_dir.sh and re-login to have it set up properly.<br />
<br />
if test -z "${XDG_RUNTIME_DIR}"; then<br />
export XDG_RUNTIME_DIR=/tmp/$(id -u)<br />
fi<br />
<br />
When you launch a Flatpak you will need to start pulseaudio as well:<br />
{{Cmd|pulseaudio --start && flatpak run com.example.Example}}<br />
<br />
<br><br />
<br />
= Links =<br />
* [https://flatpak.org/ Flatpak]<br />
* [https://flathub.org/ Flathub]<br />
* [https://winepak.github.io/ Winepak]<br />
<br />
<br><br />
<br />
= See Also = <br />
<br />
<br />
[[Category:Package Manager]]<br />
[[Category: Desktop]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Flatpak&diff=23630Flatpak2023-06-01T03:25:25Z<p>Psykose: remove unneeded flatpak group</p>
<hr />
<div>{{Draft|More documentation and testing is needed, but everything currently here should be safe to follow.}}<br />
<br />
Flatpak is a technology for building and distributing applications with the goal of having a universal package format for all Linux distributons, it is similar to [https://en.wikipedia.org/wiki/Snap_(software) Snap], <br />
<br />
<br />
= Setup / Installation =<br />
<br />
''From: https://flatpak.org/setup/Alpine/''<br />
<br />
{{Note|To install Flatpak you will need to enable the Community repository, See: [[Repositories#Managing_repositories|Repositories - Managing repositories]]}}<br />
<br />
To install Flatpak run:<br />
<br />
{{cmd|# apk add flatpak}}<br />
<br />
Next you need to add a repository, for this guide we will use the recommended repository, [https://flathub.org Flathub].<br />
<br />
{{cmd|flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo}}<br />
<br />
Now reboot to complete setup<br />
<br />
{{Note|graphical installation of Flatpak apps may not be possible with Alpine.}}<br />
<br />
<br><br />
<br />
= Usage =<br />
<br />
To get all of the available options to use with the '''flatpak''' command run: '''flatpak --help''' or '''flatpak -h''',<br />
<br />
<br><br />
<br />
==== Search ====<br />
<br />
To search for applications run '''flatpak search <appplicationname>'''<br />
<br />
Example:<br />
{{cat|flatpak search chromium|Name Description Application ID Version Branch Remotes<br />
Chromium Web Browser The web browser from Chromium project org.chromium.Chromium 96.0.4664.93 stable flathub<br />
Chromium B.S.U. Fast paced, arcade-style, top-scrolling space shooter net.sourceforge.chromium-bsu 0.9.16.1 stable flathub<br />
ungoogled-chromium A lightweight approach to removing Google web service dependency com.github.Eloston.UngoogledChromium 96.0.4664.45 stable flathub}}<br />
<br />
<br><br />
<br />
==== Install ====<br />
<br />
To install a package run '''flatpak install <applicationname>'''<br />
<br />
{{cat|$ flatpak install com.github.Eloston.UngoogledChromium|Looking for matches…<br />
<br />
com.github.Eloston.UngoogledChromium permissions:<br />
ipc network cups pulseaudio wayland x11<br />
devices file access [1] dbus access [2] bus ownership [3] system dbus access [4]<br />
<br />
[1] /run/.heim_org.h5l.kcm-socket, home, xdg-run/pipewire-0<br />
[2] org.freedesktop.FileManager1, org.freedesktop.Notifications, org.freedesktop.secrets, org.gnome.SessionManager<br />
[3] org.mpris.MediaPlayer2.chromium.*<br />
[4] org.freedesktop.Avahi, org.freedesktop.UPower<br />
<br />
<br />
ID Branch Op Remote Download<br />
1. com.github.Eloston.UngoogledChromium.Codecs stable i flathub < 1.1 MB<br />
2. com.github.Eloston.UngoogledChromium.Locale stable i flathub < 112.8 kB<br />
3. com.github.Eloston.UngoogledChromium stable i flathub < 119.0 MB<br />
<br />
Proceed with these changes to the system installation? [Y/n]:}}<br />
<br />
or if you dont know or dont want to type the exact package name:<br />
<br />
{{cat|$ flatpak install chromium|Looking for matches…<br />
Similar refs found for ‘chromium’ in remote ‘flathub’ (system):<br />
<br />
1) app/net.sourceforge.chromium-bsu/x86_64/stable<br />
2) runtime/com.github.Eloston.UngoogledChromium.Codecs/x86_64/stable<br />
3) runtime/org.chromium.Chromium.Codecs/x86_64/stable<br />
4) app/org.chromium.Chromium/x86_64/stable<br />
5) app/com.github.Eloston.UngoogledChromium/x86_64/stable<br />
<br />
Which do you want to use (0 to abort)? [0-5]:}}<br />
<br />
<br><br />
<br />
==== Remove ====<br />
<br />
To remove a package run: '''flatpak remove <applicationname>'''<br />
<br />
{{cat|$ flatpak remove com.github.Eloston.UngoogledChromium|<br />
<br />
ID Branch Op<br />
1. com.github.Eloston.UngoogledChromium stable r<br />
2. com.github.Eloston.UngoogledChromium.Codecs stable r<br />
3. com.github.Eloston.UngoogledChromium.Locale stable r<br />
<br />
Proceed with these changes to the system installation? [Y/n]:}}<br />
<br />
or if you dont know or dont want to type the exact package name:<br />
<br />
{{cat|$ flatpak remove chromium|Similar installed refs found for ‘chromium’:<br />
<br />
1) app/com.github.Eloston.UngoogledChromium/x86_64/stable (system)<br />
2) runtime/com.github.Eloston.UngoogledChromium.Codecs/x86_64/stable (system)<br />
3) All of the above<br />
<br />
Which do you want to use (0 to abort)? [0-3]:}}<br />
<br />
<br><br />
<br />
= Developers =<br />
<br />
* [https://docs.flatpak.org/en/latest/available-runtimes.html Flatpak - available runtimes]<br />
<br />
These are all hosted on [https://flathub.org/ Flathub.org].<br />
<br />
= Troubleshooting =<br />
<br />
==== Permission errors ====<br />
<br />
If you receive errors about permissions then you may need to add your user to the '''flatpak''' group, See step two of [[Flatpak#Setup_/_Installation|Setup / Installation]].<br />
<br />
{{Note|You may need to log out and log back in or reboot for the group change(s) to take effect}}<br />
<br />
<br />
<br><br />
<br />
==== Fixing audio issues ====<br />
<br />
If you have a minimal setup and don't have access to audio devices you will need to set the XDG_RUNTIME_DIR variable. Save the following script in /etc/profile.d/xdg_runtime_dir.sh and re-login to have it set up properly.<br />
<br />
if test -z "${XDG_RUNTIME_DIR}"; then<br />
export XDG_RUNTIME_DIR=/tmp/$(id -u)<br />
fi<br />
<br />
When you launch a Flatpak you will need to start pulseaudio as well:<br />
{{Cmd|pulseaudio --start && flatpak run com.example.Example}}<br />
<br />
<br><br />
<br />
= Links =<br />
* [https://flatpak.org/ Flatpak]<br />
* [https://flathub.org/ Flathub]<br />
* [https://winepak.github.io/ Winepak]<br />
<br />
<br><br />
<br />
= See Also = <br />
<br />
<br />
[[Category:Package Manager]]<br />
[[Category: Desktop]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Installation&diff=23512Installation2023-05-23T12:59:35Z<p>Psykose: rv to old</p>
<hr />
<div><br />
[[Image:hdd_mount.png|left|link=]]<br />
<br /><br />
<br />
<br />
<br />
<br />
This page exists to provide the basic overview to get started. But before actually installing, it can also help to skim through the [[Alpine_Linux:FAQ| Frequenty Asked Questions (FAQ)]], as well as to refer to the official installation guide at [https://docs.alpinelinux.org/ docs.alpinelinux.org].<br />
<br />
{{Tip|This is a wiki!<br />
If something isn't correct (anymore), or still incomplete, you will have to try figuring it out, or ask for the correct solution in the [https://alpinelinux.org/community/ community].<br />
<br />
And then carefully edit the wiki page.<br />
<br />
Just as those before you did it for you.<br />
}}<br />
<br />
<br />
== Minimal Hardware Requirements ==<br />
<br />
* At least 100 MB of RAM. [A graphical desktop system may require up to 1 GB minimum.]<br />
* At least 0-700 MB space on a writable storage device. [Only required in "sys" or "data" mode installations (explained below). It is optional in "diskless" mode, where it may be used to save newer data and configurations states of a running system.]<br />
<br />
For more information please check [[Requirements]]<br />
<br />
== Installation Overview ==<br />
<br />
=== The general course of action ===<br />
{{Note|<br />
* For single-board-computer (SBC) architectures which can not boot .iso images, see [[Alpine_on_ARM|Alpine on ARM]] for peculiarities.<br />
* For headless system, initial network setup may be fed by pre-built <code>apkovl</code> overlay file, custom-made or via [https://github.com/macmpi/alpine-linux-headless-bootstrap/ 3rd party]}}<br />
<br />
As usual, starting an installation procedure requires some basic steps (additional details for all the steps follow [[Installation#Basic Installation Step Details|below]]):<br><br />
<br />
# Downloading and verifying the proper [https://alpinelinux.org/downloads/ stable-release ISO installation image-file] for the target computer's architecture with their corresponding <code>sha256</code> (checksum) and <code>GPG</code> (signature) files. <br />
# Either burning the ISO image-file onto a blank CD/DVD/Bluproper-ray disk with disk burning software, or flashing the installation image onto a bootable storage device (USB-device, CF-/MMC-/SD-card, floppy, ...).<br />
# Optionally, custom-made headless apkovl can be done by first booting the install media on some computer with a display and keyboard attached, or in a virtual machine, and doing an intermediate "diskless" setup of just the boot media (more details below), i.e. using the offical <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> to configure the system's network, possibly for dhcp if needed, a ssh server, and a login user. Choosing "disks=none" for now, yet, configure to store configs on the boot media (if it is writable, otherwise on a separate storage media). And afterwards calling <code>[[Alpine_local_backup|lbu commit]]</code> to store the configs as local backup. Then your completed setup, including its securely created own private keys, will readily get (re)loaded on every subsequent (headless) boot from your custom-build <code><hostname>.apkovl.tar.gz</code> stored on the boot media (or on an auxilary media or server location, in case the boot media is read-only).<br />
# Booting the target computer from the prepared disk or storage device.<br />
<br />
The boot process of the alpine installation image first copies the entire operating system into the RAM memory, and then already starts a complete Alpine Linux system from there. It will initially only provide a basic command line environment that does not depend on reading from any (possibly slow) initial boot media, anymore.<br />
<br />
Local log-in is possible as the user <code>root</code>. Initially, the root user has no password.<br />
<br />
At the command prompt, an interactive script named <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> is available to configure and install the initial Alpine Linux system.<br />
<br />
The question-and-answer dialog of <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> takes care of the base configuration and allows to configure the system to boot into one of three different '''Alpine Linux "disk" modes''': '''"diskless"'''(none), '''"data"''', or '''"sys"'''.<br />
<br />
These modes are explained in more detail in the following subsections.<br />
<br />
{{Note|It is really helpful for many cases that it is possible to first only complete a basic setup of the initial "diskless" installation media in order to prepare for the installation of the target system. For example, also to download and install some specific driver or software tool. And to possibly use more specific [[Alpine_setup_scripts|setup-scripts]] afterwards in order to proceed with the final installation in a custom way. A most basic pre-setup of just the "diskless" system may be completed by running <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> and answering "none" when asked for the disk to use, for where to store configs, and for the location of the package cache.<br />
<br />
Examples of preparation options:<br />
<br />
* Preparing a custom partitioning or filesystem scheme that avoids to use and/or overwrite an entire disk ([[Installation#Custom_partitioning_of_the_harddisk|details below]]).<br />
* Installing something that may be missing in the live system to configure the hardware, e.g. by using the alpine package manager <code>[[Alpine_Package_Keeper|apk]]</code>.<br />
<br />
Examples of proceeding options:<br />
<br />
* <code>[[Alpine_setup_scripts#setup-lbu|setup-lbu]]</code> to configure a "local backup" location for the diskless system, and <code>[[Alpine_local_backup|lbu commit]]</code> to then save the local configuration state.<br />
* <code>[[Alpine_setup_scripts#setup-apkcache|setup-apkcache]]</code> to configure a local package cache storage location.<br />
* <code>[[Alpine_setup_scripts#setup-disk|setup-disk]]</code> to add a "data" mode partition, or do a classic full install of the "diskless" system onto a "sys" disk or partition.<br />
<br />
There are many more [[Alpine_setup_scripts|setup-scripts]] available. All these tools may also be run later to adjust specific configurations. For example, to set up a graphical environment as covered under [[Installation#Post-Installation|Post-Installation]] below.<br />
}}<br />
<br />
==='''Diskless Mode'''=== <br />
This means the entire operating system with all applications are first loaded into RAM and then only run from there. This is the method already used to boot the .iso installation images, however <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> can also configure the installed system to continue to boot like this if "disk=none" is specified. The mode is extremely fast and can save on unnecessary disk spin-ups, power, and wear. It is similar to what other linux distributions may call a "frugal" install or boot into with a "toram" option. <br />
<br />
Custom configurations and package installations may optionally still be preserved or "persist" across reboots by using the Alpine local backup tool <code>[[Alpine_local_backup|lbu]]</code>. It enables committing and reverting system states by using .apkovl files that are saved to writable storage and loaded when booting. If additional or updated packages have been added to the system, these may also be made available for automatic (re)installation during the boot phase without any (re)downloading, by enabling a [[Alpine_Package_Keeper#Local_Cache|local package cache]] on the writable storage.<br />
<br />
[[https://gitlab.alpinelinux.org/alpine/alpine-conf/-/issues/10473 FIXME-1]: Storing local configs and the package cache on '''internal disks still require''' [[Alpine_local_backup#Saving_and_loading_ISO_image_customizations|some manual steps]] to have the partition listed, i.e. making a /etc/fstab entry, mountpoint, and mount, *before* running setup-alpine. The linked workaround also still requires to commit these configurations to disk manually before rebooting.]<br />
<br />
If a writable partition is available, <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> can be told to store the configs and the package cache on that writable partition. (Later, another directory on that same partition or another available partition may also be mounted as /home, or for example, for selected important applications to keep their run-time and user data on it.)<br />
<br />
The boot device of the newly configured local "diskless" system may remain the initial (and possibly read-only) installation media. But it is also possible to copy the boot system to a partition (e.g. /dev/sdXY) with <code>[[Alpine_setup_scripts#setup-bootable|setup-bootable]]</code>.<br />
<br />
==='''Data Disk Mode'''=== <br />
This mode also runs from system RAM, thus it enjoys the same accelerated operation speed as "diskless" mode. However, swap storage and the entire {{Path|/var}} directory tree get mounted from a persistent storage device (two newly created partitions). The directory {{Path|/var}} holds e.g. all log files, mailspools, databases, etc., as well as <code>[[Alpine_local_backup|lbu]]</code> backup commits and the package cache. This mode is useful for having RAM accelerated servers with variable amounts of user-data that exceed the available RAM size. It enables the entire current system state (not just the boot state) to survive a system crash in accordance with the particular filesystem guarantees. <br />
<br />
[[https://gitlab.alpinelinux.org/alpine/alpine-conf/-/issues/10474 FIXME-2]]: Setup-alpine will create the data partition and mount it as /var, but '''setup-alpine's "data" disk mode can not yet configure lbu config storage settings automatically'''. The '''current workaround''', is to select "none" at the 'where to store configs' prompt (as the new data partition is not listed anyway) and configure lbu manually after <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> exits, and before rebooting:<br />
<br />
# Identify the created data partition, e.g. <code>/dev/sd''XY''</code>, and its filesystemtype, e.g. using <code>''lsblk''</code><br />
# Manually edit the lbu backups location in <code>/etc/lbu/lbu.conf</code> and configure <code>LBU_MEDIA=sd''XY''</code> (according to the previous findings).<br />
# Save the configuration on that partition for the next boot with <code>lbu commit</code>.<br />
# If (a new) partition fails to get mounted, execute: <code>mkdir /media/''sdXY'' ; echo "/dev/sd''XY'' /media/sd''XY'' ''fstype'' noauto,rw 0 0" >> /etc/fstab</code>, and try <code>lbu commit</code> again.<br />
<br />
In data disk mode, the boot device may also remain the initial (and possibly read-only) installation media, or be copied to a partition (e.g. /dev/sdXY) with <code>[[Alpine_setup_scripts#setup-bootable|setup-bootable]]</code>.<br />
<br />
==='''System Disk Mode'''=== <br />
This is a traditional hard-disk install.<br />
<br />
If this mode is selected, the <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> script creates three partitions on the selected storage device, {{Path|/boot}}, {{Path|swap}} and {{Path|/}} (the filesystem root). This mode may, for example, be used for generic [[:Category:Desktop|desktop]] and development machines.<br />
<br />
For custom partitioning, see [[Setting up disks manually]].<br />
<br />
To install along side another operating systems, see [[Dualbooting]].<br />
<br />
== Basic Installation Step Details ==<br />
<br />
{{Expand| }}<br />
<br />
This "Additional Details" section needs to be consolidated with the work at '''[https://docs.alpinelinux.org https://docs.alpinelinux.org] (not finished)''' <br />
(Restructuring things there, moving and linking from here or there?). <br />
<br />
<br />
=== Verifying the downloaded image-file ===<br />
<br />
{| class="wikitable" style="width:95%; align=center"<br />
|+ Commands to verify the checksum and GPG signature of a downloaded image-file on different systems.<br />
|-<br />
! width=100px | OS type<br />
! <code>SHA256</code> check !! <code>SHA256</code> calculation (to be compared manually) !! <code>GPG</code> signature verification<br />
|-<br />
! Linux<br />
| <code>sha256sum -c alpine-*.iso.sha256</code> || || <code>curl https://alpinelinux.org/keys/ncopa.asc &#124; gpg --import ;</code><br />
<code> gpg --verify alpine-<version>.iso.asc alpine-<version>.iso</code><br />
|-<br />
! MACOS <br />
| - ? - || <code>shasum -a 256 alpine-*.iso</code> || - ? -<br />
|-<br />
! OpenBSD <br />
| <code>sha256 -C alpine-*.sha256 alpine-*.iso</code> || || <code>doas pkg_add gnupg;<br />
ftp -o - https://alpinelinux.org/keys/ncopa.asc &#124; gpg --import ;<br />
gpg --verify alpine-<version>.iso.asc alpine-<version>.iso</code><br />
|-<br />
! FreeBSD <br />
| - ? - || <code>/usr/local/bin/shasum -a 256 alpine-*.iso</code> || - ? -<br />
|-<br />
! NetBSD <br />
| - ? - || <code>/usr/local/bin/shasum -a 256 alpine-*.iso</code> || - ? -<br />
|-<br />
! Windows (PowerShell installed)<br />
| - ? - || <code>Get-FileHash .\alpine-<image-version>.iso -Algorithm SHA256</code> || - ? -<br />
|}<br />
<br />
=== Flashing (direct data writing) the installation image-file onto a device or media ===<br />
<br />
==== Unix/Linux ====<br />
<br />
Under Unix (and thus Linux), "everything is a file" and the data in the image-file can be written to a device or media with the <code>dd</code> command. Afterward, executing the <code>eject</code> command removes the target device from the system and ensures the write cache is completely flushed.<br />
<br />
dd if=<iso-file-to-read-in> of=<target-device-node-to-write-out-to> bs=4M oflag=sync status=progress; eject <target-device-node-to-write-to><br />
<br />
Be careful to correctly identify the target device as any data on it '''will''' be lost! All connected "bulk storage devices" can be listed with <code><nowiki>lsblk</nowiki></code> and <code><nowiki>blkid</nowiki></code>.<br />
<br />
# lsblk<br />
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT<br />
sdX 0:0 0 64,0G 0 disk <br />
├─sdX1 0:1 0 2G 0 part <br />
└─sdX2 0:2 0 30G 0 part /mnt/sdX2<br />
<br />
# blkid<br />
/dev/sdX1: LABEL="some" UUID="..." TYPE="vfat"<br />
/dev/sdX2: LABEL="other" UUID="..." TYPE="ext4"<br />
<br />
For example, if /dev/sdX is the desired target device, first make sure you un-mount all mounted partitions of the target device. For example sdX1 and sdX2:<br />
<br />
umount /dev/sdX1 /dev/sdX2<br />
<br />
<br />
For <code>dd</code>'s output-file (<code>of=</code>), however, do '''not''' specify a partition number. For example, write to sdX, '''not''' sdX1:<br />
<br />
Warning: '''This will overwrite the target device /dev/sdX''', so before executing, make sure you have a backup of the data if you can't afford to lose it.<br />
<br />
dd if=~/Downloads/alpine-standard-3.00.0-x86_64.iso of=/dev/sdX bs=4M oflag=sync status=progress; eject /dev/sdX<br />
<br />
==== Windows ====<br />
<br />
For example, there is the [https://rufus.ie/ Rufus] program. Rufus will enable you to create bootable USB flash drives under Windows. <br />
<br />
Rufus has been tested and works for Alpine Linux 3.12.x with the following settings:<br />
* '''Partition scheme''': <code>MBR</code><br />
* '''Target system''': <code>BIOS or UEFI</code><br />
* '''File system''': <code>FAT32</code><br />
* '''Cluster size''': <code>4096 bytes (default)</code><br />
<br />
=== Verifying the written installation media ===<br />
<br />
After detaching and re-attaching the device, a bit-wise comparison can verify the data written to the device (instead of just data buffered in RAM). If the comparison terminates with an end-of-file error on the .iso file side, all the contents from the image have been written (and re-read) successfully:<br />
<br />
# cmp ~/Downloads/alpine-standard-3.00.0-x86_64.iso /dev/sdX<br />
cmp: EOF on alpine-standard-3.00.0-x86_64.iso<br />
<br />
=== Booting from external devices ===<br />
<br />
Insert the boot media to a proper drive or port of the computer and turn the machine on, or restart it, if already running.<br />
<br />
If the computer does not automatically boot from the desired device, one needs to bring up the boot menu and choose the media to boot from. Depending on the computer, the menu may be accessed by repeatedly pressing a key quickly when booting starts. Some computers require that you press the button ''before'' starting the computer and hold it down while the computer boots. Typical keys are: `F9`-`F12`, sometimes `F7` or `F8`. If these don't bring up the boot menu, it may be necessary to enter the BIOS configuration and adjust the boot settings, for which typical keys are: `Del.` `F1` `F2` `F6` or `Esc.`<br />
<br />
=== Custom partitioning of the harddisk ===<br />
<br />
It is possible to specify configurations for RAID, encryption, LVM, etc. as well as manual partitioning.<br />
<br />
For "diskless" or "data disk" mode installs, manual partitioning may be needed to prepare the harddisk for committing local backups of the system state with <code>[[Alpine_local_backup|lbu commit]]</code>, to have a place for a package cache, or to use it for a /var mount. <br />
<br />
For a "sys" install, custom partitioning is needed only if the desired scheme differs from overwriting an entire disk, or using the default set of a /boot, swap and root partition on the disk.<br />
<br />
See [[Setting up disks manually]] for the alpine options for RAID, encryption, LVM, etc. and manual partitioning.<br />
<br />
=== Questions asked by <code>setup-alpine</code> ===<br />
[[File:Installation-alpine-alpine-setup-3-setup-scripts.png|350px|thumb|right|Example <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> session]]<br />
<br />
The <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> script offers the following configuration options:<br />
<br />
* '''Keyboard Layout''' (Local keyboard language and usage mode, e.g. ''us'' and variant of ''us-nodeadkeys''.)<br />
* '''Hostname''' (The name for the computer.)<br />
* '''Network''' (For example, automatic IP address discovery with the "DHCP" protocol.)<br />
* '''DNS Servers''' (Domain Name Servers to query. For privacy reasons it is NOT recommended to route every local request to servers like google's <s>8.8.8.8</s> .)<br />
* '''Timezone'''<br />
* '''Proxy''' (Proxy server to use for accessing the web. Use "none" for direct connections to the internet.)<br />
* '''Mirror''' (From where to download packages. Choose the organization you trust giving your usage patterns to.)<br />
* '''SSH''' (Secure SHell remote access server. "Openssh" is part of the default install image. Use "none" to disable remote login, e.g. on laptops.)<br />
* '''NTP''' (Network Time Protocol client used for keeping the system clock in sync with a time server. Package "chrony" is part of the default install image.)<br />
* '''Disk Mode''' (Select between diskless (disk="none"), "data" or "sys", as described above.) <br />
{{Warning|The data on a chosen device will be overwritten!}}<br />
<br />
=== Preparing for the first boot ===<br />
<br />
If <code>[[Alpine_setup_scripts#setup-alpine|setup-alpine]]</code> has finished configuring the "sys" disk mode, the system should be ready to reboot right away (see next subsection).<br />
<br />
If the new local system was configured to run in "diskless" or "data" mode, and you do not want keep booting from the initial (and possibly read-only) installation media, the boot system needs to be copied to another device or partition.<br />
<br />
The target partition may be identified using <code><nowiki>lsblk</nowiki></code> (after installing it with <code>apk add lsblk</code>) and/or <code>blkid</code>, similar to previously identifying the initial installation media device.<br />
<br />
The procedure to copy the boot system is explained at <code>[[Alpine_setup_scripts#setup-bootable|setup-bootable]]</code><br />
<br />
Once everything is in place, save your customized configuration with <code>lbu commit</code> before rebooting.<br />
<br />
=== Rebooting and testing the new system ===<br />
<br />
First, remove the initial installation media from the boot drive, or detach it from the port it's connected to.<br />
<br />
The system may now be power-cycled or rebooted to confirm everything is working correctly.<br />
<br />
The relevant commands for this are <code>poweroff</code> or <code>reboot</code>.<br />
<br />
=== Completing the installation ===<br />
<br />
The installation script installs only the base operating system. '''No''' applications e.g. web server, mail server, desktop environment, or web browsers are installed.<br />
<br />
Please look under [[Installation#Post-Installation|Post-Installation]] below, for some common things to do after installation.<br />
<br />
= Further Installation Instructions =<br />
<br />
{{Note| Specific topics should be kept on separate, individually manageable topic-pages and only get listed with a direct reference (link) on this general page.}}<br />
<br />
=== Installation ===<br />
<br />
* [[Kernels]] ''(kernel selection, e.g. for VMs or RPi)''<br />
* [[How to make a custom ISO image with mkimage]] ''(installation media with its own configuration)''<br />
* [[Directly booting an ISO file]] ''(without flashing it to a disk or device)''<br />
* [[Dualbooting|Dual/multi-boot install to HDD partition]]<br />
* [[Netboot Alpine Linux using iPXE]]<br />
Also see other [[:Category:Installation|Installation Category]] pages.<br />
<br />
=== Post-Installation ===<br />
<br />
<!-- COMMENT FOR EDITORS<br />
<br />
If you edit Post-Install,<br />
<br />
* Consider that there are already [[Tutorials_and_Howtos#Post-Install]], [[Developer_Documentation#Package_management]] and the Handbook, please work towards reducing duplication and providing an overview, and maintaining topic details of considerable size on their own pages.<br />
* Here, only the most relevant jumping off points are listed, not exact list duplicates!!!<br />
* Keep short-list of links here, as overview to more detailed topic specific pages.<br />
* Don't aggregate different topics at yet another place.<br />
<br />
--><br />
<br />
<br />
<br />
* [[Setting up a new user]] ''(to allow remote, console, or graphical logins)''<br />
* [[Tutorials_and_Howtos#Networking_2|Setting up Networking]] ''(including non-standard configurations)''<br />
* [[Alpine_Package_Keeper|Package Management (apk)]] ''(how to search/add/del packages etc.)''<br />
** [[Alpine_Package_Keeper#Upgrade_a_Running_System|Upgrading Alpine]] ''(checking for and installing updates)''<br />
** [[Repositories#Managing_repositories|Enable the community repository]] ''(access to additional packages)''<br />
* [[Alpine_Linux:FAQ#Why_don.27t_I_have_man_pages_or_where_is_the_.27man.27_command.3F|man command/man pages]]<br />
* [[Change default shell]]<br />
* [[Running glibc programs]] ''(installation and development)''<br />
<br><br />
<br />
* [[Alpine_local_backup|Local backup utility <code>lbu</code>]] ''(persisting RAM system configurations)''<br />
** [[Back Up a Flash Memory Installation]] ''("diskless mode" systems)''<br />
** [[Manually_editing_a_existing_apkovl]] ''(the stored custom configs)''<br />
<br><br />
<br />
* [[OpenRC|Init System (OpenRC)]] ''(configure a service to automatically boot at next reboot)''<br />
** [[Writing Init Scripts]]<br />
** [[Multiple Instances of Services]]<br />
<br><br />
<br />
* [[Alpine setup scripts#setup-xorg-base|<code>setup-xorg-base</code>]] ''(setup graphical base environment)''<br />
** [[Tutorials_and_Howtos#Desktop|Desktop Environments]]<br />
<br><br />
<br />
* [[Hosting services on Alpine]] ''(links to several mail/web/ssh server setup pages)''<br />
<br><br />
<br />
* [[How to get regular stuff working]] ''(things one may miss in a too lightweight installation )''<br />
* Running applications and services in their own [[Firejail Security Sandbox]]<br />
<br />
=== Broader Usage Guides ===<br />
<br />
* See: [[Tutorials and Howtos]]<br />
<br />
= General Documentation =<br />
<br />
{{Tip| Alpine Linux packages stay close to the upstream design. Therefore, all upstream documentation about configuring a software package, as well as good configuration guides from other distributions that stay close to upstream, e.g. those in the [https://wiki.archlinux.org/ ArchWiki], are to a large degree, also applicable to configuring the software on Alpine Linux, thus can be very useful.}}<br />
<br />
* [[Alpine_Linux:FAQ|FAQs]]<br />
* [[Alpine_Linux:Contribute|How to Contribute]]<br />
* [[:Category_talk:Developer_Documentation|Developer Documentation]]<br />
* [[Alpine_Linux:Wiki_etiquette|Wiki etiquette]] ''(to collaborate on this documentation)''<br />
* [[Comparison with other distros]] ''(how common things are done on Alpine)''<br />
<br />
----<br />
[[Category:Installation]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Release_Notes_for_Alpine_3.18.0&diff=23465Release Notes for Alpine 3.18.02023-05-17T12:15:05Z<p>Psykose: chromium suid</p>
<hr />
<div>== Base System ==<br />
<br />
=== Linux Kernel ===<br />
<br />
{{pkg|linux-lts}} was updated from 5.15 to 6.1. [https://lkml.org/lkml/2022/12/11/206 release notes]<br />
<br />
Kernel modules are now signed.<br />
<br />
''Note: {{pkg|akms}} (Alpine Kernel Module Support) doesn't support modules signing yet, it will be implemented later.''<br />
<br />
=== musl 1.2.4 ===<br />
<br />
Support for DNS lookups over TCP. [https://www.openwall.com/lists/musl/2023/05/02/1 release notes]<br />
<br />
=== DT_RELR ===<br />
<br />
on x86, x86_64, and ppc64le, <code>-Wl,-z,pack-relative-relocs</code> is now added to the base LDFLAGS. this reduces elf (executable/shared-library) size by 10% on average. <br />
<br />
however, these binaries are now not portable to other musl-based systems that have a musl older than 1.2.4, because older versions are incapable of loading these binaries.<br />
<br />
=== OpenSSL 3.1 ===<br />
<br />
[https://www.openssl.org/news/openssl-3.1-notes.html release notes]<br />
<br />
=== Experimental headless installer ===<br />
<br />
Support for head-less installs with [https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud tiny-cloud] was added. This is done via a volume with label <code>cidata</code>, similar to cloud-init's [https://cloudinit.readthedocs.io/en/latest/reference/datasources/nocloud.html NoCloud] provider. If this volume is found during boot, the network will be auto configured and provided, a default user named <code>alpine</code> will be created and ssh keys provided in meta-data will be added. This is experimental and may change without prior notice.<br />
<br />
=== e2fsprogs 1.47.0 ===<br />
<br />
The {{pkg|e2fsprogs}} package shipped with Alpine 3.18 changed the behaviour of <code>mke2fs</code> so that newly created filesystems have two additional features enabled.<br />
<br />
From [https://e2fsprogs.sourceforge.net/e2fsprogs-release.html#1.47.0 release notes]:<br />
<br />
<blockquote>The mke2fs program (via the mke2fs.conf file) now enables the metadata_csum_seed and orphan_file features by default.</blockquote><br />
<br />
However, whilst the <code>metadata_csum_seed</code> feature is known about by older versions of e2fsck the <code>orphan_file</code> feature was both added to e2fsprogs 1.47.0 '''and''' enabled at the same time. Therefore older versions of e2fsck are unable to fsck a filesystem created by mke2fs 1.47.0.<br />
<br />
== Compilers and Runtimes ==<br />
<br />
<!-- stuff in main --><br />
=== LLVM 16 ===<br />
<br />
{{pkg|llvm16}} was added. [https://releases.llvm.org/16.0.0/docs/ReleaseNotes.html release notes]<br />
<br />
=== Lua ===<br />
<br />
{{pkg|luarocks}}, the package manager for Lua, was updated from 2.x to 3x. [https://github.com/luarocks/luarocks/blob/master/CHANGELOG.md#whats-new-in-luarocks-300 release notes]<br />
<br />
=== Python ===<br />
<br />
{{pkg|python3}} was updated from 3.10 to 3.11. [https://docs.python.org/3/whatsnew/3.11.html release notes]<br />
<br />
==== splitting of python pycache .pyc files ====<br />
<br />
Most python modules split their <code>__pycache__</code> to a <code>-pyc</code> subpackage, pulled by default. To save space and not pull it (incurring python interpreter startup costs, as it generates it each run), run <code>apk add !python3-pyc</code><br />
<br />
=== Ruby 3.2 ===<br />
<br />
{{pkg|ruby}} was updated from 3.1 to 3.2. [https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/ release notes]<br />
<br />
<br />
<!-- community --><br />
<br />
=== Crystal 1.8 ===<br />
<br />
{{pkg|crystal}} was updated from 1.6 to 1.8. [https://crystal-lang.org/2023/01/09/1.7.0-released/ release notes for 1.7], [https://crystal-lang.org/2023/04/14/1.8.0-released/ release notes for 1.8]<br />
<br />
=== Go 1.20 ===<br />
<br />
{{pkg|go}} [https://go.dev/blog/go1.20 release notes]<br />
<br />
=== PHP 8.2 ===<br />
<br />
Added 8.2 packages with a subset of the most common extensions. Version 8.1 still remains the primary provider priority, but some web applications started to use 8.2.<br />
<br />
=== R 4.3 ===<br />
<br />
{{pkg|R}} was updated from 4.2 to 4.3. [https://www.r-bloggers.com/2023/04/whats-new-in-r-4-3-0/ release notes]<br />
<br />
=== Rust 1.69 ===<br />
<br />
{{pkg|rust}} was updated from 1.64 to 1.69.<br />
<br />
== Desktop ==<br />
<br />
=== gdk-pixbuf-loaders ===<br />
<br />
A few gdk-pixbuf loaders were added, and they were all added to an <code>install_if</code> metapackage rule. Run <code>apk add gdk-pixbuf-loaders</code> to enable the loaders for the corresponding image libraries you have installed.<br />
<br />
=== GNOME 44 ===<br />
<br />
[https://release.gnome.org/44/ release notes]<br />
<br />
The {{pkg|gnome}} metapackage was reworked and the packages {{pkg|gnome-apps-extra}} and {{pkg|gnome-games-collection}} were removed to avoid opinionated lists in metapackages. It is advised to remove those from <code>/etc/apk/world</code> before performing the upgrade. Additionally, the new subpackage {{pkg|gnome-dev-tools}} was added following the upstream's recommendations.<br />
<br />
On related news, to make use of GNOME Software, it is necessary to enable the <code>apk-polkit-server</code> openrc service. More info in the [https://wiki.alpinelinux.org/wiki/Gnome#Enabling_GNOME_Software wiki]<br />
<br />
=== Plasma 5.27 ===<br />
<br />
{{pkg|plasma}} was updated from 5.26 to 5.27. This includes some new packages like {{pkg|plasma-welcome}} (a welcoming application that shows up on the first boot to configure some initial settings) and {{pkg|flatpak-kcm}} (a configuration page for the system settings to control Flatpak permissions, much like GNOME's Flatseal).<br />
This Plasma release is the last one that will be built on Qt5 and will probably remain in use for Alpine 3.19 as well.<br />
<br />
=== Sway 1.8 ===<br />
<br />
{{pkg|sway}} was updated from 1.7 to 1.8. [https://github.com/swaywm/sway/releases/tag/1.8 release notes]<br />
<br />
== Others ==<br />
<br />
=== dbus ===<br />
<br />
dbus-activation has been removed from packages {{pkg|openrc-settingsd}} and {{pkg|apk-polkit-rs}}. To make use of their services, make sure to start and enable the <code>openrc-settingsd</code> and <code>apk-polkit-server</code> services, respectively.<br />
<br />
=== nginx 1.24 ===<br />
<br />
{{pkg|nginx}} was updated to the new stable branch 1.24.x. [https://nginx.org/en/CHANGES-1.24 release notes]<br />
<br />
=== Removal of pipewire-media-session ===<br />
<br />
{{pkg|pipewire-media-session}} was removed, as upstream explicitly recommends not to use it, and it's completely superceded by wireplumber.<br />
if you used it, make sure you don't have {{pkg|pipewire-media-session}} in <code>/etc/apk/world</code>, and configure any scripts you might've had to launch <code>wireplumber</code> instead.<br />
<br />
=== QEMU 8 ===<br />
<br />
QEMU was updated from 7.1 to 8.0. [https://www.qemu.org/2023/04/20/qemu-8-0-0/ release notes]<br />
<br />
=== Docker 23 ===<br />
<br />
The {{pkg|docker}} package shipped with Alpine 3.18 has a dependency on {{pkg|docker-cli-buildx}}, as Docker 23 now uses it for builds.<br />
<br />
Also, Docker 23 no longer enables the <code>overlay</code> storage driver, as it has been deprecated for a long time and is nearing removal. if your deployment is still configured to use it, <code>dockerd</code> will fail to start. To fix this, either...<br />
<br />
* migrate to <code>overlay2</code> in <code>/etc/docker/daemon.json</code><br />
* hardcode it to <code>overlay</code> in the same file (instead of blank), though this will eventually break in a future upgrade<br />
<br />
For more detailed information about Docker 23, please refer to the [https://docs.docker.com/engine/release-notes/23.0/ release notes].<br />
<br />
=== AWS CLI v2 ===<br />
<br />
The {{pkg|aws-cli}} package has been upgraded from v1 to v2 which results in changed behaviour in how certain commands behave.<br />
<br />
Please follow [https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html this guide] for migrating between versions.<br />
<br />
=== ppp 2.5.0 ===<br />
<br />
pppd (<code>ppp-daemon</code>, <code>ppp-pppoe</code>, ..) was updated to 2.5. in 2.4.9, the <code>rp-pppoe.so</code> plugin was renamed to <code>pppoe.so</code> <br />
<br />
if you have <code>plugin rp-pppoe.so ...</code> configuration lines, you should update them accordingly.<br />
<br />
=== 7-zip ===<br />
<br />
<code>p7zip</code> was removed in favor of the linux port of 7-zip. they both provide the <code>7z</code> command, so nothing should be affected in usage.<br />
<br />
=== chromium non-suid ===<br />
<br />
chromium is no longer SUID by default, so the sandbox uses user namespaces instead. this makes it not work inside containers- you'll have to <code>chmod 4755 /usr/lib/chromium/chrome-sandbox</code> yourself to make it work.</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=ZoneMinder_video_camera_security_and_surveillance&diff=23419ZoneMinder video camera security and surveillance2023-05-13T19:42:58Z<p>Psykose: typo</p>
<hr />
<div>[https://www.zoneminder.com/ ZoneMinder] usually runs with [[Apache]], but in this short how-to we use [[Lighttpd]].<br />
<br />
<br />
==Base Install==<br />
<br />
ZoneMinder is found in the community repositories, please enable it by following the instructions [[Repositories#Enabling_the_community_repository|here]]<br />
<br />
Then, add the needed packages to our system<br />
<br />
apk add zoneminder mariadb mysql-client lighttpd php8-fpm php8-pdo php8-pdo_mysql<br />
<br />
''Note: In Alpine 3.17, php 8.1 replaces php8.0''<br />
<br />
apk add zoneminder mariadb mysql-client lighttpd php81-fpm php81-pdo php81-pdo_mysql<br />
<br />
===Database===<br />
<br />
Initialize [https://www.mysql.com/ MySQL] database<br />
<br />
/etc/init.d/mariadb setup<br />
<br />
Start the database<br />
<br />
/etc/init.d/mariadb start<br />
<br />
Set root password for MySQL as instructed by MySQL setup<br />
<br />
/usr/bin/mysqladmin -u root password 'your_secure_root_mysql_password'<br />
<br />
You can log into MySQL as current root user with<br />
mysql<br />
<br />
Create a ZoneMinder MySQL database and user<br />
<br />
mysql> create database zm;<br />
<br />
mysql> CREATE USER zmuser@localhost IDENTIFIED BY 'your_zm_password_as_set_in_config';<br />
<br />
mysql> grant ALL on zm.* to zmuser@localhost;<br />
<br />
===Web Server===<br />
<br />
We are running <code>lighttpd</code>, so let's run <code>php-fpm</code> as lighttpd user/group<br />
<br />
vi /etc/php8/php-fpm.conf<br />
<br />
''Note: for php 8.1''<br />
<br />
vi /etc/php81/php-fpm.conf<br />
<br />
Add this section to the bottom of the file:<br />
<br />
; Unix user/group of processes<br />
; Note: The user is mandatory. If the group is not set, the default user's group<br />
; will be used.<br />
;user = nobody<br />
;group = nobody<br />
user = lighttpd<br />
group = lighttpd<br />
<br />
Enable the php cgi fpm config in <code>lighttpd.conf</code><br />
<br />
vi /etc/lighttpd/lighttpd.conf<br />
<br />
Go down to the server modules section and uncomment <code>mod_alias</code>, which is needed for the cgi-bin, and <code>mod_rewrite</code>, for the api. It should look like:<br />
<br />
# {{{ modules<br />
# At the very least, mod_access and mod_accesslog should be enabled.<br />
# All other modules should only be loaded if necessary.<br />
# NOTE: the order of modules is important.<br />
server.modules = (<br />
"mod_rewrite",<br />
# "mod_redirect",<br />
"mod_alias",<br />
"mod_access",<br />
# "mod_cml",<br />
# "mod_trigger_b4_dl",<br />
# "mod_auth",<br />
# "mod_status",<br />
# "mod_setenv",<br />
# "mod_proxy",<br />
# "mod_simple_vhost",<br />
# "mod_evhost",<br />
# "mod_userdir",<br />
# "mod_deflate",<br />
# "mod_ssi",<br />
# "mod_usertrack",<br />
# "mod_expire",<br />
# "mod_secdownload",<br />
# "mod_rrdtool",<br />
# "mod_webdav",<br />
"mod_accesslog"<br />
)<br />
# }}}<br />
<br />
Go down to the includes section, it should look like:<br />
# {{{ includes<br />
include "mime-types.conf"<br />
# uncomment for cgi support<br />
include "mod_cgi.conf"<br />
# uncomment for php/fastcgi support<br />
# include "mod_fastcgi.conf"<br />
# uncomment for php/fastcgi fpm support<br />
include "mod_fastcgi_fpm.conf"<br />
<br />
# }}}<br />
<br />
In order for video streaming to work in 1.36, you'll need the following<br />
added to /etc/lighttpd/lighttpd.conf:<br />
server.stream-response-body = 1<br />
<br />
In lighttpd.conf for the API, we will want to redirect any api+ requests to cakephp. Thus, add:<br />
url.rewrite = (<br />
"^/zm/api(.+)$" => "/zm/api/index.php"<br />
)<br />
<br />
<br />
<br />
Edit lighttpd cgi config and add old style cgi support by adding to cgi.assign<br />
<br />
vi /etc/lighttpd/mod_cgi.conf<br />
<br />
which should look like<br />
<br />
cgi.assign = (<br />
"" => "",<br />
".pl" => "/usr/bin/perl",<br />
".cgi" => "/usr/bin/perl"<br />
)<br />
<br />
Also add the following to alias.url in mod_cgi.conf so that it looks like<br />
<br />
alias.url = (<br />
"/cgi-bin/" => var.basedir + "/cgi-bin/",<br />
"/zm/api" => "/usr/share/webapps/zoneminder/htdocs/api/app/webroot/",<br />
"/zm/" => "/usr/share/webapps/zoneminder/htdocs/"<br />
)<br />
<br />
Remove the symlink in /var/www/localhost/htdocs (we will be using the alias, not the symlink). <br />
unlink /var/www/localhost/htdocs/zm<br />
<br />
Start php-fpm<br />
<br />
/etc/init.d/php-fpm8 start<br />
<br />
''Note:'' for php-fpm81, use the following command:<br />
<br />
/etc/init.d/php-fpm81 start<br />
<br />
Start lighttpd<br />
<br />
/etc/init.d/lighttpd start<br />
<br />
===Zoneminder===<br />
<br />
Set the MySQL hostname, username, password.<br />
<br />
Change the ZoneMinder user (<code>ZM_WEB_USER</code>) and group (<code>ZM_WEB_GROUP</code>) to lighttpd<br />
<br />
And set <code>ZM_SERVER_HOST</code> to your ZoneMinder hostname/ipaddress<br />
<br />
vi /etc/zm/zm.conf<br />
<br />
Which should look like:<br />
<br />
# Username and group that web daemon (httpd/apache) runs as<br />
ZM_WEB_USER=lighttpd<br />
ZM_WEB_GROUP=lighttpd<br />
ZM_PATH_DATA=/usr/share/zoneminder<br />
<br />
# ZoneMinder database type: so far only mysql is supported<br />
ZM_DB_TYPE=mysql<br />
<br />
# ZoneMinder database hostname or ip address<br />
ZM_DB_HOST=localhost<br />
<br />
# ZoneMinder database name<br />
ZM_DB_NAME=zm<br />
<br />
# ZoneMinder database user<br />
ZM_DB_USER=zmuser<br />
<br />
# ZoneMinder database password<br />
ZM_DB_PASS=your_zm_password_as_set_in_config<br />
<br />
# Host of this machine<br />
ZM_SERVER_HOST=yourserver<br />
<br />
Change ownership of <code>zm.conf</code> to <code>lighttpd</code><br />
<br />
chown lighttpd.lighttpd /etc/zm/zm.conf<br />
<br />
Zoneminder will create a cache in <code>/var/cache/zoneminder</code> which isn't created by default. Create this directory and allow lighttpd access to it. Note that if you are using a diskless install, you must lbu add /var/cache/zoneminder.<br />
<br />
mkdir /var/cache/zoneminder<br />
chown lighttpd.lighttpd /var/cache/zoneminder<br />
<br />
<br />
Initialize the ZoneMinder database<br />
<br />
/etc/init.d/zoneminder setup<br />
<br />
Start ZoneMinder<br />
<br />
/etc/init.d/zoneminder start<br />
<br />
Profit!<br />
<br />
===Conclusion===<br />
<br />
To access ZoneMinder, browse to <nowiki>http://yourserver/zm/</nowiki><br />
<br />
To test the API, run<br />
curl -X GET http://yourserver/zm/api/host/getVersion.json<br />
(This assumes you aren't using authentication.)<br />
<br />
To make it start automatically on boot:<br />
<br />
rc-update add lighttpd default<br />
rc-update add mariadb default<br />
rc-update add php-fpm8 default<br />
rc-update add zoneminder default<br />
<br />
== Added notes to work with Nginx ==<br />
Later to add some notes about running via nginx<br />
<br />
==Related Links==<br />
* https://wiki.alpinelinux.org/wiki/Raspberry_Pi_3_-_Browser_Client - Kiosk to watch Streams<br />
<br />
[[Category:Software]]<br />
[[Category:Security]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Release_Notes_for_Alpine_3.18.0&diff=23418Release Notes for Alpine 3.18.02023-05-13T14:56:45Z<p>Psykose: 7zip</p>
<hr />
<div>== Base System ==<br />
<br />
=== Linux Kernel ===<br />
<br />
{{pkg|linux-lts}} was updated from 5.15 to 6.1. [https://lkml.org/lkml/2022/12/11/206 release notes]<br />
<br />
Kernel modules are now signed.<br />
<br />
''Note: {{pkg|akms}} (Alpine Kernel Module Support) doesn't support modules signing yet, it will be implemented later.''<br />
<br />
=== musl 1.2.4 ===<br />
<br />
Support for DNS lookups over TCP. [https://www.openwall.com/lists/musl/2023/05/02/1 release notes]<br />
<br />
=== DT_RELR ===<br />
<br />
on x86, x86_64, and ppc64le, <code>-Wl,-z,pack-relative-relocs</code> is now added to the base LDFLAGS. this reduces elf (executable/shared-library) size by 10% on average. <br />
<br />
however, these binaries are now not portable to other musl-based systems that have a musl older than 1.2.4, because older versions are incapable of loading these binaries.<br />
<br />
=== OpenSSL 3.1 ===<br />
<br />
[https://www.openssl.org/news/openssl-3.1-notes.html release notes]<br />
<br />
=== Experimental headless installer ===<br />
<br />
Support for head-less installs with [https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud tiny-cloud] was added. This is done via a volume with label <code>cidata</code>, similar to cloud-init's [https://cloudinit.readthedocs.io/en/latest/reference/datasources/nocloud.html NoCloud] provider. If this volume is found during boot, the network will be auto configured and provided, a default user named <code>alpine</code> will be created and ssh keys provided in meta-data will be added. This is experimental and may change without prior notice.<br />
<br />
=== e2fsprogs 1.47.0 ===<br />
<br />
The {{pkg|e2fsprogs}} package shipped with Alpine 3.18 changed the behaviour of <code>mke2fs</code> so that newly created filesystems have two additional features enabled.<br />
<br />
From [https://e2fsprogs.sourceforge.net/e2fsprogs-release.html#1.47.0 release notes]:<br />
<br />
<blockquote>The mke2fs program (via the mke2fs.conf file) now enables the metadata_csum_seed and orphan_file features by default.</blockquote><br />
<br />
However, whilst the <code>metadata_csum_seed</code> feature is known about by older versions of e2fsck the <code>orphan_file</code> feature was both added to e2fsprogs 1.47.0 '''and''' enabled at the same time. Therefore older versions of e2fsck are unable to fsck a filesystem created by mke2fs 1.47.0.<br />
<br />
== Compilers and Runtimes ==<br />
<br />
<!-- stuff in main --><br />
=== LLVM 16 ===<br />
<br />
{{pkg|llvm16}} was added. [https://releases.llvm.org/16.0.0/docs/ReleaseNotes.html release notes]<br />
<br />
=== Lua ===<br />
<br />
{{pkg|luarocks}}, the package manager for Lua, was updated from 2.x to 3x. [https://github.com/luarocks/luarocks/blob/master/CHANGELOG.md#whats-new-in-luarocks-300 release notes]<br />
<br />
=== Python ===<br />
<br />
{{pkg|python3}} was updated from 3.10 to 3.11. [https://docs.python.org/3/whatsnew/3.11.html release notes]<br />
<br />
==== splitting of python pycache .pyc files ====<br />
<br />
Most python modules split their <code>__pycache__</code> to a <code>-pyc</code> subpackage, pulled by default. To save space and not pull it (incurring python interpreter startup costs, as it generates it each run), run <code>apk add !python3-pyc</code><br />
<br />
=== Ruby 3.2 ===<br />
<br />
{{pkg|ruby}} was updated from 3.1 to 3.2. [https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/ release notes]<br />
<br />
<br />
<!-- community --><br />
<br />
=== Crystal 1.8 ===<br />
<br />
{{pkg|crystal}} was updated from 1.6 to 1.8. [https://crystal-lang.org/2023/01/09/1.7.0-released/ release notes for 1.7], [https://crystal-lang.org/2023/04/14/1.8.0-released/ release notes for 1.8]<br />
<br />
=== Go 1.20 ===<br />
<br />
{{pkg|go}} [https://go.dev/blog/go1.20 release notes]<br />
<br />
=== PHP 8.2 ===<br />
<br />
Added 8.2 packages with a subset of the most common extensions. Version 8.1 still remains the primary provider priority, but some web applications started to use 8.2.<br />
<br />
=== R 4.3 ===<br />
<br />
{{pkg|R}} was updated from 4.2 to 4.3. [https://www.r-bloggers.com/2023/04/whats-new-in-r-4-3-0/ release notes]<br />
<br />
=== Rust 1.69 ===<br />
<br />
{{pkg|rust}} was updated from 1.64 to 1.69.<br />
<br />
== Desktop ==<br />
<br />
=== gdk-pixbuf-loaders ===<br />
<br />
A few gdk-pixbuf loaders were added, and they were all added to an <code>install_if</code> metapackage rule. Run <code>apk add gdk-pixbuf-loaders</code> to enable the loaders for the corresponding image libraries you have installed.<br />
<br />
=== GNOME 44 ===<br />
<br />
[https://release.gnome.org/44/ release notes]<br />
<br />
The {{pkg|gnome}} metapackage was reworked and the packages {{pkg|gnome-apps-extra}} and {{pkg|gnome-games-collection}} were removed to avoid opinionated lists in metapackages. It is advised to remove those from <code>/etc/apk/world</code> before performing the upgrade. Additionally, the new subpackage {{pkg|gnome-dev-tools}} was added following the upstream's recommendations.<br />
<br />
On related news, to make use of GNOME Software, it is necessary to enable the <code>apk-polkit-server</code> openrc service. More info in the [https://wiki.alpinelinux.org/wiki/Gnome#Enabling_GNOME_Software wiki]<br />
<br />
=== Plasma 5.27 ===<br />
<br />
{{pkg|plasma}} was updated from 5.26 to 5.27. This includes some new packages like {{pkg|plasma-welcome}} (a welcoming application that shows up on the first boot to configure some initial settings) and {{pkg|flatpak-kcm}} (a configuration page for the system settings to control Flatpak permissions, much like GNOME's Flatseal).<br />
This Plasma release is the last one that will be built on Qt5 and will probably remain in use for Alpine 3.19 as well.<br />
<br />
=== Sway 1.8 ===<br />
<br />
{{pkg|sway}} was updated from 1.7 to 1.8. [https://github.com/swaywm/sway/releases/tag/1.8 release notes]<br />
<br />
== Others ==<br />
<br />
=== dbus ===<br />
<br />
dbus-activation has been removed from packages {{pkg|openrc-settingsd}} and {{pkg|apk-polkit-rs}}. To make use of their services, make sure to start and enable the <code>openrc-settingsd</code> and <code>apk-polkit-server</code> services, respectively.<br />
<br />
=== nginx 1.24 ===<br />
<br />
{{pkg|nginx}} was updated to the new stable branch 1.24.x. [https://nginx.org/en/CHANGES-1.24 release notes]<br />
<br />
=== Removal of pipewire-media-session ===<br />
<br />
{{pkg|pipewire-media-session}} was removed, as upstream explicitly recommends not to use it, and it's completely superceded by wireplumber.<br />
if you used it, make sure you don't have {{pkg|pipewire-media-session}} in <code>/etc/apk/world</code>, and configure any scripts you might've had to launch <code>wireplumber</code> instead.<br />
<br />
=== QEMU 8 ===<br />
<br />
QEMU was updated from 7.1 to 8.0. [https://www.qemu.org/2023/04/20/qemu-8-0-0/ release notes]<br />
<br />
=== Docker 23 ===<br />
<br />
The {{pkg|docker}} package shipped with Alpine 3.18 has a dependency on {{pkg|docker-cli-buildx}}, as Docker 23 now uses it for builds.<br />
<br />
Also, Docker 23 no longer enables the <code>overlay</code> storage driver, as it has been deprecated for a long time and is nearing removal. if your deployment is still configured to use it, <code>dockerd</code> will fail to start. To fix this, either...<br />
<br />
* migrate to <code>overlay2</code> in <code>/etc/docker/daemon.json</code><br />
* hardcode it to <code>overlay</code> in the same file (instead of blank), though this will eventually break in a future upgrade<br />
<br />
For more detailed information about Docker 23, please refer to the [https://docs.docker.com/engine/release-notes/23.0/ release notes].<br />
<br />
=== AWS CLI v2 ===<br />
<br />
The {{pkg|aws-cli}} package has been upgraded from v1 to v2 which results in changed behaviour in how certain commands behave.<br />
<br />
Please follow [https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html this guide] for migrating between versions.<br />
<br />
=== ppp 2.5.0 ===<br />
<br />
pppd (<code>ppp-daemon</code>, <code>ppp-pppoe</code>, ..) was updated to 2.5. in 2.4.9, the <code>rp-pppoe.so</code> plugin was renamed to <code>pppoe.so</code> <br />
<br />
if you have <code>plugin rp-pppoe.so ...</code> configuration lines, you should update them accordingly.<br />
<br />
=== 7-zip ===<br />
<br />
<code>p7zip</code> was removed in favor of the linux port of 7-zip. they both provide the <code>7z</code> command, so nothing should be affected in usage.</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Release_Notes_for_Alpine_3.19.0&diff=23417Release Notes for Alpine 3.19.02023-05-13T12:14:43Z<p>Psykose: init</p>
<hr />
<div>== Base System ==<br />
<br />
=== iptables-nft ===<br />
<br />
the <code>/sbin/iptables{,-save,-restore}</code> symlinks now point to xtables-nft-multi instead of xtables-legacy-multi. this means they use the nftables kernel backend instead of the legacy iptables one.<br />
<br />
because mixing backends is not supported, you should reboot your system if you have to use the iptables commands after upgrading.</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=APKBUILD_examples:Python&diff=23408APKBUILD examples:Python2023-05-11T07:06:02Z<p>Psykose: gpep517 only</p>
<hr />
<div>A lot of Python packages use the ''setuptools'' or ''distutils'' framework. This mean that the build() and the package() section looks a bit different compared to an application which uses ''make''.<br />
<br />
== Considerations ==<br />
<br />
=== pkgname ===<br />
<br />
Package name for a Python ''library'' must be prefixed with ''py3-''. <br />
<br />
For an 'executable' (for example, <code>black</code>, <code>binwalk</code>), you generally don't need to prefix it. <br />
<br />
There’s no exact rule if the prefix should be used for tools and applications written in Python, it varies.<br />
<br />
=== arch ===<br />
<br />
; noarch : Use for pure Python packages (i.e. without compiled code).<br />
; all (and others) : Use for packages with native extensions (i.e. with compiled code). '''Do not''' add python3 to <tt>depends=</tt> (it's auto-detected via dynamic linking to python library).<br />
<br />
=== source ===<br />
<br />
Most Python packages are published in [https://pypi.python.org/pypi PyPI](the Python Package Index).<br />
If the package has a source tarball available in PyPI (that’s true for most packages), and it contains tests (some explicitly remove them from PyPI), you should reference it in <tt>source=</tt> as:<br />
<br />
<pre><br />
https://files.pythonhosted.org/packages/source/${_pyname%${_pyname#?}}/$_pyname/$_pyname-$pkgver.tar.gz<br />
</pre><br />
<br />
where <tt>_pyname</tt> is the real name of the Python package.<br />
<br />
Otherwise, use the normal upstream git tarballs.<br />
<br />
== Examples ==<br />
<br />
=== pep517 invocation ===<br />
<br />
<pre><br />
pkgname="py3-foo"<br />
...<br />
depends="py3-bar py3-baz"<br />
makedepends="py3-gpep517 py3-setuptools py3-wheel python3-dev"<br />
checkdepends="py3-pytest"<br />
subpackages="$pkgname-pyc"<br />
...<br />
<br />
build() {<br />
gpep517 build-wheel \<br />
--wheel-dir dist \<br />
--output-fd 3 3>&1 >&2<br />
}<br />
<br />
check() {<br />
python3 -m venv --clear --system-site-packages testenv<br />
testenv/bin/python3 -m installer dist/*.whl<br />
testenv/bin/python3 -m pytest<br />
}<br />
<br />
package() {<br />
python3 -m installer -d "$pkgdir" \<br />
dist/*.whl<br />
}<br />
</pre><br />
<br />
Depending on the <code>build-backend</code> in the pyproject.toml, you might need py3-setuptools or py3-flit-core or py3-poetry-core or py3-hatchling at build time. If a project specifies literally <code>flit</code> or <code>poetry</code>, patch it to use the <code>-core</code> variant.<br />
<br />
[[Category:Development]] [[Category:Python]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Release_Notes_for_Alpine_3.18.0&diff=23407Release Notes for Alpine 3.18.02023-05-10T22:25:08Z<p>Psykose: ppp 2.5</p>
<hr />
<div>== Base System ==<br />
<br />
=== Linux Kernel ===<br />
<br />
{{pkg|linux-lts}} was updated from 5.15 to 6.1. [https://lkml.org/lkml/2022/12/11/206 release notes]<br />
<br />
Kernel modules are now signed.<br />
<br />
''Note: {{pkg|akms}} (Alpine Kernel Module Support) doesn't support modules signing yet, it will be implemented later.''<br />
<br />
=== musl 1.2.4 ===<br />
<br />
Support for DNS lookups over TCP. [https://www.openwall.com/lists/musl/2023/05/02/1 release notes]<br />
<br />
=== DT_RELR ===<br />
<br />
on x86, x86_64, and ppc64le, <code>-Wl,-z,pack-relative-relocs</code> is now added to the base LDFLAGS. this reduces elf (executable/shared-library) size by 10% on average. <br />
<br />
however, these binaries are now not portable to other musl-based systems that have a musl older than 1.2.4, because older versions are incapable of loading these binaries.<br />
<br />
=== OpenSSL 3.1 ===<br />
<br />
[https://www.openssl.org/news/openssl-3.1-notes.html release notes]<br />
<br />
=== Experimental headless installer ===<br />
<br />
Support for head-less installs with [https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud tiny-cloud] was added. This is done via a volume with label <code>cidata</code>, similar to cloud-init's [https://cloudinit.readthedocs.io/en/latest/reference/datasources/nocloud.html NoCloud] provider. If this volume is found during boot, the network will be auto configured and provided, a default user named <code>alpine</code> will be created and ssh keys provided in meta-data will be added. This is experimental and may change without prior notice.<br />
<br />
=== e2fsprogs 1.47.0 ===<br />
<br />
The {{pkg|e2fsprogs}} package shipped with Alpine 3.18 changed the behaviour of <code>mke2fs</code> so that newly created filesystems have two additional features enabled.<br />
<br />
From [https://e2fsprogs.sourceforge.net/e2fsprogs-release.html#1.47.0 release notes]:<br />
<br />
<blockquote>The mke2fs program (via the mke2fs.conf file) now enables the metadata_csum_seed and orphan_file features by default.</blockquote><br />
<br />
However, whilst the <code>metadata_csum_seed</code> feature is known about by older versions of e2fsck the <code>orphan_file</code> feature was both added to e2fsprogs 1.47.0 '''and''' enabled at the same time. Therefore older versions of e2fsck are unable to fsck a filesystem created by mke2fs 1.47.0.<br />
<br />
== Compilers and Runtimes ==<br />
<br />
<!-- stuff in main --><br />
=== LLVM 16 ===<br />
<br />
{{pkg|llvm16}} was added. [https://releases.llvm.org/16.0.0/docs/ReleaseNotes.html release notes]<br />
<br />
=== Lua ===<br />
<br />
{{pkg|luarocks}}, the package manager for Lua, was updated from 2.x to 3x. [https://github.com/luarocks/luarocks/blob/master/CHANGELOG.md#whats-new-in-luarocks-300 release notes]<br />
<br />
=== Python ===<br />
<br />
{{pkg|python3}} was updated from 3.10 to 3.11. [https://docs.python.org/3/whatsnew/3.11.html release notes]<br />
<br />
==== splitting of python pycache .pyc files ====<br />
<br />
Most python modules split their <code>__pycache__</code> to a <code>-pyc</code> subpackage, pulled by default. To save space and not pull it (incurring python interpreter startup costs, as it generates it each run), run <code>apk add !python3-pyc</code><br />
<br />
=== Ruby 3.2 ===<br />
<br />
{{pkg|ruby}} was updated from 3.1 to 3.2. [https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/ release notes]<br />
<br />
<br />
<!-- community --><br />
<br />
=== Crystal 1.8 ===<br />
<br />
{{pkg|crystal}} was updated from 1.6 to 1.8. [https://crystal-lang.org/2023/01/09/1.7.0-released/ release notes for 1.7], [https://crystal-lang.org/2023/04/14/1.8.0-released/ release notes for 1.8]<br />
<br />
=== Go 1.20 ===<br />
<br />
{{pkg|go}} [https://go.dev/blog/go1.20 release notes]<br />
<br />
=== PHP 8.2 ===<br />
<br />
Added 8.2 packages with a subset of the most common extensions. Version 8.1 still remains the primary provider priority, but some web applications started to use 8.2.<br />
<br />
=== R 4.3 ===<br />
<br />
{{pkg|R}} was updated from 4.2 to 4.3. [https://www.r-bloggers.com/2023/04/whats-new-in-r-4-3-0/ release notes]<br />
<br />
=== Rust 1.69 ===<br />
<br />
{{pkg|rust}} was updated from 1.64 to 1.69.<br />
<br />
== Desktop ==<br />
<br />
=== gdk-pixbuf-loaders ===<br />
<br />
A few gdk-pixbuf loaders were added, and they were all added to an <code>install_if</code> metapackage rule. Run <code>apk add gdk-pixbuf-loaders</code> to enable the loaders for the corresponding image libraries you have installed.<br />
<br />
=== GNOME 44 ===<br />
<br />
[https://release.gnome.org/44/ release notes]<br />
<br />
The {{pkg|gnome}} metapackage was reworked and the packages {{pkg|gnome-apps-extra}} and {{pkg|gnome-games-collection}} were removed to avoid opinionated lists in metapackages. It is advised to remove those from <code>/etc/apk/world</code> before performing the upgrade. Additionally, the new subpackage {{pkg|gnome-dev-tools}} was added following the upstream's recommendations.<br />
<br />
On related news, to make use of GNOME Software, it is necessary to enable the <code>apk-polkit-server</code> openrc service. More info in the [https://wiki.alpinelinux.org/wiki/Gnome#Enabling_GNOME_Software wiki]<br />
<br />
=== Plasma 5.27 ===<br />
<br />
{{pkg|plasma}} was updated from 5.26 to 5.27. This includes some new packages like {{pkg|plasma-welcome}} (a welcoming application that shows up on the first boot to configure some initial settings) and {{pkg|flatpak-kcm}} (a configuration page for the system settings to control Flatpak permissions, much like GNOME's Flatseal).<br />
This Plasma release is the last one that will be built on Qt5 and will probably remain in use for Alpine 3.19 as well.<br />
<br />
=== Sway 1.8 ===<br />
<br />
{{pkg|sway}} was updated from 1.7 to 1.8. [https://github.com/swaywm/sway/releases/tag/1.8 release notes]<br />
<br />
== Others ==<br />
<br />
=== dbus ===<br />
<br />
dbus-activation has been removed from packages {{pkg|openrc-settingsd}} and {{pkg|apk-polkit-rs}}. To make use of their services, make sure to start and enable the <code>openrc-settingsd</code> and <code>apk-polkit-server</code> services, respectively.<br />
<br />
=== nginx 1.24 ===<br />
<br />
{{pkg|nginx}} was updated to the new stable branch 1.24.x. [https://nginx.org/en/CHANGES-1.24 release notes]<br />
<br />
=== Removal of pipewire-media-session ===<br />
<br />
{{pkg|pipewire-media-session}} was removed, as upstream explicitly recommends not to use it, and it's completely superceded by wireplumber.<br />
if you used it, make sure you don't have {{pkg|pipewire-media-session}} in <code>/etc/apk/world</code>, and configure any scripts you might've had to launch <code>wireplumber</code> instead.<br />
<br />
=== QEMU 8 ===<br />
<br />
QEMU was updated from 7.1 to 8.0. [https://www.qemu.org/2023/04/20/qemu-8-0-0/ release notes]<br />
<br />
=== Docker 23 ===<br />
<br />
The {{pkg|docker}} package shipped with Alpine 3.18 has a dependency on {{pkg|docker-cli-buildx}}, as Docker 23 now uses it for builds.<br />
<br />
Also, Docker 23 no longer enables the <code>overlay</code> storage driver, as it has been deprecated for a long time and is nearing removal. if your deployment is still configured to use it, <code>dockerd</code> will fail to start. To fix this, either...<br />
<br />
* migrate to <code>overlay2</code> in <code>/etc/docker/daemon.json</code><br />
* hardcode it to <code>overlay</code> in the same file (instead of blank), though this will eventually break in a future upgrade<br />
<br />
For more detailed information about Docker 23, please refer to the [https://docs.docker.com/engine/release-notes/23.0/ release notes].<br />
<br />
=== AWS CLI v2 ===<br />
<br />
The {{pkg|aws-cli}} package has been upgraded from v1 to v2 which results in changed behaviour in how certain commands behave.<br />
<br />
Please follow [https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html this guide] for migrating between versions.<br />
<br />
=== ppp 2.5.0 ===<br />
<br />
pppd (<code>ppp-daemon</code>, <code>ppp-pppoe</code>, ..) was updated to 2.5. in 2.4.9, the <code>rp-pppoe.so</code> plugin was renamed to <code>pppoe.so</code> <br />
<br />
if you have <code>plugin rp-pppoe.so ...</code> configuration lines, you should update them accordingly.</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=PPP&diff=23406PPP2023-05-10T21:53:42Z<p>Psykose: typo</p>
<hr />
<div>{{TOC right}}<br />
<br />
== Installation ==<br />
<br />
PPP (Point-to-Point Protocol) allows multiple transports, eg. PPPoE is PPP over Ethernet.<br />
<br />
=== PPPoE ===<br />
<br />
{{cmd|apk add ppp-pppoe}}<br />
<br />
== Configure PPP ==<br />
<br />
=== PPP peer file ===<br />
<br />
Such file is usually located as ''/etc/ppp/peers/<isp>''. See [https://ppp.samba.org/pppd.html pppd(8)] for all possible options.<br />
<br />
==== PPPoE ====<br />
<br />
This example peer file is based on Debian's [https://salsa.debian.org/debian/ppp/-/raw/master/debian/extra/peers-pppoe peers-pppoe] extra file. See that ''pppoe.so'' plugin as ''eth0'' as device defined.<br />
<br />
<pre><br />
user "myusername@realm"<br />
plugin pppoe.so eth0<br />
noipdefault<br />
usepeerdns<br />
defaultroute<br />
persist<br />
noauth<br />
</pre><br />
<br />
Note that if you have a version of ppp older than 2.4.9, the <code>pppoe.so</code> plugin is named <code>rp-pppoe.so</code>.<br />
<br />
=== Authentication ===<br />
<br />
CHAP authentication is most used one but there are other ones, see [https://ppp.samba.org/pppd.html pppd(8)].<br />
<br />
==== ''/etc/ppp/chap-secrets'' ====<br />
<br />
<pre><br />
# Secrets for authentication using CHAP<br />
# client server secret IP addresses<br />
"myusername@realm" * "<your password>"<br />
</pre><br />
<br />
== Kernel modules ==<br />
<br />
=== PPPoE ===<br />
<br />
''pppoe'' must be present in ''/etc/modules'' when using PPPoE.<br />
<br />
== ''ifupdown-ng'' intergration ==<br />
<br />
To use ''/etc/network/interfaces'' with a ppp defintion automatically, ''ifupdown-ng-ppp'' package must be installed.<br />
<br />
{{cmd|apk add ifupdown-ng-ppp}}<br />
<br />
Example for PPP configuration in ''/etc/network/interfaces'', see [https://github.com/ifupdown-ng/ifupdown-ng/blob/master/doc/interfaces-ppp.scd interfaces-ppp(5)] for more info.<br />
<br />
<pre><br />
auto eth0<br />
iface eth0 up<br />
<br />
auto ppp0<br />
iface ppp0<br />
ppp-provider isp<br />
</pre><br />
<br />
== Tips ==<br />
<br />
=== pppoeconf ===<br />
<br />
Debian created ''[https://sources.debian.org/data/main/p/pppoeconf/1.21%2Bnmu2/pppoeconf pppoeconf]'' tool which helps configuring PPPoE. First some utils have to be installed.<br />
<br />
{{cmd|apk add ppp-pppoe newt gettext sed}}<br />
{{cmd|wget https://sources.debian.org/data/main/p/pppoeconf/1.21%2Bnmu2/pppoeconf}} <br />
{{cmd|chmod +x ./pppoeconf && ./pppoeconf}}<br />
<br />
[[Category:Networking]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=PPP&diff=23405PPP2023-05-10T21:53:14Z<p>Psykose: rp-pppoe naming change</p>
<hr />
<div>{{TOC right}}<br />
<br />
== Installation ==<br />
<br />
PPP (Point-to-Point Protocol) allows multiple transports, eg. PPPoE is PPP over Ethernet.<br />
<br />
=== PPPoE ===<br />
<br />
{{cmd|apk add ppp-pppoe}}<br />
<br />
== Configure PPP ==<br />
<br />
=== PPP peer file ===<br />
<br />
Such file is usually located as ''/etc/ppp/peers/<isp>''. See [https://ppp.samba.org/pppd.html pppd(8)] for all possible options.<br />
<br />
==== PPPoE ====<br />
<br />
This example peer file is based on Debian's [https://salsa.debian.org/debian/ppp/-/raw/master/debian/extra/peers-pppoe peers-pppoe] extra file. See that ''pppoe.so'' plugin as ''eth0'' as device defined.<br />
<br />
<pre><br />
user "myusername@realm"<br />
plugin pppoe.so eth0<br />
noipdefault<br />
usepeerdns<br />
defaultroute<br />
persist<br />
noauth<br />
</pre><br />
<br />
Note that if you have a version of ppp older than 2.4.9, the <code>pppoe.so</code> plugin is named <code>rp-pppoe</code>.<br />
<br />
=== Authentication ===<br />
<br />
CHAP authentication is most used one but there are other ones, see [https://ppp.samba.org/pppd.html pppd(8)].<br />
<br />
==== ''/etc/ppp/chap-secrets'' ====<br />
<br />
<pre><br />
# Secrets for authentication using CHAP<br />
# client server secret IP addresses<br />
"myusername@realm" * "<your password>"<br />
</pre><br />
<br />
== Kernel modules ==<br />
<br />
=== PPPoE ===<br />
<br />
''pppoe'' must be present in ''/etc/modules'' when using PPPoE.<br />
<br />
== ''ifupdown-ng'' intergration ==<br />
<br />
To use ''/etc/network/interfaces'' with a ppp defintion automatically, ''ifupdown-ng-ppp'' package must be installed.<br />
<br />
{{cmd|apk add ifupdown-ng-ppp}}<br />
<br />
Example for PPP configuration in ''/etc/network/interfaces'', see [https://github.com/ifupdown-ng/ifupdown-ng/blob/master/doc/interfaces-ppp.scd interfaces-ppp(5)] for more info.<br />
<br />
<pre><br />
auto eth0<br />
iface eth0 up<br />
<br />
auto ppp0<br />
iface ppp0<br />
ppp-provider isp<br />
</pre><br />
<br />
== Tips ==<br />
<br />
=== pppoeconf ===<br />
<br />
Debian created ''[https://sources.debian.org/data/main/p/pppoeconf/1.21%2Bnmu2/pppoeconf pppoeconf]'' tool which helps configuring PPPoE. First some utils have to be installed.<br />
<br />
{{cmd|apk add ppp-pppoe newt gettext sed}}<br />
{{cmd|wget https://sources.debian.org/data/main/p/pppoeconf/1.21%2Bnmu2/pppoeconf}} <br />
{{cmd|chmod +x ./pppoeconf && ./pppoeconf}}<br />
<br />
[[Category:Networking]]</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Release_Notes_for_Alpine_3.18.0&diff=23372Release Notes for Alpine 3.18.02023-05-09T03:51:48Z<p>Psykose: typo</p>
<hr />
<div>=== Linux Kernel ===<br />
<br />
linux-lts 6.1 https://lkml.org/lkml/2022/12/11/206<br />
<br />
Kernel modules are now signed.<br />
<br />
=== musl 1.2.4 ===<br />
<br />
Support for DNS lookups over TCP.<br />
<br />
https://www.openwall.com/lists/musl/2023/05/02/1<br />
<br />
=== DT_RELR === <br />
<br />
on x86, x86_64, and ppc64le, <code>-Wl,-z,pack-relative-relocs</code> is now added to the base LDFLAGS. this reduces elf (executable/shared-library) size by 10% on average. <br />
<br />
however, these binaries are now not portable to other musl-based systems that have a musl older than 1.2.4, because older versions are incapable of loading these binaries.<br />
<br />
=== GNOME ===<br />
<br />
The gnome metapackage was reworked and the packages gnome-apps-extra and gnome-games-collection were removed to avoid opinionated lists in metapackages. It is advised to remove those from /etc/apk/world before performing the upgrade. Additionally, the new subpackage gnome-dev-tools was added following upstream's recommendations.<br />
<br />
=== Plasma 5.27.4 ===<br />
<br />
From 5.26.5 before. This includes some new packages like plasma-welcome (a welcoming application that shows up on first boot to configure some initial settings) and flatpak-kcm (a configuration page for the system settings to control Flatpak permissions, much like GNOME's Flatseal).<br />
This Plasma release is the last one that will be build on Qt5 and will probably remain in use for Alpine 3.19 as well.<br />
<br />
=== dbus ===<br />
<br />
dbus-activation has been removed from packages <code>openrc-settingsd</code> and <code>apk-polkit-rs</code>. To make use of their services, make sure to start and enable the <code>openrc-settingsd</code> and <code>apk-polkit-server</code> services, respectively.<br />
<br />
=== removal of pipewire-media-session ===<br />
<br />
pipewire-media-session was removed, as upstream explicitly recommends to not use it, and it's completely superceded by wireplumber.<br />
if you used it, make sure you don't have pipewire-media-session in /etc/apk/world, and configure any scripts you might've had to launch wireplumber instead.<br />
<br />
=== Python ===<br />
<br />
python 3.11 https://docs.python.org/3/whatsnew/3.11.html<br />
<br />
=== splitting of python pycache .pyc files ===<br />
<br />
most python modules split their __pycache__ to a -pyc subpackage, pulled by default. to save space and not pull it (incurring python interpreter startup costs, as it generates it each run), run <code>apk add !python3-pyc</code><br />
<br />
=== PHP 8.2 ===<br />
<br />
Added 8.2 packages with subset of the most common extensions. Version 8.1 still remains primary provider priority but some web applications started to use 8.2.<br />
<br />
=== Ruby 3.2 ===<br />
<br />
Ruby was updated to 3.2. https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/<br />
<br />
=== gdk-pixbuf-loaders ===<br />
<br />
a few gdk-pixbuf loaders were added, and they were all added to an install_if metapackage rule- <code>apk add gdk-pixbuf-loaders</code> to enable the loaders for corresponding image libraries you have installed.<br />
<br />
=== Docker 23 ===<br />
<br />
The <code>docker</code> package shipped with Alpine 3.18 has a dependency on <code>docker-cli-buildx</code>, as Docker 23 now uses it for builds.<br />
<br />
Also, Docker 23 no longer enables the <code>overlay</code> storage driver, as it has been deprecated for a long time and is nearing removal. if your deployment is still configured to use it, <code>dockerd</code> will fail to start. To fix this, either...<br />
<br />
* migrate to <code>overlay2</code> in <code>/etc/docker/daemon.json</code><br />
* hardcode it to <code>overlay</code> in the same file (instead of blank), though this will eventually break in a future upgrade<br />
<br />
For more detailed information about Docker 23, please refer to https://docs.docker.com/engine/release-notes/23.0/<br />
<br />
=== e2fsprogs 1.47.0 ===<br />
<br />
The <code>e2fsprogs</code> package shipped with Alpine 3.18 changed the behaviour of mke2fs so that newly created filesystems have two additional features enabled.<br />
<br />
From https://e2fsprogs.sourceforge.net/e2fsprogs-release.html#1.47.0<br />
<br />
<code>The mke2fs program (via the mke2fs.conf file) now enables the metadata_csum_seed and orphan_file features by default.</code><br />
<br />
However whilst the metadata_csum_seed feature is known about by older versions of e2fsck the orphan_file feature was both added to e2fsprogs 1.47.0 '''and''' enabled at the same time. Therefore older versions of e2fsck are unable to fsck a filesystem created by mke2fs 1.47.0.</div>Psykosehttps://wiki.alpinelinux.org/w/index.php?title=Release_Notes_for_Alpine_3.18.0&diff=23359Release Notes for Alpine 3.18.02023-05-06T15:41:11Z<p>Psykose: typo</p>
<hr />
<div><br />
* python 3.11 https://docs.python.org/3/whatsnew/3.11.html<br />
* linux-lts 6.1 https://lkml.org/lkml/2022/12/11/206<br />
<br />
* The gnome metapackage was reworked and the packages gnome-apps-extra and gnome-games-collection were removed to avoid opinionated lists in metapackages. It is advised to remove those from /etc/apk/world before performing the upgrade. Additionally, the new subpackage gnome-dev-tools was added following upstream's recommendations.<br />
<br />
* dbus-activation has been removed from packages <code>openrc-settingsd</code> and <code>apk-polkit-rs</code>. To make use of their services, make sure to start and enable the <code>openrc-settingsd</code> and <code>apk-polkit-server</code> services, respectively.<br />
<br />
=== DT_RELR === <br />
<br />
on x86, x86_64, and ppc64le, <code>-Wl,-z,pack-relative-relocs</code> is now added to the base LDFLAGS. this reduces elf (executable/shared-library) size by 10% on average. <br />
<br />
however, these binaries are now not portable to other musl-based systems that have a musl older than 1.2.4, because older versions are incapable of loading these binaries.<br />
<br />
=== removal of pipewire-media-session ===<br />
<br />
pipewire-media-session was removed, as upstream explicitly recommends to not use it, and it's completely superceded by wireplumber.<br />
if you used it, make sure you don't have pipewire-media-session in /etc/apk/world, and configure any scripts you might've had to launch wireplumber instead.<br />
<br />
=== splitting of python pycache .pyc files ===<br />
<br />
most python modules split their __pycache__ to a -pyc subpackage, pulled by default. to save space and not pull it (incurring python interpreter startup costs, as it generates it each run), run <code>apk add !python3-pyc</code><br />
<br />
=== PHP 8.2 ===<br />
<br />
Added 8.2 packages with subset of the most common extensions. Version 8.1 still remains primary provider priority but some web applications started to use 8.2.<br />
<br />
=== Ruby 3.2 ===<br />
<br />
Ruby was updated to 3.2. https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/<br />
<br />
=== gdk-pixbuf-loaders ===<br />
<br />
a few gdk-pixbuf loaders were added, and they were all added to an install_if metapackage rule- <code>apk add gdk-pixbuf-loaders</code> to enable the loaders for corresponding image libraries you have installed.<br />
<br />
=== Docker 23 ===<br />
<br />
The <code>docker</code> package shipped with Alpine 3.18 has a dependency on <code>docker-cli-buildx</code>, as Docker 23 now uses it for builds.<br />
<br />
Also, Docker 23 no longer enables the <code>overlay</code> storage driver, as it has been deprecated for a long time and is nearing removal. if your deployment is still configured to use it, <code>dockerd</code> will fail to start. To fix this, either...<br />
<br />
* migrate to <code>overlay2</code> in <code>/etc/docker/daemon.json</code><br />
* hardcode it to <code>overlay</code> in the same file (instead of blank), though this will eventually break in a future upgrade<br />
<br />
For more detailed information about Docker 23, please refer to https://docs.docker.com/engine/release-notes/23.0/</div>Psykose