<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Begs</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Begs"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Begs"/>
	<updated>2026-05-02T02:32:01Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Comparison_with_other_distros&amp;diff=19996</id>
		<title>Comparison with other distros</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Comparison_with_other_distros&amp;diff=19996"/>
		<updated>2021-08-03T17:34:00Z</updated>

		<summary type="html">&lt;p&gt;Begs: fix typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Even if Alpine is designed to run from RAM, it has some similarities in package management with both Gentoo and Debian. This page outlines those similarities and differences, to help Debian and Gentoo users use Alpine.&lt;br /&gt;
&lt;br /&gt;
The page was originally copied from: http://gentoo-wiki.com/TIP_Converting_from_or_to_Debian&lt;br /&gt;
&lt;br /&gt;
= Package management =&lt;br /&gt;
Where Gentoo has portage and emerge; Debian has, among others, apt; Alpine uses apk-tools. This section compares how apk-tools is used, in comparison to apt-get/aptitude and emerge.&lt;br /&gt;
&lt;br /&gt;
Note that Gentoo is source-based, just like ports in FreeBSD are, while Debian uses pre-compiled binaries. Alpine is compiled using Gentoo&#039;s portage, but Alpine itself uses its own apk-tools binary package which is more similar to FreeBSD&#039;s binary packages.&lt;br /&gt;
&lt;br /&gt;
== Updating package database ==&lt;br /&gt;
Gentoo will update the build-from-source scripts and the updating of the database takes much more time than updating the database for Debian or Alpine.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
 apk update&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 emaint sync -a&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 aptitude update&lt;br /&gt;
&lt;br /&gt;
== Showing available updates ==&lt;br /&gt;
Show which packages have an update available:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
 apk version -v&lt;br /&gt;
or:&lt;br /&gt;
 apk version -v -l &#039;&amp;lt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 emerge --deep --update --pretend @world&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 aptitude upgrade --simulate&lt;br /&gt;
&lt;br /&gt;
== Updating a particular package ==&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
 apk add -u package1 package2&lt;br /&gt;
or&lt;br /&gt;
 apk upgrade package1 package2&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 aptitude install package1 package2&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 emerge --update package1 package2&lt;br /&gt;
&lt;br /&gt;
== Installing packages ==&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
 apk add package1 package2&lt;br /&gt;
&lt;br /&gt;
For source compile, see the [[Aports tree]] and the [[abuild]] tool.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 emerge package1 package2&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 apt-get install package1 package2&lt;br /&gt;
Debian source compile:&lt;br /&gt;
 apt-get build-dep package1&lt;br /&gt;
 apt-get source package1&lt;br /&gt;
(optional: customize the build by modifying the debian/rules makefile)&lt;br /&gt;
(or set environmental variables like DEB_BUILD_OPTIONS)&lt;br /&gt;
(note that this will make your bug reports invalid to the maintainer)&lt;br /&gt;
 dpkg-buildpackage -rfakeroot -uc -b&lt;br /&gt;
 dpkg -i generatedpackagename&lt;br /&gt;
Simplified source compile:&lt;br /&gt;
 apt-get build-dep package1&lt;br /&gt;
 apt-get -b source package1&lt;br /&gt;
(the packages are automatically generated using the -b switch above)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This process can be used to backport packages from testing and unstable by simply adding their respective source repositories to sources.list, which is similar to adding ~x86 to package.keywords in Gentoo. This is explored further in the &amp;quot;Architectures and repositories&amp;quot; section below.&lt;br /&gt;
&lt;br /&gt;
== Reinstalling particular packages ==&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
 apk del package1 package2 &amp;amp;&amp;amp; apk add package1 package2&lt;br /&gt;
or:&lt;br /&gt;
 apk fix package1 package2&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 emerge --oneshot package1 package2&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 apt-get install --reinstall package1 package2&lt;br /&gt;
&lt;br /&gt;
Note: You &#039;&#039;rarely&#039;&#039; need to reinstall a package on Debian&lt;br /&gt;
&lt;br /&gt;
== Searching the package database ==&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Alpine will only search package names.&lt;br /&gt;
 apk search searchword&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To search the package names and descriptions:&lt;br /&gt;
 emerge --searchdesc searchword&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; On Gentoo, it&#039;s actually much better to install and use either the esearch package or the eix package to do a search. You use them like this:&lt;br /&gt;
 eix searchword&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 esearch searchword&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 apt-cache search searchword&lt;br /&gt;
Both emerge and apt-cache search support regular expressions.&lt;br /&gt;
&lt;br /&gt;
To get the long package information on Debian (searching only in package names):&lt;br /&gt;
 apt-cache search --full --names-only searchword&lt;br /&gt;
&lt;br /&gt;
== Removing packages ==&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 apk del package1 package2&lt;br /&gt;
apk del will remove configuration files when the --purge flag is used. Make sure you have backups of your configuration files. (Using rcs might be an idea)&lt;br /&gt;
&lt;br /&gt;
You will mostly like to take a quick look at the dependencies before you remove packages recursively.&lt;br /&gt;
&lt;br /&gt;
To see dependencies for a package, use:&lt;br /&gt;
 apk info -R package1 package2&lt;br /&gt;
&lt;br /&gt;
To see if package is required by other packages (is a dependency for another packages), use:&lt;br /&gt;
 apk info -r package1 package2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 emerge --unmerge package1 package2 (Note: this is unsafe as it does not check dependencies)&lt;br /&gt;
 emerge --depclean package1 package2 (This will check dependencies)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 apt-get remove package1 package2&lt;br /&gt;
or to remove along with all configuration files&lt;br /&gt;
 apt-get remove --purge package1 package2&lt;br /&gt;
&lt;br /&gt;
== Only downloading packages ==&lt;br /&gt;
This can be useful e.g. if you&#039;re on a dial-up connection and want to download everything first and install later.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
 apk fetch package1 package2&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 emerge --fetchonly package1 package2&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 apt-get install --download-only package1 package2&lt;br /&gt;
