Set the following commands before using apt or yum.
export http_proxy=10.10.10.1:8080
export https_proxy=10.10.10.1:8080