<?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=Candrew</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=Candrew"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Candrew"/>
	<updated>2026-05-05T13:46:27Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Software_management&amp;diff=30465</id>
		<title>Software management</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Software_management&amp;diff=30465"/>
		<updated>2025-07-17T23:55:23Z</updated>

		<summary type="html">&lt;p&gt;Candrew: Change Arch Linux bootstrap download to zst&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page documents various ways to manage software in Alpine Linux. [[#Graphical software manager|Graphical software managers]] are available to supplement [[#Alpine Package Keeper|apk]] to manage official software packages along with [[#Flatpak|Flatpaks]].&lt;br /&gt;
&lt;br /&gt;
This page also documents ways to [[#Running glibc programs|run software compiled with glibc]] including graphical programs like {{ic|Visual Studio Code}}, {{ic|google-chrome}}, {{ic|obsidian}} etc...&lt;br /&gt;
&lt;br /&gt;
== Alpine package keeper ==&lt;br /&gt;
{{Main|Alpine Package Keeper}}&lt;br /&gt;
The official package manager in Alpine Linux [[Alpine Package Keeper|Alpine Package Keeper(apk)]] is a cli tool. [[Comparison_with_other_distros#Comparison_chart/Rosetta_Stone|Rosetta stone]] shows how standard package management tasks are done in Alpine Linux compared to other popular distributions. &lt;br /&gt;
&lt;br /&gt;
== Graphical software manager ==&lt;br /&gt;
&lt;br /&gt;
The following graphical tools are available to manage software packages from [[Repositories|official repositories]] and [[#Flatpak|Flatpaks]].&lt;br /&gt;
&lt;br /&gt;
=== Gnome software ===&lt;br /&gt;
&lt;br /&gt;
Gnome [[GNOME#Configuration|Software]] can be used as a GUI front end for apk for managing official software packages and flatpaks.&lt;br /&gt;
&lt;br /&gt;
=== KDE Discover ===&lt;br /&gt;
&lt;br /&gt;
KDE [[KDE#Discover|Discover]] can be used as a GUI front end for apk for managing official software packages and flatpaks.&lt;br /&gt;
&lt;br /&gt;
== Flatpak ==&lt;br /&gt;
{{Main|Flatpak}}&lt;br /&gt;
&lt;br /&gt;
[[Flatpak#Installing_Flatpak|Flatpak]] is by far the easiest method for running programs not available in the official Alpine Linux [[Repositories|repositories]]. To use flatpaks, ensure that [[Flatpak#Installing_Flatpak|Flathub repository]] is enabled.&lt;br /&gt;
&lt;br /&gt;
== Running glibc programs ==&lt;br /&gt;
&lt;br /&gt;
If you want to run [https://www.gnu.org/software/libc/ glibc] programs in Alpine Linux, there are a few ways of doing so. &lt;br /&gt;
&lt;br /&gt;
For simpler binaries, you can install [[#gcompat|gcompat]] a compatibility layer or you could do it the easy way and use [[#Flatpak|Flatpaks]]. See [[#Containers|containers]] or [[#Chroot|chroot]] section for ways to run glibc programs including graphical ones.&lt;br /&gt;
&lt;br /&gt;
=== gcompat ===&lt;br /&gt;
&lt;br /&gt;
[https://git.adelielinux.org/adelie/gcompat gcompat] is a library which provides glibc-compatible APIs for use on musl libc systems like Alpine Linux. To install issue the command: {{cmd|apk add {{pkg|gcompat}}}}&lt;br /&gt;
After that you run your binaries as normal.&lt;br /&gt;
&lt;br /&gt;
For an usage example, refer [[Firefox#DRM_content_using_Widevine_workaround|Firefox]] page, where gcompat is used to run glibc compiled Widevine binary.&lt;br /&gt;
&lt;br /&gt;
== Chroot ==&lt;br /&gt;
{{Main|Chroot}}&lt;br /&gt;
An option that&#039;s easier to generalize to other glibc applications is installing a glibc-based distribution into a chroot. You can then either chroot into it, or use a symlink and some configuration to make its glibc (and associated libraries) usable from Alpine.&lt;br /&gt;
&lt;br /&gt;
{{Tip|The most reliable way to enter a chroot is to use the [[Chroot#Enter_chroot|start-chroot]] script.}}&lt;br /&gt;
&lt;br /&gt;
After setting up a chroot using any of the methods described below, the loader can be set up in Alpine like so (these instructions are for a Debian chroot in /var/chroots/debian, on x86_64, but can be adapted to other systems by using the appropriate paths):&lt;br /&gt;
&lt;br /&gt;
{{cmd|mkdir -p /lib64&lt;br /&gt;
ln -s /var/chroots/debian/lib/x86_64-linux-gnu/ld-2.33.so /lib64&lt;br /&gt;
printf &#039;/var/chroots/debian/lib/x86_64-linux-gnu\n/var/chroots/debian/usr/lib/x86_64-linux-gnu\n&#039; &amp;gt; /etc/ld.so.conf&lt;br /&gt;
/var/chroots/debian/sbin/ldconfig}}&lt;br /&gt;
&lt;br /&gt;
=== Gentoo Linux ===&lt;br /&gt;
&lt;br /&gt;
Select a stage3 from [https://www.gentoo.org/downloads/ here] and portage latest from [https://www.gentoo.org/downloads/mirrors/ here] at gentoo/snapshots/portage-latest.tar.xz.&lt;br /&gt;
&lt;br /&gt;
First,{{cmd|doas apk add {{pkg|xz}}}}&lt;br /&gt;
&lt;br /&gt;
Enter the chroot:&lt;br /&gt;
{{cmd|mkdir ~/chroot&lt;br /&gt;
cd ~/chroot&lt;br /&gt;
tar -xvf stage3-*.tar.xz&lt;br /&gt;
tar -xvf portage-latest.tar.xz&lt;br /&gt;
mv portage usr&lt;br /&gt;
doas mount --bind /dev dev&lt;br /&gt;
doas mount --bind /sys sys&lt;br /&gt;
doas mount -t proc proc proc&lt;br /&gt;
cp /etc/resolv.conf etc&lt;br /&gt;
doas chroot . /bin/bash}}&lt;br /&gt;
&lt;br /&gt;
And voilà, you have your working Gentoo chroot!&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now take a look at [https://wiki.gentoo.org/wiki/Handbook:Main_Page Gentoo&#039;s Handbook] to find out how you can configure and install your system, or simply extract/copy the program you need to run in your chroot enviroment and execute it.&lt;br /&gt;
&lt;br /&gt;
Here is a wrapper script that is similar to &amp;lt;code&amp;gt;arch-chroot&amp;lt;/code&amp;gt; when you frequently reuse this chroot:&lt;br /&gt;
&lt;br /&gt;
Also, create an account with the same user name as host current user to the chroot or make changes to the userspec option to chroot line.&lt;br /&gt;
&lt;br /&gt;
{{Cat|gentoo-chroot.sh|&amp;lt;nowiki&amp;gt;!/bin/bash&lt;br /&gt;
CHROOT_PATH=&amp;quot;/home/$USER/chroot&amp;quot;&lt;br /&gt;
cd $CHROOT_PATH&lt;br /&gt;
mount | grep $CHROOT_PATH/dev || doas mount --bind /dev dev&lt;br /&gt;
mount | grep $CHROOT_PATH/sys || doas mount --bind /sys sys&lt;br /&gt;
mount | grep $CHROOT_PATH/proc || doas mount -t proc proc proc&lt;br /&gt;
cp /etc/resolv.conf etc&lt;br /&gt;
doas chroot --userspec=$USER:users . /bin/bash&lt;br /&gt;
echo &amp;quot;You must manually unmount $CHROOT_PATH/dev, $CHROOT_PATH/sys, $CHROOT_PATH/proc.&amp;quot;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Do at &amp;lt;code&amp;gt;chmod +x gentoo-chroot.sh&amp;lt;/code&amp;gt; to get it to work.&lt;br /&gt;
&lt;br /&gt;
=== Arch Linux ===&lt;br /&gt;
{{Seealso|Installing ArchLinux inside an Alpine chroot}}&lt;br /&gt;
Either use &#039;&#039;&#039;pacstrap&#039;&#039;&#039; (included with the arch-install-scripts package) or an Arch bootstrap image:&lt;br /&gt;
&lt;br /&gt;
{{cmd|doas apk add {{pkg|arch-install-scripts}}&lt;br /&gt;
mkdir ~/chroot &amp;amp;&amp;amp; cd ~/chroot&lt;br /&gt;
curl -O https://mirrors.edge.kernel.org/archlinux/iso/latest/archlinux-bootstrap-x86_64.tar.zst&lt;br /&gt;
doas tar -x --zstd -f archlinux-bootstrap-x86_64.tar.zst &amp;amp;&amp;amp; rm archlinux-bootstrap-x86_64.tar.zst&lt;br /&gt;
doas sed -i &#039;/evowise/s/^#//&#039; root.x86_64/etc/pacman.d/mirrorlist&lt;br /&gt;
doas sed -i &#039;/CheckSpace/s/^/#/&#039; root.x86_64/etc/pacman.conf&lt;br /&gt;
doas arch-chroot root.x86_64&lt;br /&gt;
[chroot]# pacman-key --init&lt;br /&gt;
[chroot]# pacman-key --populate archlinux}}&lt;br /&gt;
&lt;br /&gt;
Once that is done, update the system and install the desired package(s) (denoted by &#039;&#039;&amp;quot;foo&amp;quot;&#039;&#039; in this example):&lt;br /&gt;
  &lt;br /&gt;
{{cmd|[chroot]# pacman -Syu &#039;&#039;foo&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
=== Debian ===&lt;br /&gt;
&lt;br /&gt;
Alpine Linux provides {{pkg|debootstrap}} package to create the Debian chroot. Here are the steps: {{cmd|&amp;lt;nowiki&amp;gt;# apk add debootstrap&lt;br /&gt;
# mkdir -p /var/chroots/debian&lt;br /&gt;
# debootstrap --arch amd64 stable /var/chroots/debian/ https://deb.debian.org/debian &amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
The {{ic|--arch}} is optional, depending on your needs.&lt;br /&gt;
&lt;br /&gt;
For updating the Chroot or for installing applications i.e packages and their dependencies using {{ic|apt-get}}, mount it and then login as root:&lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;# mount --bind /dev /var/chroots/debian/dev&lt;br /&gt;
# mount --bind /proc /var/chroots/debian/proc&lt;br /&gt;
# mount --bind /dev/pts /var/chroots/debian/dev/pts&lt;br /&gt;
# chroot /var/chroots/debian /bin/bash&lt;br /&gt;
[chroot]# apt update &amp;amp;&amp;amp; apt upgrade&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
After installing the necessary applications and what you might want to do, exit the chroot and umount the binds for /dev/pts, dev and proc to avoid issues. &lt;br /&gt;
{{cmd|&amp;lt;nowiki&amp;gt;# umount /var/chroots/debian/dev/pts&lt;br /&gt;
# umount /var/chroots/debian/dev&lt;br /&gt;
# umount /var/chroots/debian/proc&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Containers ==&lt;br /&gt;
&lt;br /&gt;
=== Distrobox + Podman ===&lt;br /&gt;
&lt;br /&gt;
[[Distrobox]] combined with [[Podman|podman]] container running in rootless mode allows running [[Distrobox#Running_graphical_programs|glibc compiled graphical programs]] easy. This doesn&#039;t require root privileges once set up.&lt;br /&gt;
&lt;br /&gt;
=== Bubblewrap + Chroot===&lt;br /&gt;
&lt;br /&gt;
A script {{ic|glibc}} is used to create a container using [[Bubblewrap]] where a [[#Debian|Debian chroot]] is the content of that container. It&#039;s not just a chroot anymore; it&#039;s a bubblewrap powered isolated environment. This allows running graphical programs easy and doesn&#039;t require root privileges once installed. &lt;br /&gt;
&lt;br /&gt;
[[Install]] the {{pkg|bubblewrap}} package.&lt;br /&gt;
&lt;br /&gt;
Set up [[#Debian|Debian chroot]] at {{path|/var/chroots/debian}} and install necessary glibc applications using {{ic|apt-get}}.&lt;br /&gt;
&lt;br /&gt;
Create an alias {{ic|glibc}} using bwrap in the Alpine Linux host to start applications from the [[#Debian|Debian chroot]].&lt;br /&gt;
&lt;br /&gt;
{{cmd|$ alias glibc{{=}}&amp;quot;LANG{{=}}en_US.UTF-8 bwrap --bind /var/chroots/debian / --dev-bind /dev /dev --proc /proc --bind /sys /sys --bind /run /run --bind /home /home --ro-bind /etc/resolv.conf /etc/resolv.conf --ro-bind /etc/passwd /etc/passwd --ro-bind /etc/group /etc/group&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
To run programs that use X11/Xorg you can use: &lt;br /&gt;
{{cmd|$ alias glibcX11{{=}}&amp;quot;LANG{{=}}en_US.UTF-8 bwrap --bind /var/chroots/debian / --dev-bind /dev /dev --proc /proc --bind /sys /sys --bind /run /run --bind /home /home --ro-bind /etc/resolv.conf /etc/resolv.conf --ro-bind /etc/passwd /etc/passwd --ro-bind /etc/group /etc/group --bind /tmp/.X11-unix/X0 /tmp/.X11-unix/X0 --setenv DISPLAY :0&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
In this case you might need to use {{ic|xhost}} on the Alpine Linux host to allow local connections, e.g.:&lt;br /&gt;
{{cmd|# xhost + local:}}&lt;br /&gt;
&lt;br /&gt;
Now we can invoke glibc-built binaries using the alias from the Alpine Linux host like so:&lt;br /&gt;
{{cmd|$ glibc ./binary}} or {{cmd|$ glibcX11 ./binary}} &lt;br /&gt;
&lt;br /&gt;
When [[Wayland]] desktop like [[Sway]] runs without {{pkg|xwayland}} on the Alpine Linux host, electron apps like {{ic|vscode}}, {{ic|google-chrome}} etc needs to be started as follows:{{ic|&amp;lt;nowiki&amp;gt;$ glibc code --ozone-platform=wayland&amp;lt;/nowiki&amp;gt;}}.&lt;br /&gt;
&lt;br /&gt;
== See also == &lt;br /&gt;
&lt;br /&gt;
* [[Alpine Package Keeper]]&lt;br /&gt;
* [[Installing ArchLinux inside an Alpine chroot]]&lt;br /&gt;
* [[Compile software from source]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Candrew</name></author>
	</entry>
</feed>