&lt;br /&gt;
== Cleaning up downloaded packages ==&lt;br /&gt;
Compressed packages that were downloaded for installation can easily consume gigabytes of storage space.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Alpine will clean up packages automatically.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 rm -rf /var/cache/distfiles/*&lt;br /&gt;
To only remove outdated packages you will need to install the gentoolkit package and use eclean:&lt;br /&gt;
 eclean distfiles&lt;br /&gt;
Cleaning temporary files from emerging packages:&lt;br /&gt;
 rm -rf /var/tmp/portage/*&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 apt-get clean&lt;br /&gt;
Only remove outdated packages:&lt;br /&gt;
 apt-get autoclean&lt;br /&gt;
&lt;br /&gt;
==Reverse dependencies==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
apk-tools will take care of reverse dependencies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Reverse dependencies are a major drawback of Gentoo&#039;s current portage implementation: It does not take care of them at all at the moment.&lt;br /&gt;
If you use the unsafe --unmerge argument, this means that you can uninstall packages needed by others without being warned about it. E.g. you can remove the X server package without portage warning you that KDE (which you have installed as well) depends on it. This way you can actually break your entire system (e.g. by removing glibc).&lt;br /&gt;
&lt;br /&gt;
 revdep-rebuild&lt;br /&gt;
can fix broken dependencies broken by&lt;br /&gt;
emerge --depclean&lt;br /&gt;
&lt;br /&gt;
Recent versions of portage include library tracking and preservation with the preserved-libs feature.  Portage will notify you to run {{Cmd| emerge @preserved-rebuild}} to help rebuild binaries that might otherwise become broken.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Reverse dependencies are taken care of by dpkg.&lt;br /&gt;
&lt;br /&gt;
= Runlevel &amp;amp; Initscripts =&lt;br /&gt;
Runlevels work pretty conventionally on Debian (see details: [http://archive.fo/ZdZIz systemd]). On Alpine and Gentoo, they are a bit different.&lt;br /&gt;
&lt;br /&gt;
== Directories and files ==&lt;br /&gt;
In &#039;&#039;&#039;Debian&#039;&#039;&#039;, runlevels are named conventionally (0-6 and S). They are represented by directories in /etc/ called rc*.d (when the default sysv-rc boot loader package is installed; file-rc can be installed instead, and then the relevant file is runlevel.conf).&lt;br /&gt;
&lt;br /&gt;
* /etc/rc0.d&lt;br /&gt;
* /etc/rc1.d&lt;br /&gt;
* /etc/rcS.d&lt;br /&gt;
* /etc/rc2.d&lt;br /&gt;
* /etc/rc3.d&lt;br /&gt;
* /etc/rc4.d&lt;br /&gt;
* /etc/rc5.d&lt;br /&gt;
* /etc/rc6.d&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;Gentoo&#039;&#039;&#039;, runlevels have the same names, but these are mapped to more self explanatory ones (in /etc/inittab): &amp;quot;boot&amp;quot;, &amp;quot;default&amp;quot;, &amp;quot;nonetwork&amp;quot;, with the option to add more. The directories that represent them are in &lt;br /&gt;
/etc/runlevels/:&lt;br /&gt;
* /etc/runlevels/boot&lt;br /&gt;
* /etc/runlevels/default&lt;br /&gt;
* /etc/runlevels/nonetwork&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;Gentoo&#039;&#039;&#039;, if a service is not explicitly started in a runlevel, it is stopped when switching to that runlevel! There is no explicit stopping of runlevels as in Debian (/etc/rc?.d/K??service).&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;both Debian and Gentoo&#039;&#039;&#039;, which things are started (and stopped) in which runlevels is controlled by links in the runlevel directories to scripts in /etc/init.d/, e.g.:&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 $ ls -l /etc/runlevels/boot/hostname&lt;br /&gt;
 lrwxrwxrwx  1 root root 20 Mar 25  2004 /etc/runlevels/boot/hostname -&amp;gt; /etc/init.d/hostname&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 $ ls -l rcS.d/S40hostname.sh&lt;br /&gt;
 lrwxrwxrwx  1 root root 21 2004-11-07 00:19 rcS.d/S40hostname.sh -&amp;gt; ../init.d/hostname.sh&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In Alpine, runlevels work like they do in Gentoo:&lt;br /&gt;
&lt;br /&gt;
* /etc/runlevels/boot&lt;br /&gt;
* /etc/runlevels/default&lt;br /&gt;
* /etc/runlevels/sysinit&lt;br /&gt;
* /etc/runlevels/nonetwork&lt;br /&gt;
* /etc/runlevels/shutdown&lt;br /&gt;
&lt;br /&gt;
== Runlevel management ==&lt;br /&gt;
To manage which things to start in which runlevels, use the following commands:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To see current status of services in runlevels, do:&lt;br /&gt;
 rc-status&lt;br /&gt;
To add sshd to default runlevel, do:&lt;br /&gt;
 rc-update add -k sshd default&lt;br /&gt;
The -k option will make sure sshd is stopped when shutting down or reboot.&lt;br /&gt;
To remove sshd from all runlevels do:&lt;br /&gt;
 rc-update del sshd&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rc-update&lt;br /&gt;
To add the cupsd to the default runlevel, do:&lt;br /&gt;
 rc-update add cupsd default&lt;br /&gt;
To remove alsasound from the boot runlevel, do:&lt;br /&gt;
 rc-update del alsasound boot&lt;br /&gt;
Also see this wiki page about [http://gentoo-wiki.com/Rc-update gentoo runlevel management with rc-update]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 update-rc.d&lt;br /&gt;
Configure cupsd to be started in runlevels 2, 3, 4, 5, and stopped in 0, 1, 6, with sequence code 20:&lt;br /&gt;
 update-rc.d cupsd start 20 2 3 4 5 . stop 20 0 1 6 . &lt;br /&gt;
or simply:&lt;br /&gt;
 update-rc.d cupsd defaults &lt;br /&gt;
Remove cupsd from all runlevels:&lt;br /&gt;
 update-rc.d -f cupsd remove&lt;br /&gt;
&lt;br /&gt;
= Config Files =&lt;br /&gt;
&lt;br /&gt;
== /etc/portage/make.conf and use flags ==&lt;br /&gt;
While in Gentoo there&#039;s a large number of configuration files which control the behaviour of the package management system, there are comparatively fewer in Debian, as there is no need to dictate how to compile software which is downloaded and tweak/alter it. In Gentoo, the file /etc/portage/make.conf is used for much configuration; this includes &#039;&#039;USE&#039;&#039; flags, which influence which elements of packages are compiled, and which libraries to build support for - common USE flags (USE or -USE to specifically negate support) include &#039;gtk gnome&#039; for Gnome users (and a corresponding -qt -kde -arts) and &#039;qt kde arts&#039; for KDE users. A Gentoo user&#039;s complete set of use flags may look something like this:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;USE=&amp;quot;-kde -arts -qt xv truetype bluetooth crypt slang readline gpm berkdb mmx gdbm tcpd pam libwww ssl nls ethereal perl python esd gif imlib sdl oggvorbis mpeg gnome gtk X motif opengl avi png tiff nptl pcmcia nptl ldap eds&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Architectures and repositories ==&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Also in /etc/portage/make.conf is the &#039;&#039;&#039;ACCEPT_KEYWORDS&#039;&#039;&#039; setting, with (for an X86-based processor) two settings, &#039;&#039;&#039;x86&#039;&#039;&#039; for stabler packages, and &#039;&#039;&#039;~x86&#039;&#039;&#039; for bleeding edge packages. It is however not recommended to make this change in /etc/portage/make.conf. Rather configure this per-package in /etc/portage/package.accept_keywords. It&#039;s enough to put a line into that file naming the package (for example &#039;app-foo/bar&#039;). That file might look like this:&lt;br /&gt;
&lt;br /&gt;
 app-crypt/gpg-agent&lt;br /&gt;
 app-text/docbook-xsl-stylesheets&lt;br /&gt;
 =app-text/docbook-xml-dtd-4.3-r1&lt;br /&gt;
&lt;br /&gt;
The last line says, that &#039;&#039;only&#039;&#039; version 4.3-r1 should be unmasked. Older and newer versions will still be ignored.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note for non-x86 users:&#039;&#039;&#039;&lt;br /&gt;
The keywords &#039;&#039;&#039;x86&#039;&#039;&#039; and &#039;&#039;&#039;~x86&#039;&#039;&#039; can of course be replaced by &#039;&#039;&#039;sparc&#039;&#039;&#039; and &#039;&#039;&#039;~sparc&#039;&#039;&#039; for example.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Setting this in Debian is slightly more complicated, and is accomplished by setting different &#039;repositories&#039; in &#039;&#039;/etc/apt/sources.list&#039;&#039; - along with which &#039;tree&#039; to use for packages; in Debian, these are &#039;&#039;&#039;stable&#039;&#039;&#039;, &#039;&#039;&#039;testing&#039;&#039;&#039;, and &#039;&#039;&#039;unstable&#039;&#039;&#039;. An &#039;&#039;/etc/apt/sources.list&#039;&#039; file for a debian testing user may look something like this:&lt;br /&gt;
&lt;br /&gt;
 deb http://mirrors.kernel.org/debian testing main non-free contrib&lt;br /&gt;
 deb ftp://ftp.nerim.net/debian-marillat testing main&lt;br /&gt;
 deb http://security.debian.org testing/updates main contrib non-free&lt;br /&gt;
&lt;br /&gt;
Alternatively, &#039;&#039;/etc/apt/sources.list&#039;&#039; can contain any number of repositories for any trees, and a default tree (this can be overridden using the -t switch on the command line) in &#039;&#039;/etc/apt/apt.conf&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
   APT::Default-Release &amp;quot;testing&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
Per-package settings go in &#039;&#039;/etc/apt/preferences&#039;&#039;, somewhat like Gentoo&#039;s &#039;&#039;/etc/portage/package.keywords&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Network ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Alpine uses /etc/network/interfaces, just like Debian. The main reason is because this is the way busybox does it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/etc/network/interfaces&#039;&#039;:&lt;br /&gt;
 auto eth0&lt;br /&gt;
 iface eth0 inet static&lt;br /&gt;
  address 192.168.0.1&lt;br /&gt;
  netmask 255.255.255.0&lt;br /&gt;
  broadcast 192.168.0.255&lt;br /&gt;
  &lt;br /&gt;
 auto eth0:0&lt;br /&gt;
 iface eth0:0 inet static&lt;br /&gt;
  address 192.168.1.1&lt;br /&gt;
  netmask 255.255.255.0&lt;br /&gt;
  broadcast 192.168.1.255&lt;br /&gt;
 # etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/etc/conf.d/net&#039;&#039;:&lt;br /&gt;
 config_eth0=&amp;quot;192.168.1.100 netmask 255.255.255.0&lt;br /&gt;
              192.168.2.100 netmask 255.255.255.0&amp;quot;&lt;br /&gt;
 routes_eth0=&amp;quot;default via 192.168.1.1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note that this has changed recently. For more information please refer to http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/etc/network/interfaces&#039;&#039;:&lt;br /&gt;
 auto eth0&lt;br /&gt;
 iface eth0 inet static&lt;br /&gt;
  address 192.168.0.1&lt;br /&gt;
  netmask 255.255.255.0&lt;br /&gt;
  broadcast 192.168.0.255&lt;br /&gt;
  &lt;br /&gt;
 auto eth0:0&lt;br /&gt;
 iface eth0:0 inet static&lt;br /&gt;
  address 192.168.1.1&lt;br /&gt;
  netmask 255.255.255.0&lt;br /&gt;
  broadcast 192.168.1.255&lt;br /&gt;
 # etc.&lt;br /&gt;
&lt;br /&gt;
= Comparison chart/Rosetta Stone =&lt;br /&gt;
&lt;br /&gt;
This chart shows how some standard things are done in Alpine compared to other distributions.&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;5&amp;quot; border=&amp;quot;1&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Action &lt;br /&gt;
! Alpine ([http://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management apk])&lt;br /&gt;
! Arch Linux ([https://wiki.archlinux.org/index.php/Pacman pacman])&lt;br /&gt;
! Gentoo ([http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&amp;amp;chap=1 emerge])&lt;br /&gt;
! Debian/Ubuntu ([http://wiki.debian.org/Aptitude aptitute])&lt;br /&gt;
! Fedora/RHEL/SL/CentOS ([http://yum.baseurl.org/wiki/YumCommands yum])&lt;br /&gt;
|-&lt;br /&gt;
| Update package database&lt;br /&gt;
| {{Cmd| apk update}}&lt;br /&gt;
| {{Cmd| pacman -Sy}}&lt;br /&gt;
| {{Cmd| emerge --sync}}&lt;br /&gt;
| {{Cmd| aptitude update}}&lt;br /&gt;
| {{Cmd| yum update}}&lt;br /&gt;
|-&lt;br /&gt;
| Showing available updates&lt;br /&gt;
| {{Cmd| apk version -l &#039;&amp;lt;&#039;}}&lt;br /&gt;
| {{Cmd| pacman -Qu}}&lt;br /&gt;
| {{Cmd| emerge --deep --update --pretend @world}}&lt;br /&gt;
| {{Cmd| aptitude upgrade --simulate}}&lt;br /&gt;
| {{Cmd| yum list updates}}&lt;br /&gt;
|-&lt;br /&gt;
| Installing packages&lt;br /&gt;
| {{Cmd| apk add [package name]}}&lt;br /&gt;
| {{Cmd| pacman -S [package name]}}&lt;br /&gt;
| {{Cmd| emerge [package name]}}&lt;br /&gt;
| {{Cmd| aptitude install [package name]}}&lt;br /&gt;
| {{Cmd| yum install [package name]}}&lt;br /&gt;
|-&lt;br /&gt;
| Update all installed packages&lt;br /&gt;
| {{Cmd| apk upgrade -U -a}}&lt;br /&gt;
| {{Cmd| pacman -Su}}&lt;br /&gt;
| {{Cmd| emerge --update --deep @world}}&lt;br /&gt;
| {{Cmd| aptitude upgrade}}&lt;br /&gt;
| {{Cmd| yum update}}&lt;br /&gt;
|- &lt;br /&gt;
| Searching package database&lt;br /&gt;
| {{Cmd| apk search -v &#039;[string]*&#039;}}&lt;br /&gt;
| {{Cmd| pacman -Ss [string]}}&lt;br /&gt;
| {{Cmd| emerge --search [string]}}&lt;br /&gt;
| {{Cmd| aptitude search [string]}}&lt;br /&gt;
| {{Cmd| yum search [string]}}&lt;br /&gt;
|-&lt;br /&gt;
| Removing packages&lt;br /&gt;
| {{Cmd| apk del [package name]}}&lt;br /&gt;
| {{Cmd| pacman -R [package name]}}&lt;br /&gt;
| {{Cmd| emerge --depclean [package name]}}&lt;br /&gt;
| {{Cmd| aptitude remove [package name]}}&lt;br /&gt;
| {{Cmd| yum remove [package name]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;/div&gt;</summary>
		<author><name>Begs</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Comparison_with_other_distros&amp;diff=19995</id>
		<title>Comparison with other distros</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Comparison_with_other_distros&amp;diff=19995"/>
		<updated>2021-08-03T17:32:11Z</updated>

		<summary type="html">&lt;p&gt;Begs: /* Reinstalling a particular package */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Even if Alpine is designed to run from RAM, it has some similarities in package management with both Gentoo and Debian. This page outlines those similarities and differences, to help Debian and Gentoo users use Alpine.&lt;br /&gt;
&lt;br /&gt;
The page was originally copied from: http://gentoo-wiki.com/TIP_Converting_from_or_to_Debian&lt;br /&gt;
&lt;br /&gt;
= Package management =&lt;br /&gt;
Where Gentoo has portage and emerge; Debian has, among others, apt; Alpine uses apk-tools. This section compares how apk-tools is used, in comparison to apt-get/aptitude and emerge.&lt;br /&gt;
&lt;br /&gt;
Note that Gentoo is source-based, just like ports in FreeBSD are, while Debian uses pre-compiled binaries. Alpine is compiled using Gentoo&#039;s portage, but Alpine itself uses its own apk-tools binary package which is more similar to FreeBSD&#039;s binary packages.&lt;br /&gt;
&lt;br /&gt;
== Updating package database ==&lt;br /&gt;
Gentoo will update the build-from-source scripts and the updating of the database takes much more time than updating the database for Debian or Alpine.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
 apk update&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 emaint sync -a&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 aptitude update&lt;br /&gt;
&lt;br /&gt;
== Showing available updates ==&lt;br /&gt;
Show which packages have an update available:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
 apk version -v&lt;br /&gt;
or:&lt;br /&gt;
 apk version -v -l &#039;&amp;lt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 emerge --deep --update --pretend @world&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 aptitude upgrade --simulate&lt;br /&gt;
&lt;br /&gt;
== Updating a particular package ==&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
 apk add -u package1 package2&lt;br /&gt;
or&lt;br /&gt;
 apk upgrade package1 package2&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 aptitude install package1 package2&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 emerge --update package1 package2&lt;br /&gt;
&lt;br /&gt;
== Installing packages ==&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
 apk add package1 package2&lt;br /&gt;
&lt;br /&gt;
For source compile, see the [[Aports tree]] and the [[abuild]] tool.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 emerge package1 package2&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 apt-get install package1 package2&lt;br /&gt;
Debian source compile:&lt;br /&gt;
 apt-get build-dep package1&lt;br /&gt;
 apt-get source package1&lt;br /&gt;
