apt源适用于debian和ubuntu系统,源文件地址是在:/etc/apt/sources.list

内容可以切换为以下内容:

ubuntu
cat > /etc/apt/sources.list<< EOF
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
EOF

以上可以看到是阿里源

debian 
cat >/etc/apt/sources.list <<EOF
deb http://mirrors.aliyun.com/debian stable main bullseye non-free
deb http://mirrors.aliyun.com/debian stable-proposed-updates main bullseye non-free
deb http://mirrors.aliyun.com/debian stable-updates main bullseye non-free
deb-src http://mirrors.aliyun.com/debian stable main bullseye non-free
deb-src http://mirrors.aliyun.com/debian stable-proposed-updates main bullseye non-free
deb-src http://mirrors.aliyun.com/debian stable-updates main bullseye non-free
EOF

 

apk源适用于alpine和andriod系统,源文件是在:/etc/apk/repositories

可以用下面的命令进行切换:

sed -i's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories   #切换为中科大源
sed -i's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories   #切换为阿里源
sed -i's/dl-cdn.alpinelinux.org/mirror.tuna.tsinghua.edu.cn/g' /etc/apk/repositories   #切换为清华源

 

常用工具安装:

apt install dnsutils  #nslookup
apt install iputils-ping #安装ping命令
apt-get install net-tools #安装ifconfig命令
apt-get install iproute2 #安装ip 命令

 

posted on 2021-05-11 14:51  EZgod  阅读(165)  评论(0编辑  收藏  举报