Browse Source

Add docs on how to setup multiple apt repos/trees

pull/57/head
KemoNine 7 months ago
parent
commit
b7dd116a24
Signed by: KemoNine <kemonine@lollipopcloud.solutions> GPG Key ID: 9D79FBF661EC6779
1 changed files with 113 additions and 0 deletions
  1. 113
    0
      advanced/debian_multi_repo.md

+ 113
- 0
advanced/debian_multi_repo.md View File

@@ -0,0 +1,113 @@
1
+# Debian Multi Repo
2
+
3
+This setup is meant for those who need packages from non-stable Debian repositories. This should only be done as a **last resort**.
4
+
5
+We've included these documents for our more advanced users, integrators and others who are working on more experimental and advanced Lollipop Cloud deployments.
6
+
7
+If you weren't linked here via other documentation or aren't sure if you need this. You don't.
8
+
9
+## Inspiration / Further Reading
10
+
11
+- [https://serverfault.com/questions/22414/how-can-i-run-debian-stable-but-install-some-packages-from-testing](https://serverfault.com/questions/22414/how-can-i-run-debian-stable-but-install-some-packages-from-testing)
12
+
13
+# Setup Apt preferences
14
+
15
+For stable, testing, unstable, experiemental with weights that prioritize more stable apt repos.
16
+
17
+``` bash
18
+
19
+cat > /etc/apt/preferences.d/stable.pref <<EOF
20
+# 500 <= P < 990: causes a version to be installed unless there is a
21
+# version available belonging to the target release or the installed
22
+# version is more recent
23
+
24
+Package: *
25
+Pin: release a=stable
26
+Pin-Priority: 900
27
+EOF
28
+
29
+cat > /etc/apt/preferences.d/testing.pref <<EOF
30
+# 100 <= P < 500: causes a version to be installed unless there is a
31
+# version available belonging to some other distribution or the installed
32
+# version is more recent
33
+
34
+Package: *
35
+Pin: release a=testing
36
+Pin-Priority: 400
37
+EOF
38
+
39
+cat > /etc/apt/preferences.d/unstable.pref <<EOF
40
+# 0 < P < 100: causes a version to be installed only if there is no
41
+# installed version of the package
42
+
43
+Package: *
44
+Pin: release a=unstable
45
+Pin-Priority: 50
46
+EOF
47
+
48
+cat > /etc/apt/preferences.d/experimental.pref <<EOF
49
+# 0 < P < 100: causes a version to be installed only if there is no
50
+# installed version of the package
51
+
52
+Package: *
53
+Pin: release a=experimental
54
+Pin-Priority: 1
55
+EOF
56
+
57
+```
58
+
59
+# Reset Original Apt Sources
60
+
61
+You'll want to verify ```/etc/apt/sources.list``` doesn't contain anything important or useful prior to moving it out of the way.
62
+
63
+``` bash
64
+
65
+mv /etc/apt/sources.list /etc/apt/sources.list.orig
66
+
67
+```
68
+
69
+# Setup New Apt Lists
70
+
71
+``` bash 
72
+
73
+cat > /etc/apt/sources.list.d/stretch.list <<EOF
74
+deb http://httpredir.debian.org/debian stretch main contrib non-free
75
+deb http://httpredir.debian.org/debian stretch-updates main contrib non-free
76
+deb http://security.debian.org/ stretch/updates main contrib non-free
77
+EOF
78
+
79
+cat > /etc/apt/sources.list.d/testing.list <<EOF
80
+deb http://httpredir.debian.org/debian testing main contrib non-free
81
+EOF
82
+
83
+cat > /etc/apt/sources.list.d/unstable.list <<EOF
84
+deb http://httpredir.debian.org/debian unstable main contrib non-free
85
+EOF
86
+
87
+cat > /etc/apt/sources.list.d/experimental.list <<EOF
88
+deb http://httpredir.debian.org/debian experimental main contrib non-free
89
+EOF
90
+
91
+```
92
+
93
+# Setup Apt to default tree
94
+
95
+Default to stable
96
+
97
+``` bash
98
+
99
+cat > /etc/apt/apt.conf.d/99defaultrelease <<EOF
100
+APT::Default-Release "stable";
101
+EOF
102
+
103
+```
104
+
105
+# Update Apt
106
+
107
+Last step: update the apt repos to include the changes
108
+
109
+``` bash
110
+
111
+apt-get update
112
+
113
+```

Loading…
Cancel
Save