(optional: customize the build by modifying the debian/rules makefile)&lt;br /&gt;
(or set environmental variables like DEB_BUILD_OPTIONS)&lt;br /&gt;
(note that this will make your bug reports invalid to the maintainer)&lt;br /&gt;
 dpkg-buildpackage -rfakeroot -uc -b&lt;br /&gt;
 dpkg -i generatedpackagename&lt;br /&gt;
Simplified source compile:&lt;br /&gt;
 apt-get build-dep package1&lt;br /&gt;
 apt-get -b source package1&lt;br /&gt;
(the packages are automatically generated using the -b switch above)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This process can be used to backport packages from testing and unstable by simply adding their respective source repositories to sources.list, which is similar to adding ~x86 to package.keywords in Gentoo. This is explored further in the &amp;quot;Architectures and repositories&amp;quot; section below.&lt;br /&gt;
&lt;br /&gt;
== Reinstalling particular packages ==&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
 apk del package1 package2 &amp;amp;&amp;amp; apk add package1 package2&lt;br /&gt;
or:&lt;br /&gt;
 apk fix package1 package2&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 emerge --oneshot package1 package2&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 apt-get install --reinstall package1 package2&lt;br /&gt;
&lt;br /&gt;
Note: You &#039;&#039;rarely&#039;&#039; need to reinstall a package on Debian&lt;br /&gt;
&lt;br /&gt;
== Searching the package database ==&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Alpine will only search package names.&lt;br /&gt;
 apk search searchword&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To search the package names and descriptions:&lt;br /&gt;
 emerge --searchdesc searchword&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; On Gentoo, it&#039;s actually much better to install and use either the esearch package or the eix package to do a search. You use them like this:&lt;br /&gt;
 eix searchword&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 esearch searchword&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 apt-cache search searchword&lt;br /&gt;
Both emerge and apt-cache search support regular expressions.&lt;br /&gt;
&lt;br /&gt;
To get the long package information on Debian (searching only in package names):&lt;br /&gt;
 apt-cache search --full --names-only searchword&lt;br /&gt;
&lt;br /&gt;
== Removing packages ==&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 apk del package1 package2&lt;br /&gt;
apk del will remove configuration files when the --purge flag is used. Make sure you have backups of your configuration files. (Using rcs might be an idea)&lt;br /&gt;
&lt;br /&gt;
You will mostly like to take a quick look at the dependencies before you remove packages recursively.&lt;br /&gt;
&lt;br /&gt;
To see dependencies for a package, use:&lt;br /&gt;
 apk info -R package1 package2&lt;br /&gt;
&lt;br /&gt;
To see if package is required by other packages (is a dependency for another packages), use:&lt;br /&gt;
 apk info -r package1 package2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 emerge --unmerge package1 package2 (Note: this is unsafe as it does not check dependencies)&lt;br /&gt;
 emerge --depclean package1 package2 (This will check dependencies)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 apt-get remove package1 package2&lt;br /&gt;
or to remove along with all configuration files&lt;br /&gt;
 apt-get remove --purge package1 package2&lt;br /&gt;
&lt;br /&gt;
== Only downloading packages ==&lt;br /&gt;
This can be useful e.g. if you&#039;re on a dial-up connection and want to download everything first and install later.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
 apk fetch package1 package2&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 emerge --fetchonly package1 package2&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 apt-get install --download-only package1 package2&lt;br /&gt;
&lt;br /&gt;
== Cleaning up downloaded packages ==&lt;br /&gt;
Compressed packages that were downloaded for installation can easily consume gigabytes of storage space.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Alpine will clean up packages automatically.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 rm -rf /var/cache/distfiles/*&lt;br /&gt;
To only remove outdated packages you will need to install the gentoolkit package and use eclean:&lt;br /&gt;
 eclean distfiles&lt;br /&gt;
Cleaning temporary files from emerging packages:&lt;br /&gt;
 rm -rf /var/tmp/portage/*&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 apt-get clean&lt;br /&gt;
Only remove outdated packages:&lt;br /&gt;
 apt-get autoclean&lt;br /&gt;
&lt;br /&gt;
==Reverse dependencies==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
apk-tools will take care of reverse dependencies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Reverse dependencies are a major drawback of Gentoo&#039;s current portage implementation: It does not take care of them at all at the moment.&lt;br /&gt;
If you use the unsafe --unmerge argument, this means that you can uninstall packages needed by others without being warned about it. E.g. you can remove the X server package without portage warning you that KDE (which you have installed as well) depends on it. This way you can actually break your entire system (e.g. by removing glibc).&lt;br /&gt;
&lt;br /&gt;
 revdep-rebuild&lt;br /&gt;
can fix broken dependencies broken by&lt;br /&gt;
emerge --depclean&lt;br /&gt;
&lt;br /&gt;
Recent versions of portage include library tracking and preservation with the preserved-libs feature.  Portage will notify you to run {{Cmd| emerge @preserved-rebuild}} to help rebuild binaries that might otherwise become broken.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Reverse dependencies are taken care of by dpkg.&lt;br /&gt;
&lt;br /&gt;
= Runlevel &amp;amp; Initscripts =&lt;br /&gt;
Runlevels work pretty conventionally on Debian (see details: [http://archive.fo/ZdZIz systemd]). On Alpine and Gentoo, they are a bit different.&lt;br /&gt;
&lt;br /&gt;
== Directories and files ==&lt;br /&gt;
In &#039;&#039;&#039;Debian&#039;&#039;&#039;, runlevels are named conventionally (0-6 and S). They are represented by directories in /etc/ called rc*.d (when the default sysv-rc boot loader package is installed; file-rc can be installed instead, and then the relevant file is runlevel.conf).&lt;br /&gt;
&lt;br /&gt;
* /etc/rc0.d&lt;br /&gt;
* /etc/rc1.d&lt;br /&gt;
* /etc/rcS.d&lt;br /&gt;
* /etc/rc2.d&lt;br /&gt;
* /etc/rc3.d&lt;br /&gt;
* /etc/rc4.d&lt;br /&gt;
* /etc/rc5.d&lt;br /&gt;
* /etc/rc6.d&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;Gentoo&#039;&#039;&#039;, runlevels have the same names, but these are mapped to more self explanatory ones (in /etc/inittab): &amp;quot;boot&amp;quot;, &amp;quot;default&amp;quot;, &amp;quot;nonetwork&amp;quot;, with the option to add more. The directories that represent them are in &lt;br /&gt;
/etc/runlevels/:&lt;br /&gt;
* /etc/runlevels/boot&lt;br /&gt;
* /etc/runlevels/default&lt;br /&gt;
* /etc/runlevels/nonetwork&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;Gentoo&#039;&#039;&#039;, if a service is not explicitly started in a runlevel, it is stopped when switching to that runlevel! There is no explicit stopping of runlevels as in Debian (/etc/rc?.d/K??service).&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;both Debian and Gentoo&#039;&#039;&#039;, which things are started (and stopped) in which runlevels is controlled by links in the runlevel directories to scripts in /etc/init.d/, e.g.:&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 $ ls -l /etc/runlevels/boot/hostname&lt;br /&gt;
 lrwxrwxrwx  1 root root 20 Mar 25  2004 /etc/runlevels/boot/hostname -&amp;gt; /etc/init.d/hostname&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 $ ls -l rcS.d/S40hostname.sh&lt;br /&gt;
 lrwxrwxrwx  1 root root 21 2004-11-07 00:19 rcS.d/S40hostname.sh -&amp;gt; ../init.d/hostname.sh&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
In Alpine, runlevels work like they do in Gentoo:&lt;br /&gt;
&lt;br /&gt;
* /etc/runlevels/boot&lt;br /&gt;
* /etc/runlevels/default&lt;br /&gt;
* /etc/runlevels/sysinit&lt;br /&gt;
* /etc/runlevels/nonetwork&lt;br /&gt;
* /etc/runlevels/shutdown&lt;br /&gt;
&lt;br /&gt;
== Runlevel management ==&lt;br /&gt;
To manage which things to start in which runlevels, use the following commands:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To see current status of services in runlevels, do:&lt;br /&gt;
 rc-status&lt;br /&gt;
To add sshd to default runlevel, do:&lt;br /&gt;
 rc-update add -k sshd default&lt;br /&gt;
The -k option will make sure sshd is stopped when shutting down or reboot.&lt;br /&gt;
To remove sshd from all runlevels do:&lt;br /&gt;
 rc-update del sshd&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rc-update&lt;br /&gt;
To add the cupsd to the default runlevel, do:&lt;br /&gt;
 rc-update add cupsd default&lt;br /&gt;
To remove alsasound from the boot runlevel, do:&lt;br /&gt;
 rc-update del alsasound boot&lt;br /&gt;
Also see this wiki page about [http://gentoo-wiki.com/Rc-update gentoo runlevel management with rc-update]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 update-rc.d&lt;br /&gt;
Configure cupsd to be started in runlevels 2, 3, 4, 5, and stopped in 0, 1, 6, with sequence code 20:&lt;br /&gt;
 update-rc.d cupsd start 20 2 3 4 5 . stop 20 0 1 6 . &lt;br /&gt;
or simply:&lt;br /&gt;
 update-rc.d cupsd defaults &lt;br /&gt;
Remove cupsd from all runlevels:&lt;br /&gt;
 update-rc.d -f cupsd remove&lt;br /&gt;
&lt;br /&gt;
= Config Files =&lt;br /&gt;
&lt;br /&gt;
== /etc/portage/make.conf and use flags ==&lt;br /&gt;
While in Gentoo there&#039;s a large number of configuration files which control the behaviour of the package management system, there are comparatively fewer in Debian, as there is no need to dictate how to compile software which is downloaded and tweak/alter it. In Gentoo, the file /etc/portage/make.conf is used for much configuration; this includes &#039;&#039;USE&#039;&#039; flags, which influence which elements of packages are compiled, and which libraries to build support for - common USE flags (USE or -USE to specifically negate support) include &#039;gtk gnome&#039; for Gnome users (and a corresponding -qt -kde -arts) and &#039;qt kde arts&#039; for KDE users. A Gentoo user&#039;s complete set of use flags may look something like this:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;USE=&amp;quot;-kde -arts -qt xv truetype bluetooth crypt slang readline gpm berkdb mmx gdbm tcpd pam libwww ssl nls ethereal perl python esd gif imlib sdl oggvorbis mpeg gnome gtk X motif opengl avi png tiff nptl pcmcia nptl ldap eds&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Architectures and repositories ==&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Also in /etc/portage/make.conf is the &#039;&#039;&#039;ACCEPT_KEYWORDS&#039;&#039;&#039; setting, with (for an X86-based processor) two settings, &#039;&#039;&#039;x86&#039;&#039;&#039; for stabler packages, and &#039;&#039;&#039;~x86&#039;&#039;&#039; for bleeding edge packages. It is however not recommended to make this change in /etc/portage/make.conf. Rather configure this per-package in /etc/portage/package.accept_keywords. It&#039;s enough to put a line into that file naming the package (for example &#039;app-foo/bar&#039;). That file might look like this:&lt;br /&gt;
&lt;br /&gt;
 app-crypt/gpg-agent&lt;br /&gt;
 app-text/docbook-xsl-stylesheets&lt;br /&gt;
 =app-text/docbook-xml-dtd-4.3-r1&lt;br /&gt;
&lt;br /&gt;
The last line says, that &#039;&#039;only&#039;&#039; version 4.3-r1 should be unmasked. Older and newer versions will still be ignored.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note for non-x86 users:&#039;&#039;&#039;&lt;br /&gt;
The keywords &#039;&#039;&#039;x86&#039;&#039;&#039; and &#039;&#039;&#039;~x86&#039;&#039;&#039; can of course be replaced by &#039;&#039;&#039;sparc&#039;&#039;&#039; and &#039;&#039;&#039;~sparc&#039;&#039;&#039; for example.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Setting this in Debian is slightly more complicated, and is accomplished by setting different &#039;repositories&#039; in &#039;&#039;/etc/apt/sources.list&#039;&#039; - along with which &#039;tree&#039; to use for packages; in Debian, these are &#039;&#039;&#039;stable&#039;&#039;&#039;, &#039;&#039;&#039;testing&#039;&#039;&#039;, and &#039;&#039;&#039;unstable&#039;&#039;&#039;. An &#039;&#039;/etc/apt/sources.list&#039;&#039; file for a debian testing user may look something like this:&lt;br /&gt;
&lt;br /&gt;
 deb http://mirrors.kernel.org/debian testing main non-free contrib&lt;br /&gt;
 deb ftp://ftp.nerim.net/debian-marillat testing main&lt;br /&gt;
 deb http://security.debian.org testing/updates main contrib non-free&lt;br /&gt;
&lt;br /&gt;
Alternatively, &#039;&#039;/etc/apt/sources.list&#039;&#039; can contain any number of repositories for any trees, and a default tree (this can be overridden using the -t switch on the command line) in &#039;&#039;/etc/apt/apt.conf&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
   APT::Default-Release &amp;quot;testing&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
Per-package settings go in &#039;&#039;/etc/apt/preferences&#039;&#039;, somewhat like Gentoo&#039;s &#039;&#039;/etc/portage/package.keywords&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Network ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Alpine uses /etc/network/interfaces, just like Debian. The main reason is because this is the way busybox does it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/etc/network/interfaces&#039;&#039;:&lt;br /&gt;
 auto eth0&lt;br /&gt;
 iface eth0 inet static&lt;br /&gt;
  address 192.168.0.1&lt;br /&gt;
  netmask 255.255.255.0&lt;br /&gt;
  broadcast 192.168.0.255&lt;br /&gt;
  &lt;br /&gt;
 auto eth0:0&lt;br /&gt;
 iface eth0:0 inet static&lt;br /&gt;
  address 192.168.1.1&lt;br /&gt;
  netmask 255.255.255.0&lt;br /&gt;
  broadcast 192.168.1.255&lt;br /&gt;
 # etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/etc/conf.d/net&#039;&#039;:&lt;br /&gt;
 config_eth0=&amp;quot;192.168.1.100 netmask 255.255.255.0&lt;br /&gt;
              192.168.2.100 netmask 255.255.255.0&amp;quot;&lt;br /&gt;
 routes_eth0=&amp;quot;default via 192.168.1.1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note that this has changed recently. For more information please refer to http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/etc/network/interfaces&#039;&#039;:&lt;br /&gt;
 auto eth0&lt;br /&gt;
 iface eth0 inet static&lt;br /&gt;
  address 192.168.0.1&lt;br /&gt;
  netmask 255.255.255.0&lt;br /&gt;
  broadcast 192.168.0.255&lt;br /&gt;
  &lt;br /&gt;
 auto eth0:0&lt;br /&gt;
 iface eth0:0 inet static&lt;br /&gt;
  address 192.168.1.1&lt;br /&gt;
  netmask 255.255.255.0&lt;br /&gt;
  broadcast 192.168.1.255&lt;br /&gt;
 # etc.&lt;br /&gt;
&lt;br /&gt;
= Comparison chart/Rosetta Stone =&lt;br /&gt;
&lt;br /&gt;
This chart shows how some standard things are done in Alpine compared to other distributions.&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;5&amp;quot; border=&amp;quot;1&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Action &lt;br /&gt;
! Alpine ([http://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management apk])&lt;br /&gt;
! Arch Linux ([https://wiki.archlinux.org/index.php/Pacman pacman])&lt;br /&gt;
! Gentoo ([http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&amp;amp;chap=1 emerge])&lt;br /&gt;
! Debian/Ubuntu ([http://wiki.debian.org/Aptitude aptitute])&lt;br /&gt;
! Fedora/RHEL/SL/CentOS ([http://yum.baseurl.org/wiki/YumCommands yum])&lt;br /&gt;
|-&lt;br /&gt;
| Update package database&lt;br /&gt;
| {{Cmd| apk update}}&lt;br /&gt;
| {{Cmd| pacman -Sy}}&lt;br /&gt;
| {{Cmd| emerge --sync}}&lt;br /&gt;
| {{Cmd| aptitude update}}&lt;br /&gt;
| {{Cmd| yum update}}&lt;br /&gt;
|-&lt;br /&gt;
| Showing available updates&lt;br /&gt;
| {{Cmd| apk version -l &#039;&amp;lt;&#039;}}&lt;br /&gt;
| {{Cmd| pacman -Qu}}&lt;br /&gt;
| {{Cmd| emerge --deep --update --pretend @world}}&lt;br /&gt;
| {{Cmd| aptitude upgrade --simulate}}&lt;br /&gt;
| {{Cmd| yum list updates}}&lt;br /&gt;
|-&lt;br /&gt;
| Installing packages&lt;br /&gt;
| {{Cmd| apk add [package name]}}&lt;br /&gt;
| {{Cmd| pacman -S [package name]}}&lt;br /&gt;
| {{Cmd| emerge [package name]}}&lt;br /&gt;
| {{Cmd| aptitude install [package name]}}&lt;br /&gt;
| {{Cmd| yum install [package name]}}&lt;br /&gt;
|-&lt;br /&gt;
| Update all installed packages&lt;br /&gt;
| {{Cmd| apk upgrade -U -a}}&lt;br /&gt;
| {{Cmd| pacman -Su}}&lt;br /&gt;
| {{Cmd| emerge --update --deep @world}}&lt;br /&gt;
| {{Cmd| aptitude upgrade}}&lt;br /&gt;
| {{Cmd| yum update}}&lt;br /&gt;
|- &lt;br /&gt;
| Searching package database&lt;br /&gt;
| {{Cmd| apk search -v &#039;[string]*&#039;}}&lt;br /&gt;
| {{Cmd| pacman -Ss [string]}}&lt;br /&gt;
| {{Cmd| emerge --search [string]}}&lt;br /&gt;
| {{Cmd| aptitude search [string]}}&lt;br /&gt;
| {{Cmd| yum search [string]}}&lt;br /&gt;
|-&lt;br /&gt;
| Removing packages&lt;br /&gt;
| {{Cmd| apk del [package name]}}&lt;br /&gt;
| {{Cmd| pacman -R [package name]}}&lt;br /&gt;
| {{Cmd| emerge --depclean [package name]}}&lt;br /&gt;
| {{Cmd| aptitude remove [package name]}}&lt;br /&gt;
| {{Cmd| yum remove [package name]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;/div&gt;</summary>
		<author><name>Begs</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Comparison_with_other_distros&amp;diff=19994</id>
		<title>Comparison with other distros</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Comparison_with_other_distros&amp;diff=19994"/>
		<updated>2021-08-03T17:25:54Z</updated>

		<summary type="html">&lt;p&gt;Begs: /* Updating a particular package */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Even if Alpine is designed to run from RAM, it has some similarities in package management with both Gentoo and Debian. This page outlines those similarities and differences, to help Debian and Gentoo users use Alpine.&lt;br /&gt;
