linux镜像配置

装完linux系统第一件事,先配置镜像
装完linux系统第一件事,先配置镜像
装完linux系统第一件事,先配置镜像

适用于安装任何环境,比如conda、pip
以下以Debian举例,其他系统也适用

①linux的系统镜像可以在这里找到:
阿里镜像

②查看linux发行版版本号(用来配置对应源)

cat /etc/issue

③配置源是修改 /etc/apt/sources.list 这个文件

先备份原文件

cp /etc/apt/sources.list /etc/apt/sources.list_backup

修改现有文件

vim /etc/apt/sources.list

粘贴并保存退出(这里不同版本只需要粘贴对应代码就可以了)

deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib

④更新apt

apt-get upgrade
apt-get update

⑤完成,现在可以愉快地 apt-get install 了

你可能感兴趣的:(环境配置&操作,linux,debian,运维)