「APT」:修訂間差異

出自Gea-Suan Lin's Wiki
跳至導覽 跳至搜尋
Gslin留言 | 貢獻
Gslin留言 | 貢獻
無編輯摘要
 
第7行: 第7行:
<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>
== 範例 ==
將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>
</syntaxhighlight>



於 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

相關連結

外部連結