&lt;br /&gt;
The page was originally copied from: http://gentoo-wiki.com/TIP_Converting_from_or_to_Debian&lt;br /&gt;
&lt;br /&gt;
= Package management =&lt;br /&gt;
Where Gentoo has portage and emerge; Debian has, among others, apt; Alpine uses apk-tools. This section compares how apk-tools is used, in comparison to apt-get/aptitude and emerge.&lt;br /&gt;
&lt;br /&gt;
Note that Gentoo is source-based, just like ports in FreeBSD are, while Debian uses pre-compiled binaries. Alpine is compiled using Gentoo&#039;s portage, but Alpine itself uses its own apk-tools binary package which is more similar to FreeBSD&#039;s binary packages.&lt;br /&gt;
&lt;br /&gt;
== Updating package database ==&lt;br /&gt;
Gentoo will update the build-from-source scripts and the updating of the database takes much more time than updating the database for Debian or Alpine.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
 apk update&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 emaint sync -a&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 aptitude update&lt;br /&gt;
&lt;br /&gt;
== Showing available updates ==&lt;br /&gt;
Show which packages have an update available:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
 apk version -v&lt;br /&gt;
or:&lt;br /&gt;
 apk version -v -l &#039;&amp;lt;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 emerge --deep --update --pretend @world&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 aptitude upgrade --simulate&lt;br /&gt;
&lt;br /&gt;
== Updating a particular package ==&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
 apk add -u package1 package2&lt;br /&gt;
or&lt;br /&gt;
 apk upgrade package1 package2&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 aptitude install package1 package2&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 emerge --update package1 package2&lt;br /&gt;
&lt;br /&gt;
== Installing packages ==&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
 apk add package1 package2&lt;br /&gt;
&lt;br /&gt;
For source compile, see the [[Aports tree]] and the [[abuild]] tool.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 emerge package1 package2&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 apt-get install package1 package2&lt;br /&gt;
Debian source compile:&lt;br /&gt;
 apt-get build-dep package1&lt;br /&gt;
 apt-get source package1&lt;br /&gt;
(optional: customize the build by modifying the debian/rules makefile)&lt;br /&gt;
(or set environmental variables like DEB_BUILD_OPTIONS)&lt;br /&gt;
(note that this will make your bug reports invalid to the maintainer)&lt;br /&gt;
 dpkg-buildpackage -rfakeroot -uc -b&lt;br /&gt;
 dpkg -i generatedpackagename&lt;br /&gt;
Simplified source compile:&lt;br /&gt;
 apt-get build-dep package1&lt;br /&gt;
 apt-get -b source package1&lt;br /&gt;
(the packages are automatically generated using the -b switch above)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This process can be used to backport packages from testing and unstable by simply adding their respective source repositories to sources.list, which is similar to adding ~x86 to package.keywords in Gentoo. This is explored further in the &amp;quot;Architectures and repositories&amp;quot; section below.&lt;br /&gt;
&lt;br /&gt;
== Reinstalling a particular package ==&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
 apk del package1 &amp;amp;&amp;amp; apk add package1&lt;br /&gt;
or:&lt;br /&gt;
 apk fix package1 package1&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 emerge --oneshot package1&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 apt-get install --reinstall package1 package1&lt;br /&gt;
&lt;br /&gt;
Note: You &#039;&#039;rarely&#039;&#039; need to reinstall a package on Debian&lt;br /&gt;
&lt;br /&gt;
== Searching the package database ==&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Alpine will only search package names.&lt;br /&gt;
 apk search searchword&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To search the package names and descriptions:&lt;br /&gt;
 emerge --searchdesc searchword&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; On Gentoo, it&#039;s actually much better to install and use either the esearch package or the eix package to do a search. You use them like this:&lt;br /&gt;
 eix searchword&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 esearch searchword&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 apt-cache search searchword&lt;br /&gt;
Both emerge and apt-cache search support regular expressions.&lt;br /&gt;
&lt;br /&gt;
To get the long package information on Debian (searching only in package names):&lt;br /&gt;
 apt-cache search --full --names-only searchword&lt;br /&gt;
&lt;br /&gt;
== Removing packages ==&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 apk del package1 package2&lt;br /&gt;
apk del will remove configuration files when the --purge flag is used. Make sure you have backups of your configuration files. (Using rcs might be an idea)&lt;br /&gt;
&lt;br /&gt;
You will mostly like to take a quick look at the dependencies before you remove packages recursively.&lt;br /&gt;
&lt;br /&gt;
To see dependencies for a package, use:&lt;br /&gt;
 apk info -R package1 package2&lt;br /&gt;
&lt;br /&gt;
To see if package is required by other packages (is a dependency for another packages), use:&lt;br /&gt;
 apk info -r package1 package2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 emerge --unmerge package1 package2 (Note: this is unsafe as it does not check dependencies)&lt;br /&gt;
 emerge --depclean package1 package2 (This will check dependencies)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 apt-get remove package1 package2&lt;br /&gt;
