|
| 1 | +# Additional packages |
| 2 | + |
| 3 | +The controller domain (dom0) is a privileged linux VM, based on CentOS. |
| 4 | + |
| 5 | +It may be useful to add more packages to it, with precaution. The XCP-ng project offers some in its repositories, and other packages can be installed from CentOS, EPEL, or even third party repositories. |
| 6 | + |
| 7 | +## Rules |
| 8 | + |
| 9 | +### 1. Never enable additional repositories |
| 10 | + |
| 11 | +The [update process](https://github.com/xcp-ng/xcp/wiki/Updates-Howto) for XCP-ng assumes that **only XCP-ng repositories are enabled**. If you enable more repositories, updates may get pulled from there and overwrite XCP-ng packages and thus **break your system**. |
| 12 | + |
| 13 | +**Warning**: some third party repositories are auto-enabled when installed. This is the case of EPEL, for example. Installing `epel-release` (the common way to enable it on CentOS) will automatically enable it. To solve this, EPEL repositories are added at system installation since XCP-ng 8.0, but they are *disabled*. |
| 14 | + |
| 15 | +*But then, how to install from such additional repositories?* |
| 16 | + |
| 17 | +You simply need to learn `yum`'s `--enablerepo` switch. Very handy, it enables one or more repositories **only for the current execution of the command**, without enabling the repo system-wide. |
| 18 | + |
| 19 | +See section *How to install* below for practical details. |
| 20 | + |
| 21 | +To disable a repository, edit `/etc/yum.repos.d/name_of_repo.repo` and set `enabled=0` where the value is `1`. |
| 22 | + |
| 23 | +### 2. Prefer additional packages from XCP-ng's own repositories |
| 24 | + |
| 25 | +We offer a number of additional packages ranging from [ZFS support](https://github.com/xcp-ng/xcp/wiki/ZFS-on-XCP-ng), [newer drivers](https://github.com/xcp-ng/xcp/wiki/Kernel-modules-policy#how-to-use-alternate-or-additional-modules) or [newer kernel](https://github.com/xcp-ng/xcp/wiki/Alternate-kernel), to small utilities such as `vim`, `joe`, `iperf`, `mc`, etc. |
| 26 | + |
| 27 | +A list of such utilities is available at https://github.com/xcp-ng/xcp/issues/56#issuecomment-480337976. It is a wishlist from the community. The "action" column will tell you if the utility is available in XCP-ng repositories. |
| 28 | + |
| 29 | +Packages installed from our repositories are: |
| 30 | +* tested |
| 31 | +* maintained (security/bugfix updates) |
| 32 | + |
| 33 | +:::warning |
| 34 | +Anything installed from outside XCP-ng repositories is at your own risk |
| 35 | +::: |
| 36 | + |
| 37 | +### 3. Do not overwrite existing packages from the system |
| 38 | + |
| 39 | +Some repositories contain packages that have a higher version number than ours. `yum` will tend to want to install them over our packages. Always check that it is not trying to overwrite on of our packages. |
| 40 | + |
| 41 | +### 4. Keep your dom0 minimal |
| 42 | + |
| 43 | +The controller domain is not an all-purpose linux system. It must remain minimal to do what it is meant to do efficiently. |
| 44 | +* Avoid bloat (do not attempt to transform it into a linux workstation. Use a VM instead.) |
| 45 | +* Avoid CPU or RAM-intensive programs |
| 46 | +* Avoid software that pulls in many dependencies |
| 47 | +* Avoid any software that may interfere with the existing |
| 48 | + |
| 49 | +### 5. Ask before |
| 50 | + |
| 51 | +If you have [pro support](https://xcp-ng.com), ask there. As part of the support, additional supported packages may be provided. Else ask the community on the [forum](https://xcp-ng.org/forum/). |
| 52 | + |
| 53 | +## How to install |
| 54 | + |
| 55 | +Before doing any change, start keeping track somewhere of any change you bring to the system. This will help for: |
| 56 | +* support |
| 57 | +* knowing what packages you need to update regularly for security fixes or bugfixes |
| 58 | +* reinstalling them after a system upgrade via the installation ISO |
| 59 | + |
| 60 | +### From XCP-ng repositories |
| 61 | + |
| 62 | +`yum install name_of_package` |
| 63 | + |
| 64 | +### From CentOS repositories |
| 65 | + |
| 66 | +The CentOS repos are already installed but are disabled, on purpose. Install from them with: |
| 67 | +``` |
| 68 | +yum install name_of_package --enablerepo=base,updates |
| 69 | +``` |
| 70 | + |
| 71 | +Make sure it will not try to overwrite system packages with updates from CentOS. XCP-ng uses fixed or modified versions of some CentOS packages whereas the CentOS repos point at the latest. |
| 72 | + |
| 73 | +### From EPEL repositories |
| 74 | + |
| 75 | +On XCP-ng 8.0, the EPEL repos are already installed but are disabled, on purpose. Install from them with: |
| 76 | +``` |
| 77 | +yum install name_of_package --enablerepo=epel |
| 78 | +``` |
| 79 | + |
| 80 | +Sometimes you'll need extra dependencies from CentOS. Replace the command with: |
| 81 | +``` |
| 82 | +yum install name_of_package --enablerepo=epel,base,updates |
| 83 | +``` |
| 84 | + |
| 85 | +And as above make sure no package from the system will get overwritten in the process. |
| 86 | + |
| 87 | +On XCP-ng 7.6: |
| 88 | +* `yum install epel-release --enablerepo=extras` |
| 89 | +* then edit `/etc/yum.repos.d/epel.repo` and set `enabled=0` |
| 90 | +* then `yum install name_of_package --enablerepo=epel` |
| 91 | + |
| 92 | +### From other third party repositories |
| 93 | + |
| 94 | +1. Avoid that if possible |
| 95 | +2. Be extra cautious |
| 96 | +3. After installing the repository, disable it right away (`enabled=0` in repo file) |
| 97 | +4. install packages with: `yum install name_of_package --enablerepo=name_of_repo` |
| 98 | + |
| 99 | +And as usual make sure it won't overwrite existing packages... |
| 100 | + |
| 101 | +## Up to date additional packages |
| 102 | + |
| 103 | +If you installed from XCP-ng repositories, [they will be updated like the rest of the XCP-ng system](updates.md). |
| 104 | + |
| 105 | +If you installed from any other repository, including CentOS and EPEL, you need to update them (and their dependencies) manually |
| 106 | + |
| 107 | +## System upgrade |
| 108 | + |
| 109 | +See [upgrade section](upgrade.md) for a discussion of the differences between "Installer upgrade" and "`yum`-style upgrade". |
| 110 | + |
| 111 | +Installer upgrade will reinstall the system from scratch and just keep your configuration related to XCP-ng (network, VMs, SRs, etc.). Anything else will have to be re-done. |
| 112 | + |
| 113 | +`yum-style` upgrade will try to update or keep the packages that you installed. Packages installed from XCP-ng repositories should get updated seamlessly. Packages from other repositories will not get updated: they may be left in place (then you'll have to update them yourselves if needed), removed (due to package conflicts or because they are obsoleted by packages from the updated XCP-ng) or even make the upgrade fail until they are manually removed. |
0 commit comments