「APT」:修訂間差異
跳至導覽
跳至搜尋
無編輯摘要 |
無編輯摘要 |
||
(未顯示同一使用者於中間所作的 5 次修訂) | |||
第1行: | 第1行: | ||
'''APT'''是一套套件管理系統。 | '''APT'''是一套套件管理系統,源自[[Debian]]。 | ||
== 工具 == | |||
把Legacy Format轉成DEB822格式,這邊要注意只支援GNU Awk: | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
gawk '{if ($1 ~ /^deb/) {printf("Enabled: yes\nTypes: %s\nURIs: %s\nSuites: %s\nComponents: %s\n%s", $1, $(NF-2), $(NF-1), $NF, signedby); if (match($0, /arch=([^ \]]*)/, a)) printf("Architectures: %s\n", a[1]); if (match($0, /signed-by=([^ \]]*)/, a)) printf("Signed-by: %s\n", a[1])}}' | gawk '{if ($1 ~ /^deb/) {printf("Enabled: yes\nTypes: %s\nURIs: %s\nSuites: %s\nComponents: %s\n%s", $1, $(NF-2), $(NF-1), $NF, signedby); if (match($0, /arch=([^ \]]*)/, a)) printf("Architectures: %s\n", a[1]); if (match($0, /signed-by=([^ \]]*)/, a)) printf("Signed-by: %s\n", a[1])}}' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== 範例 == | |||
將HTTP與HTTPS都使用HTTPS Proxy: | |||
<syntaxhighlight lang="bash"> | |||
sudo env http_proxy=https://user:pass@proxy-tls.example.com:4128/ https_proxy=https://user:pass@proxy-tls.example.com:4128/ apt update | |||
</syntaxhighlight> | |||
== 相關連結 == | |||
* [[Debian]] | |||
* [[Ubuntu]] | |||
== 外部連結 == | |||
* {{Official|https://wiki.debian.org/AptCLI}} {{en}} | |||
[[Category:軟體]] |
於 2024年12月20日 (五) 11:27 的最新修訂
APT是一套套件管理系統,源自Debian。
工具
把Legacy Format轉成DEB822格式,這邊要注意只支援GNU Awk:
gawk '{if ($1 ~ /^deb/) {printf("Enabled: yes\nTypes: %s\nURIs: %s\nSuites: %s\nComponents: %s\n%s", $1, $(NF-2), $(NF-1), $NF, signedby); if (match($0, /arch=([^ \]]*)/, a)) printf("Architectures: %s\n", a[1]); if (match($0, /signed-by=([^ \]]*)/, a)) printf("Signed-by: %s\n", a[1])}}'
範例
將HTTP與HTTPS都使用HTTPS Proxy:
sudo env http_proxy=https://user:pass@proxy-tls.example.com:4128/ https_proxy=https://user:pass@proxy-tls.example.com:4128/ apt update
相關連結
外部連結
- 官方網站 (英文)