===== Setup self hosted Chocolatey Repository/Proxy on Linux =====
To host a local repository for [[https://chocolatey.org|Chocolatey]] either as server for self-hosted packages or as proxy server for any NuGet server/the official chocolatey repository server we use Solartype Nexus3: [[https://www.sonatype.com/products/sonatype-nexus-repository|sonatype.com - Nexus3]]
**Currently not working because of an missing Key-File from Sonatype, this guide is partially outdated. Newer versions require Java13 for running.** The only way to install ''sonatype-nexus-repository-manager'' is by downloading the .deb file manually from [[https://repo.sonatype.com/|repo.sonatype.com]].
Therefore that ''Nexus3'' required ''Java **8**'' it's recommended to use a Ubuntu Server (in this case ''24'') because Ubuntu still serves Java 8 from the official repository which Debian doesn't.
==== Installation ====
- Download Ubuntu Server from here: [[https://ubuntu.com/download/server|ubuntu.com/download/server]] and install your machine.
- Install Java8: sudo apt install openjdk-8-jdk
- Add Sonatype's APT repository to sources lists: wget -P /etc/apt/sources.list.d/ https://repo.sonatype.com/repository/community-hosted/deb/sonatype-community.list
- Add the repositories key: nano sonatype-apt-repo.key
And paste the following content: -----BEGIN PGP PUBLIC KEY BLOCK-----
mQGNBF1Uv8ABDAD0Te7EGf8n4jUKzeD9YfqqiPUs/Q54QBOQeFHe+pdMQeC7O8Kl
W3AX0Qy1C0SUZWlDkOt3F+5ct18S/xT/42bVQYHzaT05zIjlwxqiSB8ApVnR9Gpm
+N2u6eNyHCXItsdNwV8djd9B5nsRd0Gqgzmklt8bxZUX9NI0OQmbcquEg46Kt65J
IueVqy/qM4vdZSIH3+f/klHblBty8JHNorbNXdtz8e7PuzshVghULKlvgnJmQWdG
XJsMuWpKYUhDtsN4UHOzsS7uFBn/cWlLYs9bQy9BmK/8tBfcMtoXZGq3/c+fN9fj
9wdxNeTrbMEsZiaLOLHCZwKEbn03+OjJKtTAxu6Q+benc9/++0BMhQK4gqj7zQW+
CPlN+gg+PX4WVreU8rhT3kgTGCMm2aGiCjBg/aF4BmewLl/+CPgpw9VrFAKPN7w/
fE5Smcrmta4i4DFSQoMYclOObzjr3qydx8INcRyXWEXPH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oI4dAyTOnf7w11smIYCBjc07VOUtraRfGkjQ
5TXfmPC5LVBo8OXLhkcmpYQwFHnncqFzzK20iGM1plc758Enwzx2elGVhXdw5upF
LQUHYU29vHePRwlv/AGAjl+UzZWrE7IKNrphc1bKFsAHJZ0MisJu4BtHTGKcY6EZ
rmnGEW32iCvrZTWcwICRDWx77IZFABEBAAGJAbwEGAEKACYCGwwWIQTneIjHZxTr
1xlAJeqWS15yCqTzGgUCYRrPpAUJCWmqZAAKCRCWS15yCqTzGiNODACh5Ho5RlBJ
PQcsyaBpLkpzJvmY59Q7g50pAWd9GoLF0rnJi5jd7+senRwHYWig4H/9+01lx7fi
7sI2Cd96xXV01pp6OpopR346IvbiNOPzk6ngpFfFc90ujA5CrXjj+lMl5VzV3QOO
nVHOvFXkT0wMloHq8MdYzkLFuSETEcEdvKM9E5yXhUo0BCC60G+YZTvMuITvAw4i
5xBnLIdKHmOXZhCq3ChtwFf/hXhGH7Xf5F9pHPmHx6tC7+uJ0Tovpk7Jd42YLtHT
RMH/Q39OxFfGHOIvrzuHa6cpKaBlE0/Zqs9DGJE7pKetyWA5aRNWElGFWFgOsE0j
0duTbAh/xyvAb9LF2F2XP21EoCmA3mHd2/SVMQfenvk9i8VcB5KBZYKt5kvsoFvy
5YA5ENG8dtMQDyfV3dhUWpzghOOgOof05fp/JUNdHTEHbjh57yj+W04KNsPAl84E
dq6/peJdFjJp7dHV94yQjv1O4OcNtriD2kTBtucc+XswPSFgyeoR8tQ=
=1ghU
-----END PGP PUBLIC KEY BLOCK-----
- Then update the repositories: sudo apt update
- And install Nexus3: sudo apt install nexus-repository-manager
- When everything was successful, enter the webservice with http://:8081/
- The password for ''admin'' is located under ''/opt/sonatype/sonatype-work/nexus3/admin.password'' after entering the password, it's forced to be changed.cat /opt/sonatype/sonatype-work/nexus3/admin.password
The installation of Nexus is now finished!
==== Setup Repository ====
=== NuGet Proxy ===
To add a new NuGet (Chocolatey) repository proxy add a new ''nuget (proxy)''. To proxy the official Chocolatey repository add the following URL as URL:
https://community.chocolatey.org/api/v2/
Finally save the proxy repository.
=== NuGet Hosted ===
If the repository should also host packages locally add a new ''nuget (hosted)''.
This section will be extended later.
=== NuGet Group ===
To make the proxy-repository and all local hosted packages available through one URL, add a ''nuget-group'' on the repository tab. Then add both ''nuget-proxy'' and ''nuget-hosted'' to the group.
-----
//Sourced from://
* //[[https://github.com/sonatype-nexus-community/nexus-repository-installer|github.com/sonatype-nexus-community]]//
* //[[https://www.howtoforge.com/how-to-install-nexus-repository-manager-on-ubuntu-22-04/|howtoforge.com - install Nexus3 on Ubuntu22]]//
* //[[https://stackoverflow.com/questions/45867716/nexus-to-serve-up-chocolately-packages|stackoverflow.com - Nexus serve up chocolatey]]//