mirror of
https://github.com/tuna/mirror-web.git
synced 2025-12-25 20:32:46 +00:00
help: adoptium: follow upstream doc
help: adoptium: fix url
This commit is contained in:
parent
3d03219670
commit
153cf40d3e
|
|
@ -12,64 +12,44 @@ mirrorid: Adoptium
|
|||
|
||||
### Debian/Ubuntu 用户
|
||||
|
||||
首先信任 GPG 公钥:
|
||||
|
||||
首先请安装依赖:
|
||||
```
|
||||
wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | apt-key add -
|
||||
apt-get update && apt-get install -y wget apt-transport-https
|
||||
```
|
||||
|
||||
再选择你的 Debian/Ubuntu 版本,文本框中内容写进 `/etc/apt/sources.list.d/Adoptium.list`
|
||||
然后信任 GPG 公钥:
|
||||
```
|
||||
wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | sudo tee /etc/apt/keyrings/adoptium.asc
|
||||
```
|
||||
|
||||
<form class="form-inline">
|
||||
<div class="form-group">
|
||||
<label>你的 Debian/Ubuntu 版本: </label>
|
||||
<select class="form-control release-select" data-template="#apt-template" data-target="#apt-content">
|
||||
<option data-os="debian" data-release="stretch">Debian 9 (Stretch)</option>
|
||||
<option data-os="debian" data-release="buster">Debian 10 (Buster)</option>
|
||||
<option data-os="debian" data-release="bullseye" selected>Debian 11 (Bullseye)</option>
|
||||
<option data-os="ubuntu" data-release="xenial">Ubuntu 16.04 LTS</option>
|
||||
<option data-os="ubuntu" data-release="bionic">Ubuntu 18.04 LTS</option>
|
||||
<option data-os="ubuntu" data-release="focal">Ubuntu 20.04 LTS</option>
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<p></p>
|
||||
<pre>
|
||||
<code id="apt-content">
|
||||
</code>
|
||||
</pre>
|
||||
随后执行以下命令来添加 apt 存储库:
|
||||
```
|
||||
echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://{{ site.hostname }}/Adoptium/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | sudo tee /etc/apt/sources.list.d/adoptium.list
|
||||
```
|
||||
|
||||
|
||||
再执行
|
||||
|
||||
```
|
||||
sudo apt-get update
|
||||
```
|
||||
|
||||
之后可以使用 `sudo apt-get install temurin-<version>-jdk` 安装软件包,例如 `temurin-17-jdk` 和 `temurin-8-jdk`。
|
||||
|
||||
{% raw %}
|
||||
<script id="apt-template" type="x-tmpl-markup">
|
||||
deb {{if os_name|equals>ubuntu}}https{{else}}http{{/if}}://{%endraw%}{{ site.hostname }}{%raw%}/Adoptium/deb {{release_name}} main
|
||||
</script>
|
||||
{%endraw%}
|
||||
|
||||
### CentOS/RHEL
|
||||
|
||||
新建 `/etc/yum.repos.d/Adoptium.repo`,内容为
|
||||
### CentOS/RHEL/Fedora
|
||||
|
||||
执行以下命令来添加 rpm 存储库:
|
||||
```
|
||||
cat <<EOF > /etc/yum.repos.d/adoptium.repo
|
||||
[Adoptium]
|
||||
name=Adoptium
|
||||
baseurl=https://{{ site.hostname }}/Adoptium/rpm/centos$releasever-$basearch/
|
||||
baseurl=https://{{ site.hostname }}/Adoptium/rpm/${DISTRIBUTION_NAME:-$(. /etc/os-release; echo $ID)}/\$releasever/\$basearch
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=https://packages.adoptium.net/artifactory/api/gpg/key/public
|
||||
EOF
|
||||
```
|
||||
|
||||
再执行
|
||||
|
||||
```
|
||||
sudo yum makecache
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in New Issue