How to get regular stuff working: Difference between revisions

From Alpine Linux
m (→‎Basic commands and shell hints: If we're trying to turn Alpine into GNU, we should install the PCI IDs and USB IDs too...)
 
(13 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== Man pages ==


A "man" command and basic manual pages can be installed with:
== Basic commands and shell hints ==


    '''apk add mandoc man-pages'''
Alpine comes with busybox by default. Busybox is set up as an endpoint for numerous symlinks that substitute various utilities. Though busybox is not that bad, the busybox replacement commands may still be missing some functionality.


The appropos command may be installed with:
To replace the symlinks to busybox, install:
    '''apk add mandoc-apropos '''
 
The '''man-pages''' package only provides the system's ''core'' manual pages. Other packages come with their separate '''*-doc''' sub-packages that ship their documentation (which may include man pages). This is the ''Alpine Way'' to allow for the small default footprint. For example:
 
    $ '''apk add curl'''
    $ '''man curl'''
    man: No entry for curl in the manual.
    $ '''apropos curl | wc -l'''
    0    <span style="color: green;">''After adding curl, there are no man pages''</span>
    $ '''apk add curl-doc'''
    (1/1) Installing curl-doc (7.52.1-r2)
    Executing mandoc-apropos-1.13.3-r6.trigger
    OK: 60 MiB in 31 packages
    $ '''apropos curl | wc -l'''
    366  <span style="color: green;">''Now, with curl-doc installed, there's a boatload of pages!''</span>
 
 
If you would like all the documentation packages pertaining to your installed packages to be pulled in automatically, you may install the  <code>docs</code> meta package.
 
    '''apk add docs'''
 
== Operational hints ==
 
==== Shell @ commandline ====
 
Alpine comes with busybox by default. And busybox is an endpoint for numerous symlinks that substitute various utilities. Though busybox is not that bad, the busybox replacement commands may be missing some functionality.
 
To replace the symlinks to busybox, install...


* Shell utilities (things like grep, [[awk]], ls are all busybox symlinks)
* Shell utilities (things like grep, [[awk]], ls are all busybox symlinks)
  apk add util-linux pciutils usbutils coreutils binutils findutils grep
: {{Cmd|apk add {{pkg|util-linux}} {{pkg|pciutils}} {{pkg|hwdata-pci}} {{pkg|usbutils}} {{pkg|hwdata-usb}} {{pkg|coreutils}} {{pkg|binutils}} {{pkg|findutils}} {{pkg|grep}} {{pkg|iproute2}}}}


* Bash
* Bash
It's also easy enough to have bash itself installed:   
It's also easy enough to install bash itself:   
  apk add bash bash-doc bash-completion
: {{Cmd|apk add {{pkg|bash}} {{pkg|bash-completion}}}}
and to possibly change the login shell with '''chsh'''.
and optionally, change the login shell with '''{{ic|chsh}}'''.
 
* Funny characters at the console
Edit the file at {{Path|/etc/rc.conf}} and change line 92 to:
  unicode="YES"
 
 


==== Disk Management ====  
== Disk Management ==


Disk management is so much easier with udisks or udisks2
Managing (removable) disk is much easier with udisks


Installation     
Installation     


  apk add udisks2 udisks2-doc
{{Cmd|apk add {{pkg|udisks2}}}}


See the mounted disks
To see the mounted disks


  udisksctl status
{{Cmd|udisksctl status}}


== Compiling : a few notes and a reminder  ==
== Compiling : a few notes and a reminder  ==


Compiling in Alpine may be more challenging because it uses [http://www.musl-libc.org/ musl-libc] instead of glibc. Please review [http://wiki.musl-libc.org/wiki/Functional_differences_from_glibc 'The functional differences with glibc' ] if you think of porting packages or just for the sake of knowing, of course.
Compiling in Alpine may be more challenging because it uses [https://musl.libc.org/ musl-libc] instead of glibc. Please review the [https://wiki.musl-libc.org/functional-differences-from-glibc.html 'functional differences with glibc'] if you think of porting packages or just for the sake of knowing, of course.


Alpine offers the regular compiler stuff like gcc and cmake ... possible others
Alpine offers the regular compiler stuff like gcc and cmake ... possible others


==== (unvalidated) apk packages to install so one can start building software ====
==== (unvalidated) apk packages to install so one can start building software ====
  apk add build-base gcc abuild binutils binutils-doc gcc-doc
{{Cmd|apk add {{pkg|build-base}} {{pkg|abuild}}}}


==== a complete install for cmake looks like ====
==== a complete install for cmake looks like ====


  apk add cmake cmake-doc extra-cmake-modules extra-cmake-modules-doc
{{Cmd|apk add {{pkg|cmake}} {{pkg|extra-cmake-modules}}}}


==== ccache is also available ====
==== ccache is also available ====


  apk add ccache ccache-doc
{{Cmd|apk add {{pkg|ccache}}}}


[[Category:Installation]]
[[Category:Installation]]

Latest revision as of 13:59, 27 December 2023

Basic commands and shell hints

Alpine comes with busybox by default. Busybox is set up as an endpoint for numerous symlinks that substitute various utilities. Though busybox is not that bad, the busybox replacement commands may still be missing some functionality.

To replace the symlinks to busybox, install:

  • Shell utilities (things like grep, awk, ls are all busybox symlinks)

apk add util-linux pciutils hwdata-pci usbutils hwdata-usb coreutils binutils findutils grep iproute2

  • Bash

It's also easy enough to install bash itself:

apk add bash bash-completion

and optionally, change the login shell with chsh.

Disk Management

Managing (removable) disk is much easier with udisks

Installation

apk add udisks2

To see the mounted disks

udisksctl status

Compiling : a few notes and a reminder

Compiling in Alpine may be more challenging because it uses musl-libc instead of glibc. Please review the 'functional differences with glibc' if you think of porting packages or just for the sake of knowing, of course.

Alpine offers the regular compiler stuff like gcc and cmake ... possible others

(unvalidated) apk packages to install so one can start building software

apk add build-base abuild

a complete install for cmake looks like

apk add cmake extra-cmake-modules

ccache is also available

apk add ccache