非常によく忘れるので、メモ。
確認環境。
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal
$ uname -srvmpio
Linux 5.4.0-89-generic #100-Ubuntu SMP Fri Sep 24 14:50:10 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
aptのプロキシの設定を行うには、/etc/apt/apt.conf.d配下に以下のような設定ファイルを作成します。
/etc/apt/apt.conf.d/30proxy
Acquire::http::proxy "http://[your-proxy-host]:[your-proxy-port]/";
Acquire::https::proxy "http://[your-proxy-host]:[your-proxy-port]/";
設定ファイル名は、これ以外でもOKです。
dnfの場合は?
こちらへ。