or to remove along with all configuration files&lt;br /&gt;
 apt-get remove --purge package1 package2&lt;br /&gt;
&lt;br /&gt;
== Only downloading packages ==&lt;br /&gt;
This can be useful e.g. if you&#039;re on a dial-up connection and want to download everything first and install later.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
 apk fetch package1 package2&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 emerge --fetchonly package1 package2&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 apt-get install --download-only package1 package2&lt;br /&gt;
&lt;br /&gt;
== Cleaning up downloaded packages ==&lt;br /&gt;
Compressed packages that were downloaded for installation can easily consume gigabytes of storage space.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Alpine will clean up packages automatically.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 rm -rf /var/cache/distfiles/*&lt;br /&gt;
To only remove outdated packages you will need to install the gentoolkit package and use eclean:&lt;br /&gt;
 eclean distfiles&lt;br /&gt;
Cleaning temporary files from emerging packages:&lt;br /&gt;
 rm -rf /var/tmp/portage/*&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 apt-get clean&lt;br /&gt;
Only remove outdated packages:&lt;br /&gt;
 apt-get autoclean&lt;br /&gt;
&lt;br /&gt;
==Reverse dependencies==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
apk-tools will take care of reverse dependencies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Reverse dependencies are a major drawback of Gentoo&#039;s current portage implementation: It does not take care of them at all at the moment.&lt;br /&gt;
If you use the unsafe --unmerge argument, this means that you can uninstall packages needed by others without being warned about it. E.g. you can remove the X server package without portage warning you that KDE (which you have installed as well) depends on it. This way you can actually break your entire system (e.g. by removing glibc).&lt;br /&gt;
&lt;br /&gt;
 revdep-rebuild&lt;br /&gt;
can fix broken dependencies broken by&lt;br /&gt;
emerge --depclean&lt;br /&gt;
&lt;br /&gt;
Recent versions of portage include library tracking and preservation with the preserved-libs feature.  Portage will notify you to run {{Cmd| emerge @preserved-rebuild}} to help rebuild binaries that might otherwise become broken.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Reverse dependencies are taken care of by dpkg.&lt;br /&gt;
&lt;br /&gt;
= Runlevel &amp;amp; Initscripts =&lt;br /&gt;
Runlevels work pretty conventionally on Debian (see details: [http://archive.fo/ZdZIz systemd]). On Alpine and Gentoo, they are a bit different.&lt;br /&gt;
&lt;br /&gt;
== Directories and files ==&lt;br /&gt;
In &#039;&#039;&#039;Debian&#039;&#039;&#039;, runlevels are named conventionally (0-6 and S). They are represented by directories in /etc/ called rc*.d (when the default sysv-rc boot loader package is installed; file-rc can be installed instead, and then the relevant file is runlevel.conf).&lt;br /&gt;
&lt;br /&gt;
* /etc/rc0.d&lt;br /&gt;
* /etc/rc1.d&lt;br /&gt;
* /etc/rcS.d&lt;br /&gt;
* /etc/rc2.d&lt;br /&gt;
* /etc/rc3.d&lt;br /&gt;
* /etc/rc4.d&lt;br /&gt;
* /etc/rc5.d&lt;br /&gt;
* /etc/rc6.d&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;Gentoo&#039;&#039;&#039;, runlevels have the same names, but these are mapped to more self explanatory ones (in /etc/inittab): &amp;quot;boot&amp;quot;, &amp;quot;default&amp;quot;, &amp;quot;nonetwork&amp;quot;, with the option to add more. The directories that represent them are in &lt;br /&gt;
/etc/runlevels/:&lt;br /&gt;
* /etc/runlevels/boot&lt;br /&gt;
* /etc/runlevels/default&lt;br /&gt;
* /etc/runlevels/nonetwork&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;Gentoo&#039;&#039;&#039;, if a service is not explicitly started in a runlevel, it is stopped when switching to that runlevel! There is no explicit stopping of runlevels as in Debian (/etc/rc?.d/K??service).&lt;br /&gt;
&lt;br /&gt;
In &#039;&#039;&#039;both Debian and Gentoo&#039;&#039;&#039;, which things are started (and stopped) in which runlevels is controlled by links in the runlevel directories to scripts in /etc/init.d/, e.g.:&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
 $ ls -l /etc/runlevels/boot/hostname&lt;br /&gt;
 lrwxrwxrwx  1 root root 20 Mar 25  2004 /etc/runlevels/boot/hostname -&amp;gt; /etc/init.d/hostname&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
 $ ls -l rcS.d/S40hostname.sh&lt;br /&gt;
 lrwxrwxrwx  1 root root 21 2004-11-07 00:19 rcS.d/S40hostname.sh -&amp;gt; ../init.d/hostname.sh&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
In Alpine, runlevels work like they do in Gentoo:&lt;br /&gt;
&lt;br /&gt;
* /etc/runlevels/boot&lt;br /&gt;
* /etc/runlevels/default&lt;br /&gt;
* /etc/runlevels/sysinit&lt;br /&gt;
* /etc/runlevels/nonetwork&lt;br /&gt;
* /etc/runlevels/shutdown&lt;br /&gt;
&lt;br /&gt;
== Runlevel management ==&lt;br /&gt;
To manage which things to start in which runlevels, use the following commands:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To see current status of services in runlevels, do:&lt;br /&gt;
 rc-status&lt;br /&gt;
To add sshd to default runlevel, do:&lt;br /&gt;
 rc-update add -k sshd default&lt;br /&gt;
The -k option will make sure sshd is stopped when shutting down or reboot.&lt;br /&gt;
To remove sshd from all runlevels do:&lt;br /&gt;
 rc-update del sshd&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 rc-update&lt;br /&gt;
To add the cupsd to the default runlevel, do:&lt;br /&gt;
 rc-update add cupsd default&lt;br /&gt;
To remove alsasound from the boot runlevel, do:&lt;br /&gt;
 rc-update del alsasound boot&lt;br /&gt;
Also see this wiki page about [http://gentoo-wiki.com/Rc-update gentoo runlevel management with rc-update]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 update-rc.d&lt;br /&gt;
Configure cupsd to be started in runlevels 2, 3, 4, 5, and stopped in 0, 1, 6, with sequence code 20:&lt;br /&gt;
 update-rc.d cupsd start 20 2 3 4 5 . stop 20 0 1 6 . &lt;br /&gt;
or simply:&lt;br /&gt;
 update-rc.d cupsd defaults &lt;br /&gt;
Remove cupsd from all runlevels:&lt;br /&gt;
 update-rc.d -f cupsd remove&lt;br /&gt;
&lt;br /&gt;
= Config Files =&lt;br /&gt;
&lt;br /&gt;
== /etc/portage/make.conf and use flags ==&lt;br /&gt;
While in Gentoo there&#039;s a large number of configuration files which control the behaviour of the package management system, there are comparatively fewer in Debian, as there is no need to dictate how to compile software which is downloaded and tweak/alter it. In Gentoo, the file /etc/portage/make.conf is used for much configuration; this includes &#039;&#039;USE&#039;&#039; flags, which influence which elements of packages are compiled, and which libraries to build support for - common USE flags (USE or -USE to specifically negate support) include &#039;gtk gnome&#039; for Gnome users (and a corresponding -qt -kde -arts) and &#039;qt kde arts&#039; for KDE users. A Gentoo user&#039;s complete set of use flags may look something like this:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;USE=&amp;quot;-kde -arts -qt xv truetype bluetooth crypt slang readline gpm berkdb mmx gdbm tcpd pam libwww ssl nls ethereal perl python esd gif imlib sdl oggvorbis mpeg gnome gtk X motif opengl avi png tiff nptl pcmcia nptl ldap eds&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Architectures and repositories ==&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Also in /etc/portage/make.conf is the &#039;&#039;&#039;ACCEPT_KEYWORDS&#039;&#039;&#039; setting, with (for an X86-based processor) two settings, &#039;&#039;&#039;x86&#039;&#039;&#039; for stabler packages, and &#039;&#039;&#039;~x86&#039;&#039;&#039; for bleeding edge packages. It is however not recommended to make this change in /etc/portage/make.conf. Rather configure this per-package in /etc/portage/package.accept_keywords. It&#039;s enough to put a line into that file naming the package (for example &#039;app-foo/bar&#039;). That file might look like this:&lt;br /&gt;
&lt;br /&gt;
 app-crypt/gpg-agent&lt;br /&gt;
 app-text/docbook-xsl-stylesheets&lt;br /&gt;
 =app-text/docbook-xml-dtd-4.3-r1&lt;br /&gt;
&lt;br /&gt;
The last line says, that &#039;&#039;only&#039;&#039; version 4.3-r1 should be unmasked. Older and newer versions will still be ignored.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note for non-x86 users:&#039;&#039;&#039;&lt;br /&gt;
The keywords &#039;&#039;&#039;x86&#039;&#039;&#039; and &#039;&#039;&#039;~x86&#039;&#039;&#039; can of course be replaced by &#039;&#039;&#039;sparc&#039;&#039;&#039; and &#039;&#039;&#039;~sparc&#039;&#039;&#039; for example.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Setting this in Debian is slightly more complicated, and is accomplished by setting different &#039;repositories&#039; in &#039;&#039;/etc/apt/sources.list&#039;&#039; - along with which &#039;tree&#039; to use for packages; in Debian, these are &#039;&#039;&#039;stable&#039;&#039;&#039;, &#039;&#039;&#039;testing&#039;&#039;&#039;, and &#039;&#039;&#039;unstable&#039;&#039;&#039;. An &#039;&#039;/etc/apt/sources.list&#039;&#039; file for a debian testing user may look something like this:&lt;br /&gt;
&lt;br /&gt;
 deb http://mirrors.kernel.org/debian testing main non-free contrib&lt;br /&gt;
 deb ftp://ftp.nerim.net/debian-marillat testing main&lt;br /&gt;
 deb http://security.debian.org testing/updates main contrib non-free&lt;br /&gt;
&lt;br /&gt;
Alternatively, &#039;&#039;/etc/apt/sources.list&#039;&#039; can contain any number of repositories for any trees, and a default tree (this can be overridden using the -t switch on the command line) in &#039;&#039;/etc/apt/apt.conf&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
   APT::Default-Release &amp;quot;testing&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
Per-package settings go in &#039;&#039;/etc/apt/preferences&#039;&#039;, somewhat like Gentoo&#039;s &#039;&#039;/etc/portage/package.keywords&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Network ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alpine&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Alpine uses /etc/network/interfaces, just like Debian. The main reason is because this is the way busybox does it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/etc/network/interfaces&#039;&#039;:&lt;br /&gt;
 auto eth0&lt;br /&gt;
 iface eth0 inet static&lt;br /&gt;
  address 192.168.0.1&lt;br /&gt;
  netmask 255.255.255.0&lt;br /&gt;
  broadcast 192.168.0.255&lt;br /&gt;
  &lt;br /&gt;
 auto eth0:0&lt;br /&gt;
 iface eth0:0 inet static&lt;br /&gt;
  address 192.168.1.1&lt;br /&gt;
  netmask 255.255.255.0&lt;br /&gt;
  broadcast 192.168.1.255&lt;br /&gt;
 # etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Gentoo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/etc/conf.d/net&#039;&#039;:&lt;br /&gt;
 config_eth0=&amp;quot;192.168.1.100 netmask 255.255.255.0&lt;br /&gt;
              192.168.2.100 netmask 255.255.255.0&amp;quot;&lt;br /&gt;
 routes_eth0=&amp;quot;default via 192.168.1.1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note that this has changed recently. For more information please refer to http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Debian&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;/etc/network/interfaces&#039;&#039;:&lt;br /&gt;
 auto eth0&lt;br /&gt;
 iface eth0 inet static&lt;br /&gt;
  address 192.168.0.1&lt;br /&gt;
  netmask 255.255.255.0&lt;br /&gt;
  broadcast 192.168.0.255&lt;br /&gt;
  &lt;br /&gt;
 auto eth0:0&lt;br /&gt;
 iface eth0:0 inet static&lt;br /&gt;
  address 192.168.1.1&lt;br /&gt;
  netmask 255.255.255.0&lt;br /&gt;
  broadcast 192.168.1.255&lt;br /&gt;
 # etc.&lt;br /&gt;
&lt;br /&gt;
= Comparison chart/Rosetta Stone =&lt;br /&gt;
&lt;br /&gt;
This chart shows how some standard things are done in Alpine compared to other distributions.&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;5&amp;quot; border=&amp;quot;1&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Action &lt;br /&gt;
! Alpine ([http://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management apk])&lt;br /&gt;
! Arch Linux ([https://wiki.archlinux.org/index.php/Pacman pacman])&lt;br /&gt;
! Gentoo ([http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&amp;amp;chap=1 emerge])&lt;br /&gt;
! Debian/Ubuntu ([http://wiki.debian.org/Aptitude aptitute])&lt;br /&gt;
! Fedora/RHEL/SL/CentOS ([http://yum.baseurl.org/wiki/YumCommands yum])&lt;br /&gt;
|-&lt;br /&gt;
| Update package database&lt;br /&gt;
| {{Cmd| apk update}}&lt;br /&gt;
| {{Cmd| pacman -Sy}}&lt;br /&gt;
| {{Cmd| emerge --sync}}&lt;br /&gt;
| {{Cmd| aptitude update}}&lt;br /&gt;
| {{Cmd| yum update}}&lt;br /&gt;
|-&lt;br /&gt;
| Showing available updates&lt;br /&gt;
| {{Cmd| apk version -l &#039;&amp;lt;&#039;}}&lt;br /&gt;
| {{Cmd| pacman -Qu}}&lt;br /&gt;
| {{Cmd| emerge --deep --update --pretend @world}}&lt;br /&gt;
| {{Cmd| aptitude upgrade --simulate}}&lt;br /&gt;
| {{Cmd| yum list updates}}&lt;br /&gt;
|-&lt;br /&gt;
| Installing packages&lt;br /&gt;
| {{Cmd| apk add [package name]}}&lt;br /&gt;
| {{Cmd| pacman -S [package name]}}&lt;br /&gt;
| {{Cmd| emerge [package name]}}&lt;br /&gt;
| {{Cmd| aptitude install [package name]}}&lt;br /&gt;
| {{Cmd| yum install [package name]}}&lt;br /&gt;
|-&lt;br /&gt;
| Update all installed packages&lt;br /&gt;
| {{Cmd| apk upgrade -U -a}}&lt;br /&gt;
| {{Cmd| pacman -Su}}&lt;br /&gt;
| {{Cmd| emerge --update --deep @world}}&lt;br /&gt;
| {{Cmd| aptitude upgrade}}&lt;br /&gt;
| {{Cmd| yum update}}&lt;br /&gt;
|- &lt;br /&gt;
| Searching package database&lt;br /&gt;
| {{Cmd| apk search -v &#039;[string]*&#039;}}&lt;br /&gt;
| {{Cmd| pacman -Ss [string]}}&lt;br /&gt;
| {{Cmd| emerge --search [string]}}&lt;br /&gt;
| {{Cmd| aptitude search [string]}}&lt;br /&gt;
| {{Cmd| yum search [string]}}&lt;br /&gt;
|-&lt;br /&gt;
| Removing packages&lt;br /&gt;
| {{Cmd| apk del [package name]}}&lt;br /&gt;
| {{Cmd| pacman -R [package name]}}&lt;br /&gt;
| {{Cmd| emerge --depclean [package name]}}&lt;br /&gt;
| {{Cmd| aptitude remove [package name]}}&lt;br /&gt;
| {{Cmd| yum remove [package name]}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;/div&gt;</summary>
		<author><name>Begs</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=LVM_on_LUKS&amp;diff=19522</id>
		<title>LVM on LUKS</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=LVM_on_LUKS&amp;diff=19522"/>
		<updated>2021-05-21T16:14:04Z</updated>

		<summary type="html">&lt;p&gt;Begs: Remove outdated note&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
This documentation describes how to set up Alpine Linux on a fully encrypted disk (apart from the bootloader&#039;s partition). We will have an LVM container installed inside an encrypted partition. To encrypt the partition containing the LVM volume group, dm-crypt (which is managed by the &amp;lt;code&amp;gt;cryptsetup&amp;lt;/code&amp;gt; command) and its LUKS subsystem is used.&lt;br /&gt;
&lt;br /&gt;
Note that your &amp;lt;code&amp;gt;/boot/&amp;lt;/code&amp;gt; partition must be non-encrypted to work with Syslinux. When using GRUB2 it is possible to boot from an encrypted partition to provide a layer of protection from [https://en.wikipedia.org/wiki/Evil_maid_attack Evil Maid attacks], but Syslinux doesn&#039;t support this.&lt;br /&gt;
&lt;br /&gt;
== Storage Device Name ==&lt;br /&gt;
&lt;br /&gt;
To find your storage device&#039;s name, you could either install &amp;lt;code&amp;gt;util-linux&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;apk add util-linux&amp;lt;/code&amp;gt;) and find your device using the &amp;lt;code&amp;gt;lspci&amp;lt;/code&amp;gt; command, or you could make an educated guess by using BusyBox&#039;s &amp;lt;code&amp;gt;blkid&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;df&amp;lt;/code&amp;gt; commands, and running &amp;lt;code&amp;gt;ls /dev/sd*&amp;lt;/code&amp;gt; if you are installing to a USB, SATA or SCSI device, &amp;lt;code&amp;gt;ls /dev/fd*&amp;lt;/code&amp;gt; for floppy disks and &amp;lt;code&amp;gt;ls /dev/hd*&amp;lt;/code&amp;gt; for IDE (PATA) devices.&lt;br /&gt;
&lt;br /&gt;
The following documentation uses the &amp;lt;code&amp;gt;/dev/sda&amp;lt;/code&amp;gt; device as installation destination. If your environment uses a different device name for your storage device, use the corresponding device names in the examples.&lt;br /&gt;
&lt;br /&gt;
= Setting up Alpine Linux Using LVM on Top of a LUKS Partition =&lt;br /&gt;
&lt;br /&gt;
To install Alpine Linux in logical volumes running on top of a LUKS encrypted partition, you cannot use the [[Installation|official installation]] procedure. The installation requires several manual steps you must run in the Alpine Linux Live CD environment.&lt;br /&gt;
&lt;br /&gt;
== Preparing the Temporary Installation Environment ==&lt;br /&gt;
&lt;br /&gt;
Before you begin to install Alpine Linux, prepare the temporary environment:&lt;br /&gt;
&lt;br /&gt;
Boot the latest Alpine Linux Installation CD. At the login prompt, use the &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; user without a password to log in. Now we will follow the [[Setup-alpine]] script and make our changes along the way.&lt;br /&gt;
&lt;br /&gt;
Run the scripts in this order:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# setup-keymap&lt;br /&gt;
# setup-hostname&lt;br /&gt;
# setup-interfaces&lt;br /&gt;
# rc-service networking start&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are configuring static networking (you didn&#039;t configure any interfaces to use DHCP), run &amp;lt;code&amp;gt;setup-dns&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you are using Wi-Fi you may need to do run &amp;lt;code&amp;gt;rc-update add wpa_supplicant boot&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# passwd&lt;br /&gt;
# setup-timezone&lt;br /&gt;
# rc-update add networking boot&lt;br /&gt;
# rc-update add urandom boot&lt;br /&gt;
# rc-update add acpid default&lt;br /&gt;
# rc-service acpid start&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit your {{Path|/etc/hosts}} to look like this, replacing &amp;lt;hostname&amp;gt; with your hostname and &amp;lt;domain&amp;gt; with your TLD (if you don&#039;t have a TLD, use &#039;localdomain&#039;:&lt;br /&gt;
{{Tip|The default text editor in BusyBox is &amp;lt;code&amp;gt;vi&amp;lt;/code&amp;gt; (pronounced &#039;&#039;vee-eye&#039;&#039;).}}&lt;br /&gt;
{{Cat|/etc/hosts|127.0.0.1       &amp;lt;hostname&amp;gt; &amp;lt;hostname&amp;gt;.&amp;lt;domain&amp;gt; localhost localhost.localdomain&lt;br /&gt;
::1             &amp;lt;hostname&amp;gt; &amp;lt;hostname&amp;gt;.&amp;lt;domain&amp;gt; localhost localhost.localdomain}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# setup-apkrepos&lt;br /&gt;
# apk update&lt;br /&gt;
# setup-sshd&lt;br /&gt;
# setup-ntp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we will deviate from the install script.&lt;br /&gt;
&lt;br /&gt;
Install the following packages required to set up LVM and LUKS:&lt;br /&gt;
&lt;br /&gt;
{{Note|The &amp;lt;code&amp;gt;parted&amp;lt;/code&amp;gt; partition editor is needed for advanced partitioning and GPT disklabels. BusyBox &amp;lt;code&amp;gt;fdisk&amp;lt;/code&amp;gt; is a very stripped-down version with minimal functionality}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# apk add lvm2 cryptsetup e2fsprogs parted&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optionally, if you want to overwrite your storage with random data first, install &amp;lt;code&amp;gt;haveged&amp;lt;/code&amp;gt;, which is a random number generator based on hardware events and has a higher throughput than &amp;lt;code&amp;gt;/dev/urandom&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# apk add haveged&lt;br /&gt;
# rc-service haveged start&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating the Partition Layout ==&lt;br /&gt;
&lt;br /&gt;
Depending on your motherboard and bios features and configuration&lt;br /&gt;
we can either use partition table in MBR (legacy BIOS)&lt;br /&gt;
or GUID Partition Table (GPT).&lt;br /&gt;
Here we will describe those two with example layouts.&lt;br /&gt;
&lt;br /&gt;
=== BIOS/MBR with DOS disklabel ===&lt;br /&gt;
&lt;br /&gt;
We will be partitioning the storage device with a non-encrypted &amp;lt;code&amp;gt;/boot&amp;lt;/code&amp;gt; partition for use with the Syslinux bootloader. Syslinux is meant for use with legacy BIOS and the MSDOS MBR partition table. Syslinux does support GPT partition tables but GRUB2 is the better option for UEFI (UEFI is only possible with GPT).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;+---------------------------+------------------------+-----------------------+&lt;br /&gt;
| Partition name            | Partition purpose      | Filesystem type       |&lt;br /&gt;
+---------------------------+------------------------+-----------------------+&lt;br /&gt;
| /dev/sda1                 | Boot partition         | ext4                  |&lt;br /&gt;
| /dev/sda2                 | LUKS container         | LUKS                  |&lt;br /&gt;
| |-&amp;gt; /dev/mapper/lvmcrypt  | LVM container          | LVM                   |&lt;br /&gt;
|  |-&amp;gt; /dev/vg01/root       | Root partition         | ext4                  |&lt;br /&gt;
|  |-&amp;gt; /dev/vg01/swap       | Swap partition         | swap                  |&lt;br /&gt;
+---------------------------+------------------------+-----------------------+&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Warning|This will delete your previous partitioning table and make your data very hard to recover. If you want to dual boot, stop here and ask an expert.}}&lt;br /&gt;
&lt;br /&gt;
Create an approx. 100MB partition to boot off, then assign the rest of the space to your LUKS partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# parted -a optimal&lt;br /&gt;
(parted) mklabel msdos&lt;br /&gt;
(parted) mkpart primary ext4 0% 100M&lt;br /&gt;
(parted) name 1 boot&lt;br /&gt;
(parted) set 1 boot on&lt;br /&gt;
(parted) mkpart primary ext4 100M 100%&lt;br /&gt;
(parted) name 2 crypto-luks&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To view your partition table, type &amp;lt;code&amp;gt;print&amp;lt;/code&amp;gt; while still in &amp;lt;code&amp;gt;parted&amp;lt;/code&amp;gt;. Your results should look something like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;(parted) print&lt;br /&gt;
Model: ATA TOSHIBA ******** (scsi)&lt;br /&gt;
Disk /dev/sda: 1000GB&lt;br /&gt;
Sector size (logical/physical): 512B/4096B&lt;br /&gt;
Partition Table: msdos&lt;br /&gt;
Disk Flags:&lt;br /&gt;
&lt;br /&gt;
Number  Start   End     Size    Type     File system  Flags&lt;br /&gt;
 1      1049kB  99.6MB  98.6MB  primary  ext4         boot&lt;br /&gt;
 2      99.6MB  1000GB  1000GB  primary  ext4&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== UEFI with GPT disklabel ===&lt;br /&gt;
&lt;br /&gt;
We will be encrypting the whole disk but the EFI system partition mounted at &amp;lt;code&amp;gt;/boot/efi&amp;lt;/code&amp;gt;. This means that GRUB2 will decrypt the LUKS volume and load the kernel from there, preventing someone with physical access to your computer from maliciously installing a rootkit (or bootkit) in your boot partition while your computer is not already unlocked. The partitioning scheme will look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;+---------------------------+------------------------+-----------------------+&lt;br /&gt;
| Partition name            | Partition purpose      | Filesystem type       |&lt;br /&gt;
+---------------------------+------------------------+-----------------------+&lt;br /&gt;
| /dev/sda1                 | EFI system partition   | fat32                 |&lt;br /&gt;
| /dev/sda2                 | LUKS container         | LUKS                  |&lt;br /&gt;
| |-&amp;gt; /dev/mapper/lvmcrypt  | LVM container          | LVM                   |&lt;br /&gt;
|  |-&amp;gt; /dev/vg01/root       | Root partition         | ext4                  |&lt;br /&gt;
|  |-&amp;gt; /dev/vg01/boot       | Boot partition         | ext4                  |&lt;br /&gt;
|  |-&amp;gt; /dev/vg01/swap       | Swap partition         | swap                  |&lt;br /&gt;
+---------------------------+------------------------+-----------------------+&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Warning|This will delete your previous partitioning table and make your data very hard to recover. If you want to dual boot, stop here and ask an expert.}}&lt;br /&gt;
&lt;br /&gt;
Create an approx. 200MB EFI system partition, then assign the rest of the space to your LUKS partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# parted -a optimal&lt;br /&gt;
(parted) mklabel gpt&lt;br /&gt;
(parted) mkpart primary fat32 0% 200M&lt;br /&gt;
(parted) name 1 esp&lt;br /&gt;
(parted) set 1 esp on&lt;br /&gt;
(parted) mkpart primary ext4 200M 100%&lt;br /&gt;
(parted) name 2 crypto-luks&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Optional: Overwrite LUKS Partition with Random Data ==&lt;br /&gt;
&lt;br /&gt;
This should be done if your hard drive wasn&#039;t encrypted previously. It helps purge old, non-encrypted data and makes it harder for an attacker to work out how much data you have on your drive if they have access to the encrypted contents.&lt;br /&gt;
&lt;br /&gt;
We will be using &amp;lt;code&amp;gt;haveged&amp;lt;/code&amp;gt; as it is considerably faster than &amp;lt;code&amp;gt;/dev/urandom&amp;lt;/code&amp;gt; when generating pseudo-random numbers (it&#039;s almost as high as &amp;lt;code&amp;gt;/dev/zero&amp;lt;/code&amp;gt; in throughput), and is (supposedly) very close to truly random.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# haveged -n 0 | dd of=/dev/sda2&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Encrypting the LVM Physical Volume Partition == &lt;br /&gt;
&lt;br /&gt;
To encrypt the partition which will later contain the LVM PV, you could either use the default settings (aes-xts-plain64 cipher with 256-bit key and Argon2 hashing with iter-time 2000ms), or you could use these settings which have added security with the trade-off being a non-noticeable decrease in performance in modern computers:&lt;br /&gt;
&lt;br /&gt;
Default settings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cryptsetup luksFormat /dev/sda2&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optimized for security:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cryptsetup -v -c serpent-xts-plain64 -s 512 --hash whirlpool --iter-time 5000 --use-random luksFormat /dev/sda2&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If using at least Alpine v3.11 and GRUB2 with encrypted /boot, the following should be used instead (because GRUB2 does not yet support LUKS2 containers):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cryptsetup luksFormat --type luks1 /dev/sda2&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating the Logical Volumes and File Systems ==&lt;br /&gt;
&lt;br /&gt;
Open the LUKS partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cryptsetup luksOpen /dev/sda2 lvmcrypt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the PV on &amp;lt;code&amp;gt;lvmcrypt&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# pvcreate /dev/mapper/lvmcrypt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the &amp;lt;code&amp;gt;vg0&amp;lt;/code&amp;gt; LVM VG in the &amp;lt;code&amp;gt;/dev/mapper/lvmcrypt&amp;lt;/code&amp;gt; PV:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vgcreate vg0 /dev/mapper/lvmcrypt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LV Creation for BIOS/MBR ===&lt;br /&gt;
&lt;br /&gt;
This will create a 2GB swap partition and a root partition which takes up the rest of the space. This setup is for those who do not need to use the hibernate/suspend to disk state. If you do need to suspend to disk, create a swap partition slightly larger than the size of your RAM (change the size after &amp;lt;code&amp;gt;# lvcreate -L&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# lvcreate -L 2G vg0 -n swap&lt;br /&gt;
# lvcreate -l 100%FREE vg0 -n root&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LVs created in the previous steps are automatically marked active. To verify, enter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# lvscan&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LV Creation for UEFI/GPT ===&lt;br /&gt;
&lt;br /&gt;
This will create a 2GB swap partition, a 2GB boot partition and a root partition which takes up the rest of the space. This setup is for those who do not need to use the hibernate/suspend to disk state. If you do need to suspend to disk, create a swap partition slightly larger than the size of your RAM (change the size after &amp;lt;code&amp;gt;# lvcreate -L&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# lvcreate -L 2G vg0 -n swap&lt;br /&gt;
# lvcreate -L 2G vg0 -n boot&lt;br /&gt;
# lvcreate -l 100%FREE vg0 -n root&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LVs created in the previous steps are automatically marked active. To verify, enter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# lvscan&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating and Mounting the File Systems ==&lt;br /&gt;
&lt;br /&gt;
Format the &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;boot&amp;lt;/code&amp;gt; LVs using the ext4 file system:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# mkfs.ext4 /dev/vg0/root&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Format the swap LV:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# mkswap /dev/vg0/swap&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before you can install Alpine Linux, you must mount the partitions and LVs. Mount the root LV to the &amp;lt;code&amp;gt;/mnt/&amp;lt;/code&amp;gt; directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# mount -t ext4 /dev/vg0/root /mnt/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next format your boot partition, create a mount point and mount it:&lt;br /&gt;
&lt;br /&gt;
* If you&#039;re using BIOS and MBR:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# mkfs.ext4 /dev/sda1&lt;br /&gt;
# mkdir -v /mnt/boot&lt;br /&gt;
# mount -t ext4 /dev/sda1 /mnt/boot&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you&#039;re using UEFI and GPT:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# apk add dosfstools&lt;br /&gt;
# mkfs.fat -F32 /dev/sda1&lt;br /&gt;
# mkfs.ext4 /dev/vg0/boot&lt;br /&gt;
# mkdir -v /mnt/boot&lt;br /&gt;
# mount -t ext4 /dev/vg0/boot /mnt/boot&lt;br /&gt;
# mkdir -v /mnt/boot/efi&lt;br /&gt;
# mount -t vfat /dev/sda1 /mnt/boot/efi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lastly, activate your swap partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# swapon /dev/vg0/swap&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing Alpine Linux ==&lt;br /&gt;
&lt;br /&gt;
In this step you will install Alpine Linux in the &amp;lt;code&amp;gt;/mnt/&amp;lt;/code&amp;gt; directory, which contains the mounted file system structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# setup-disk -m sys /mnt/&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The installer downloads the latest packages to install the base installation. Additionally, the installer automatically creates the entries for the mount points in {{Path|/etc/fstab}} file, which is currently mounted in the &amp;lt;code&amp;gt;/mnt/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
{{Note|The automatic writing of the master boot record (MBR) fails in this step. You will write the MBR later manually to the disk.}}&lt;br /&gt;
&lt;br /&gt;
The swap LV is not automatically added to the &amp;lt;code&amp;gt;fstab&amp;lt;/code&amp;gt; file. To add it manually, add the following line to the {{Path|/mnt/etc/fstab}} file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/dev/vg0/swap    swap    swap    defaults    0 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the {{Path|/mnt/etc/mkinitfs/mkinitfs.conf}} file and append the &amp;lt;code&amp;gt;cryptsetup&amp;lt;/code&amp;gt; module to the &amp;lt;code&amp;gt;features&amp;lt;/code&amp;gt; parameter:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;features=&amp;quot;... cryptsetup&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are using GRUB with an encrypted &amp;lt;code&amp;gt;/boot&amp;lt;/code&amp;gt; you must add the &amp;lt;code&amp;gt;cryptkey&amp;lt;/code&amp;gt; feature so that Alpine can use a keyfile for decryption on boot.&lt;br /&gt;
&lt;br /&gt;
{{Note|Alpine Linux uses the &amp;lt;code&amp;gt;en-us&amp;lt;/code&amp;gt; keyboard mapping by default when prompting for the password to decrypt the partition at boot time. If you changed the keyboard mapping in the temporary environment and want to use it at the boot password prompt, be sure to also add the &amp;lt;code&amp;gt;keymap&amp;lt;/code&amp;gt; feature to the list above.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|Check the output of &amp;lt;code&amp;gt;mkinitfs -L&amp;lt;/code&amp;gt; and add the features necessary for your system to boot. You may need to add &amp;lt;code&amp;gt;kms&amp;lt;/code&amp;gt; in order to see a password prompt at boot. You may also need: &amp;lt;code&amp;gt;usb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;lvm&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ext4&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;nvme&amp;lt;/code&amp;gt;...}}&lt;br /&gt;
&lt;br /&gt;
Rebuild the initial RAM disk:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# mkinitfs -c /mnt/etc/mkinitfs/mkinitfs.conf -b /mnt/ $(ls /mnt/lib/modules/)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command uses the settings from the &amp;lt;code&amp;gt;mkinitfs.conf&amp;lt;/code&amp;gt; file set in the &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; parameter to generate the RAM disk. The command is executed in the &amp;lt;code&amp;gt;/mnt/&amp;lt;/code&amp;gt; directory and the RAM disk is generated using the modules for the installed kernel. Without setting the kernel version using the &amp;lt;code&amp;gt;$(ls /mnt/lib/modules/&amp;lt;/code&amp;gt;) option, &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt; tries to generate the RAM disk using the kernel version installed in the temporary environment, which can differ from the latest one installed by the &amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
== Installing a bootloader ==&lt;br /&gt;
&lt;br /&gt;
To get the UUID of your storage device into a file for later use, use this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# blkid -s UUID -o value /dev/sda2 &amp;gt; ~/uuid&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Tip|To easily read the UUID into a file so you don&#039;t have to type it manually, open the file in &amp;lt;code&amp;gt;vi&amp;lt;/code&amp;gt;, then type &amp;lt;code&amp;gt;:r /root/uuid&amp;lt;/code&amp;gt; to load the UUID onto a new line.}}&lt;br /&gt;
&lt;br /&gt;
=== Syslinux with BIOS ===&lt;br /&gt;
&lt;br /&gt;
Install the Syslinux package:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# apk add syslinux&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit {{Path|/mnt/etc/update-extlinux.conf}} and append the following kernel options to the &amp;lt;code&amp;gt;default_kernel_opts&amp;lt;/code&amp;gt; parameter, replacing &amp;lt;UUID&amp;gt; with the UUID of &amp;lt;code&amp;gt;/dev/sda2&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;default_kernel_opts=&amp;quot;... cryptroot=UUID=&amp;lt;UUID of sda2&amp;gt; cryptdm=lvmcrypt&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;cryptroot&amp;lt;/code&amp;gt; parameter sets the ID of the device/partition that contains encrypted volumes, and the &amp;lt;code&amp;gt;cryptdm&amp;lt;/code&amp;gt; parameter uses the name of the mapping we have already configured a few lines above.&lt;br /&gt;
&lt;br /&gt;
We can also double check if &amp;lt;code&amp;gt;modules&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; are set correctly, eg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modules=sd-mod,usb-storage,ext4,cryptsetup,keymap,cryptkey,kms,lvm&lt;br /&gt;
root=UUID=&amp;lt;UUID of /dev/mapper/vg0-root&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because the &amp;lt;code&amp;gt;update-extlinux&amp;lt;/code&amp;gt; utility operates only on the &amp;lt;code&amp;gt;/boot/&amp;lt;/code&amp;gt; directory, temporarily change the root to the &amp;lt;code&amp;gt;/mnt/&amp;lt;/code&amp;gt; directory and update the boot loader configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# chroot /mnt/&lt;br /&gt;
# update-extlinux&lt;br /&gt;
# exit&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: Because we didn&#039;t mount &amp;lt;code&amp;gt;/dev&amp;lt;/code&amp;gt; nor &amp;lt;code&amp;gt;/proc&amp;lt;/code&amp;gt; inside our &amp;lt;code&amp;gt;/mnt/&amp;lt;/code&amp;gt; chroot, some errors may occur when we run &amp;lt;code&amp;gt;update-extlinux&amp;lt;/code&amp;gt; command. But you can most likely ignore these.&lt;br /&gt;
&lt;br /&gt;
Write the MBR (without partition table) to the &amp;lt;code&amp;gt;/dev/sda&amp;lt;/code&amp;gt; device:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# dd bs=440 count=1 conv=notrunc if=/mnt/usr/share/syslinux/mbr.bin of=/dev/sda&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Grub with UEFI ===&lt;br /&gt;
&lt;br /&gt;
To avoid having to type your decryption password twice every boot (once for GRUB and once for Alpine), add a keyfile to your LUKS partition. The filename is important.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# dd bs=512 count=4 if=/dev/urandom of=/mnt/crypto_keyfile.bin&lt;br /&gt;
# cryptsetup luksAddKey /dev/sda2 /mnt/crypto_keyfile.bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This keyfile is stored encrypted at rest (it is in your LUKS partition), so it&#039;s existence does not reduce the security of the system.&lt;br /&gt;
&lt;br /&gt;
Mount the required filesystems for the Grub EFI installer to the installation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# mount -t proc /proc /mnt/proc&lt;br /&gt;
# mount --rbind /dev /mnt/dev&lt;br /&gt;
# mount --make-rslave /mnt/dev&lt;br /&gt;
# mount --rbind /sys /mnt/sys&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then chroot in and use &amp;lt;code&amp;gt;grub-install&amp;lt;/code&amp;gt; to install Grub.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# chroot /mnt&lt;br /&gt;
# source /etc/profile&lt;br /&gt;
# export PS1=&amp;quot;(chroot) $PS1&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install &amp;lt;code&amp;gt;GRUB2&amp;lt;/code&amp;gt; for EFI and (optionally) remove syslinux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# apk add grub grub-efi efibootmgr&lt;br /&gt;
# apk del syslinux&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit {{Path|/etc/default/grub}} and add the following kernel options to the &amp;lt;code&amp;gt;GRUB_CMDLINE_LINUX_DEFAULT&amp;lt;/code&amp;gt; parameter, replacing &amp;lt;UUID&amp;gt; with the UUID of the encrypted partition (in this case, &amp;lt;code&amp;gt;/dev/sda2&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cryptroot=UUID=&amp;lt;UUID&amp;gt; cryptdm=lvmcrypt cryptkey&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;cryptroot&amp;lt;/code&amp;gt; parameter sets the ID of the device/partition that contains encrypted volumes, and the &amp;lt;code&amp;gt;cryptdm&amp;lt;/code&amp;gt; parameter uses the name of the mapping we have already configured a few lines above.&lt;br /&gt;
The &amp;lt;code&amp;gt;cryptkey&amp;lt;/code&amp;gt; parameter indicates the existence of the file &amp;lt;code&amp;gt;/crypto_keyfile.bin&amp;lt;/code&amp;gt; you created previously.&lt;br /&gt;
&lt;br /&gt;
To enable GRUB to decrypt LUKS partitions and read LVM volumes add:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;GRUB_PRELOAD_MODULES=&amp;quot;luks cryptodisk part_gpt lvm&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If using at least Alpine v3.11, &amp;lt;code&amp;gt;GRUB_ENABLE_CRYPTODISK=y&amp;lt;/code&amp;gt; should also be added to {{Path|/etc/default/grub}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# (chroot) grub-install --target=x86_64-efi --efi-directory=/boot/efi&lt;br /&gt;
# (chroot) grub-mkconfig -o /boot/grub/grub.cfg&lt;br /&gt;
# (chroot) exit&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Unmounting the Volumes and Partitions ==&lt;br /&gt;
&lt;br /&gt;
Unmount the &amp;lt;code&amp;gt;/mnt/&amp;lt;/code&amp;gt; partitions, deactivate the LVM volumes, close the LUKS partition and reboot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd&lt;br /&gt;
# umount -l /mnt/dev&lt;br /&gt;
# umount -l /mnt/proc&lt;br /&gt;
# umount -l /mnt/sys&lt;br /&gt;
# umount /mnt/boot/efi&lt;br /&gt;
# umount /mnt/boot&lt;br /&gt;
# swapoff /dev/vg0/swap&lt;br /&gt;
# umount /mnt&lt;br /&gt;
# vgchange -a n&lt;br /&gt;
# cryptsetup luksClose lvmcrypt&lt;br /&gt;
# reboot&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
== General Procedure ==&lt;br /&gt;
&lt;br /&gt;
In case your system fails to boot, you can verify the settings and fix incorrect configurations.&lt;br /&gt;
&lt;br /&gt;
Reboot and do the steps in [[#Preparing_the_Temporary_Installation_Environment|Prepare the temporary installation environment]] again.&lt;br /&gt;
&lt;br /&gt;
Setup the LUKS partition and activate the LVs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cryptsetup luksOpen /dev/sda2&lt;br /&gt;
# vgchange -ay&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#Creating_and_Mounting_the_File Systems|Mount the file systems]]&lt;br /&gt;
&lt;br /&gt;
Verify that you run the steps described in the [[#Installing_Alpine_Linux|Installing Alpine Linux]] section correctly. Update the configuration if necessary, unmount the partitions, then reboot.&lt;br /&gt;
&lt;br /&gt;
== System can&#039;t find boot device ==&lt;br /&gt;
&lt;br /&gt;
 * GPT partition table on a motherboard that runs BIOS instead of UEFI&lt;br /&gt;
 * running an MSDOS/MBR/Syslinux install without enabling legacy boot mode in the UEFI settings&lt;br /&gt;
&lt;br /&gt;
== I see &amp;quot;can not mount /sysroot&amp;quot; during boot ==&lt;br /&gt;
&lt;br /&gt;
 * incorrect device UUID&lt;br /&gt;
 * missing module in &amp;lt;code&amp;gt;/mnt/etc/update-extlinux.conf&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;/mnt/etc/mkinitfs/mkinitfs.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Secure boot ==&lt;br /&gt;
&lt;br /&gt;
If secure boot complains of an unsigned bootloader, you can either disable it or adapt [https://wiki.archlinux.org/index.php/Secure_Boot this] guide to sign GRUB. If you&#039;re using Syslinux, then secure boot should be automatically disabled when you enable legacy boot mode.&lt;br /&gt;
&lt;br /&gt;
= Hardening =&lt;br /&gt;
&lt;br /&gt;
* To harden, you should disable DMA[https://old.iseclab.org/papers/acsac2012dma.pdf] and install a hardened version of AES (TRESOR[https://www1.informatik.uni-erlangen.de/tresor] or Loop-Amnesia[http://moongate.ydns.eu/amnesia.html]) since by default cryptsetup with luks uses AES by default.&lt;br /&gt;
* Disable DMA in the BIOS and set the password for the BIOS according to Wikipedia.[https://en.wikipedia.org/wiki/DMA_attack]&lt;br /&gt;
* Blacklist kernel modules that use DMA and any unused expansion modules (FireWire, CardBus, ExpressCard, Thunderbolt, USB 3.0, PCI Express and hotplug modules) that use DMA.&lt;br /&gt;
&lt;br /&gt;
= Mounting additional encrypted filesystems at boot =&lt;br /&gt;
&lt;br /&gt;
If you would like other encrypted LUKS partitions to be decrypted and mounted automatically during boot, for example if you have &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; on a separate physical drive, some extra steps are required.&lt;br /&gt;
{{Note|This does not apply for volumes&lt;br /&gt;
within your main encrypted partition &amp;lt;code&amp;gt;/dev/sda2&amp;lt;/code&amp;gt;}}&lt;br /&gt;
For the purposes of these instructions we will say &amp;lt;code&amp;gt;/dev/sdb1&amp;lt;/code&amp;gt; contains an LVM volume that should be mounted at &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Create a keyfile and add it to the LUKS partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# dd bs=512 count=4 if=/dev/urandom of=/root/crypt-home-keyfile.bin&lt;br /&gt;
# cryptsetup luksAddKey /dev/sdb1 /root/crypt-home-keyfile.bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alpine, like Gentoo, uses the &amp;lt;code&amp;gt;dmcrypt&amp;lt;/code&amp;gt; service rather than &amp;lt;code&amp;gt;/etc/crypttab&amp;lt;/code&amp;gt;. Add the following lines to &amp;lt;code&amp;gt;/etc/conf.d/dmcrypt&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;target=crypt-home&lt;br /&gt;
source=&#039;/dev/sdb1&#039;&lt;br /&gt;
key=&#039;/root/crypt-home-keyfile.bin&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add an entry to &amp;lt;code&amp;gt;/etc/fstab&amp;lt;/code&amp;gt;, changing &amp;lt;code&amp;gt;vg1&amp;lt;/code&amp;gt; to the name of your LVM volume group:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/dev/vg1/home /home ext4 rw,relatime 0 2&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable the dmcrypt and lvm services to start on boot:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# rc-update add dmcrypt boot&lt;br /&gt;
# rc-update add lvm boot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After a reboot the partition should be decrypted and mounted automatically.&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
*[[Bootloaders]]&lt;br /&gt;
*[[Alpine setup scripts]]&lt;br /&gt;
*[[Installing on GPT LVM]]&lt;br /&gt;
*[[Setting up LVM on GPT-labeled disks]]&lt;br /&gt;
*[[Setting up disks manually]]&lt;br /&gt;
*https://wiki.gentoo.org/wiki/Syslinux&lt;br /&gt;
*https://wiki.gentoo.org/wiki/GRUB2&lt;br /&gt;
*https://wiki.archlinux.org/index.php/Syslinux&lt;br /&gt;
*https://wiki.archlinux.org/index.php/GRUB&lt;br /&gt;
*https://wiki.gentoo.org/wiki/Sakaki&#039;s_EFI_Install_Guide&lt;br /&gt;
*https://battlepenguin.com/tech/alpine-linux-with-full-disk-encryption/&lt;br /&gt;
*https://wiki.gentoo.org/wiki/Dm-crypt&lt;br /&gt;
&lt;br /&gt;
[[Category:Storage]]&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Begs</name></author>
	</entry>
</feed>