Skip to content

Commit 5641a0f

Browse files
committed
Split update alternative
1 parent 52a4a2e commit 5641a0f

File tree

3 files changed

+54
-31
lines changed

3 files changed

+54
-31
lines changed

desktop/README.md

+2-31
Original file line numberDiff line numberDiff line change
@@ -1530,6 +1530,8 @@ This talks about how to allow users to choose their default application when ope
15301530

15311531
There are many systems, and they have some degree of compatibility.
15321532

1533+
`update-alternatives` and `/etc/alternatives` is an important Linux method of executable selection.
1534+
15331535
### xdg-open
15341536

15351537
XDG utils package, part of the LSB.
@@ -1569,37 +1571,6 @@ Gnome specific. Use `xdg-open` instead..
15691571

15701572
KDE specific. Use `xdg-open` instead..
15711573

1572-
### alternatives system
1573-
1574-
One configuration method is to make symbolic links such as `/usr/bin/editor` to either `vi` or `ed` for example.
1575-
1576-
The standard way is to first link `/usr/bin/editor` to `/etc/alternatives/editor`, and then `/etc/alternatives/editor` to the desired executable (say `/usr/bin/vi`).
1577-
1578-
In this way, all preferences are stored under `etc` as specified by the LSB.
1579-
1580-
### update-alternatives
1581-
1582-
The `update-alternatives` utility can be used to manage that system.
1583-
1584-
For example, to configure the default browser use:
1585-
1586-
sudo update-alternatives --config x-www-browser
1587-
1588-
This will show the possibilities (TODO how does he know?) for you to choose from them.
1589-
1590-
The most important alternatives include:
1591-
1592-
- `editor`: text editor
1593-
- `x-www-browser`: web browser
1594-
1595-
TODO: understand the following command:
1596-
1597-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
1598-
1599-
- `50`: priority of the alternative. Metadata associated by `update-alternatives`. Alternative with greatest priority wins.
1600-
1601-
I used this to link `gcc` to `gcc-4.8` instead of `4.6`.
1602-
16031574
## logkeys
16041575

16051576
Writes all key presses to a file.

desktop/update-alternatives.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# update-alternatives
2+
3+
# /etc/alternatives
4+
5+
Utility that manages which version of executables is going to be run through symlinks.
6+
7+
For example Ubuntu 14.04 comes with
8+
9+
which editor
10+
11+
as `/usr/bin/editor`, and:
12+
13+
readlink `which editor`
14+
15+
Gives:
16+
17+
/etc/alternatives/editor
18+
19+
And:
20+
21+
readlink /etc/alternatives/editor
22+
23+
Points to:
24+
25+
/usr/bin/vi
26+
27+
In this way, all preferences are stored under `etc` as specified by the LSB.
28+
29+
The `update-alternatives` utility can be used to manage that system.
30+
31+
For example, to configure the default browser use:
32+
33+
sudo update-alternatives --config x-www-browser
34+
35+
This will show the possibilities (TODO how does he know?) for you to choose from them.
36+
37+
Important alternatives include:
38+
39+
- `editor`: text editor
40+
- `x-www-browser`: web browser
41+
42+
TODO: understand the following command:
43+
44+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
45+
46+
- `50`: priority of the alternative. Metadata associated by `update-alternatives`. Alternative with greatest priority wins.
47+
48+
I used this to link `gcc` to `gcc-4.8` instead of `4.6`.

linux.md

+4
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ Original installation file.
155155

156156
Many theories, a plausible one: differentiate `a.conf file` from `a.conf.d` dir normally, all files in the `a.conf.d` dir will be sourced as if they are inside `a.conf`.
157157

158+
#### /etc/environment
159+
160+
TODO
161+
158162
## Distributions
159163

160164
A Linux distribution is a LSB compliant system.

0 commit comments

Comments
 (0)