author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Tue, 01 Jan 2019 22:32:53 +0200 | |
changeset 2323 | 7af84df988e9 |
parent 2296 | 2a1cf17e9552 |
child 2325 | b127237b615f |
permissions | -rw-r--r-- |
2234 | 1 |
.. -*- coding: utf-8; -*- |
2 |
||
3 |
===================== |
|
4 |
Alpine Linux distro |
|
5 |
===================== |
|
6 |
.. contents:: |
|
7 |
:local: |
|
8 |
||
2235
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
9 |
Init system |
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
10 |
=========== |
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
11 |
|
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
12 |
Manage run levels:: |
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
13 |
|
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
14 |
rc-update add $SERVICE $LEVEL |
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
15 |
rc-update del $SERVICE $LEVEL |
2296
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
16 |
|
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
17 |
Run levels meaning: |
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
18 |
|
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
19 |
Starting/stopping services:: |
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
20 |
|
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
21 |
rc-service $SERVICE status |
2235
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
22 |
rc-service $SERVICE start |
2296
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
23 |
rc-service $SERVICE stop |
2235
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
24 |
rc-service $SERVICE restart |
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
25 |
|
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
26 |
Equivalent to shutdown -r now from traditional GNU/Linux systems:: |
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
27 |
|
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
28 |
reboot |
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
29 |
|
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
30 |
Equivalent to shutdown -h now from traditional GNU/Linux systems:: |
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
31 |
|
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
32 |
halt |
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
33 |
|
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
34 |
To turn off the machine:: |
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
35 |
|
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
36 |
poweroff |
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
37 |
|
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
38 |
https://wiki.alpinelinux.org/wiki/Alpine_Linux_Init_System |
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
39 |
Alpine Linux Init System |
eb6107487d83
Alpine Linux Init System.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2234
diff
changeset
|
40 |
|
2234 | 41 |
Package manager |
42 |
=============== |
|
43 |
||
44 |
Update local package database:: |
|
45 |
||
46 |
$ sudo apk update |
|
47 |
||
2296
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
48 |
Upgrade packages to latest version:: |
2234 | 49 |
|
50 |
$ sudo apk upgrade |
|
51 |
||
2296
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
52 |
Upgrade only specific package:: |
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
53 |
|
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
54 |
$ sudo apk add -u busybox |
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
55 |
|
2234 | 56 |
Install package:: |
57 |
||
58 |
$ sudo apk add bash |
|
2296
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
59 |
$ sudo apk add --allow-untrusted /path/to/file.apk |
2234 | 60 |
|
2287
fcdd583e8795
Fixed RST syntax: Inline literal start-string without end-string.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2235
diff
changeset
|
61 |
Do not grab package index with ``--no-cache`` option to reduce installation size:: |
2234 | 62 |
|
63 |
$ apk add --no-cache bash |
|
64 |
||
2296
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
65 |
Remove package:: |
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
66 |
|
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
67 |
$ sudo apk del openssh |
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
68 |
|
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
69 |
Search for packages:: |
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
70 |
|
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
71 |
$ apk search 'emacs*' |
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
72 |
$ apk search -v 'emacs*' |
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
73 |
|
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
74 |
List of installed packages:: |
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
75 |
|
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
76 |
$ apk info |
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
77 |
|
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
78 |
Package owning file:: |
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
79 |
|
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
80 |
$ apk info --who-owns `which apk` |
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
81 |
|
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
82 |
Show package content:: |
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
83 |
|
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
84 |
$ apk info -L $PKG |
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
85 |
|
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
86 |
Developing Apline |
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
87 |
================= |
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
88 |
|
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
89 |
:: |
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
90 |
|
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
91 |
$ apk add -U build-base |
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
92 |
$ apk add -U alpine-sdk |
2a1cf17e9552
Alpine package manager.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2287
diff
changeset
|
93 |