<?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=P</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=P"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/P"/>
	<updated>2026-05-01T01:23:19Z</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=18750</id>
		<title>Software management</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Software_management&amp;diff=18750"/>
		<updated>2021-04-05T12:32:18Z</updated>

		<summary type="html">&lt;p&gt;P: Updated the link to the archlinux bootstrap tar&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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.  You could install glibc as additional to [https://musl.libc.org/ musl] (you would have to do this manually), or you could do it the easy way and use either Flatpak (the easiest) or a chroot.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because there are different use cases, this is just a slight overview about what&#039;s possible and what&#039;s intelligent.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Your options =&lt;br /&gt;
&lt;br /&gt;
== Flatpak ==&lt;br /&gt;
&lt;br /&gt;
Flatpak is by far the easiest method of running any graphical glibc program on Alpine.&lt;br /&gt;
Firstly install it.&lt;br /&gt;
&lt;br /&gt;
 sudo apk add flatpak&lt;br /&gt;
&lt;br /&gt;
Then you can run any Flatpak application:&lt;br /&gt;
&lt;br /&gt;
 flatpak run &amp;lt;flatpak name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is recommended to enable [https://flathub.org Flathub] using it&#039;s instructions [https://flatpak.org/setup/Alpine/ here], as most glibc programs you might need will be packaged there.&lt;br /&gt;
&lt;br /&gt;
You can then install applications from it, for example:&lt;br /&gt;
&lt;br /&gt;
 flatpak install com.valvesoftware.Steam&lt;br /&gt;
&lt;br /&gt;
== Chroot ==&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,&lt;br /&gt;
&lt;br /&gt;
 sudo apk add xz&lt;br /&gt;
&lt;br /&gt;
Enter the chroot:&lt;br /&gt;
 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;
 sudo mount --bind /dev dev&lt;br /&gt;
 sudo mount --bind /sys sys&lt;br /&gt;
 sudo mount -t proc proc proc&lt;br /&gt;
 cp /etc/resolv.conf etc&lt;br /&gt;
 sudo 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 || sudo mount --bind /dev dev&lt;br /&gt;
mount | grep $CHROOT_PATH/sys || sudo mount --bind /sys sys&lt;br /&gt;
mount | grep $CHROOT_PATH/proc || sudo mount -t proc proc proc&lt;br /&gt;
cp /etc/resolv.conf etc&lt;br /&gt;
sudo 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;
&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;
  sudo apk add 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-2021.04.01-x86_64.tar.gz&lt;br /&gt;
  sudo tar xzf archlinux-bootstrap-2021.04.01-x86_64.tar.gz &amp;amp;&amp;amp; rm archlinux-bootstrap-2021.04.01-x86_64.tar.gz&lt;br /&gt;
  sudo sed -i &#039;/evowise/s/^#//&#039; root.x86_64/etc/pacman.d/mirrorlist&lt;br /&gt;
  sudo sed -i &#039;/CheckSpace/s/^/#/&#039; root.x86_64/etc/pacman.conf&lt;br /&gt;
  sudo 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;
  [chroot]# pacman -Syu &#039;&#039;foo&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Debian ===&lt;br /&gt;
&lt;br /&gt;
Use the provided debootstrap package to create the Debian chroot. &amp;lt;code&amp;gt;--arch&amp;lt;/code&amp;gt; is optional, depending of your needs.&lt;br /&gt;
&lt;br /&gt;
On the &#039;&#039;&#039;linux-grsec&#039;&#039;&#039; kernel, you will need to relax chroot limitations:&lt;br /&gt;
&lt;br /&gt;
  sudo apk add debootstrap&lt;br /&gt;
  for i in /proc/sys/kernel/grsecurity/chroot_*; do echo 0 | sudo tee $i; done&lt;br /&gt;
  mkdir ~/chroot&lt;br /&gt;
  sudo debootstrap --arch=i386 wheezy ~/chroot http://http.debian.net/debian/&lt;br /&gt;
  for i in /proc/sys/kernel/grsecurity/chroot_*; do echo 1 | sudo tee $i; done&lt;br /&gt;
  sudo chroot ~/chroot /bin/bash&lt;br /&gt;
&lt;br /&gt;
You can now use &amp;lt;code&amp;gt;apt-get&amp;lt;/code&amp;gt; to install needed packages.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>P</name></author>
	</entry>
</feed>