配置 Debian Stretch 的安装源

简介: 采用最小化方式安装的 Debian,在没有接入网络的情况下,默认是没有配置 apt 安装源,也没有安装远程管理用的 SSH 服务的,这个时候就无法使用 apt-get install 在线安装软件的,为使用带来不便。
采用最小化方式安装的 Debian,在没有接入网络的情况下,默认是没有配置 apt 安装源,也没有安装远程管理用的 SSH 服务的,这个时候就无法使用 apt-get install 在线安装软件的,为使用带来不便。以下为大家提供几个 Debian Stretch 的 apt-get 源配置,详细有不好爱好者在使用 Stretch 时会遇到这个问题。

配置apt-get源

在开始配置新的 apt 源之前,可以先备份原有的安装文件,命令如下:

cp /etc/apt/sources.list /etc/apt/sources.list.backup

更新 apt 源配置文件

使用以下命令,重写整个配置文件即可:

cat  > /etc/apt/sources.list <<END
deb http://mirrors.163.com/debian/ stretch main
deb http://mirrors.163.com/debian/ stretch-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ stretch-updates main non-free contrib
deb http://mirrors.163.com/debian-security/ stretch/updates main non-free contrib
deb http://httpredir.debian.org/debian stretch-backports main contrib non-free
END

配置文件更新后,即可开始更新源的meta信息了。

sudo apt-get clean all && apt-get update 
sudo apt-get upgrade #更新系统

我们也可以使用阿里云的 Debian Stretch 源,具体的配置如下:

cat > /etc/apt/source.list <<END
deb http://mirrors.aliyun.com/debian stretch main contrib non-free
deb http://mirrors.aliyun.com/debian stretch-proposed-updates main contrib non-free
deb http://mirrors.aliyun.com/debian stretch-updates main contrib non-free

deb-src http://mirrors.aliyun.com/debian stretch main contrib non-free
deb-src http://mirrors.aliyun.com/debian stretch-proposed-updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian stretch-updates main contrib non-free

deb http://mirrors.aliyun.com/debian-security/ stretch/updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian-security/ stretch/updates main non-free contrib
deb http://mirrors.aliyuncs.com/debian stretch main contrib non-free
deb http://mirrors.aliyuncs.com/debian stretch-proposed-updates main contrib non-free
deb http://mirrors.aliyuncs.com/debian stretch-updates main contrib non-free

deb-src http://mirrors.aliyuncs.com/debian stretch main contrib non-free
deb-src http://mirrors.aliyuncs.com/debian stretch-proposed-updates main contrib non-free
deb-src http://mirrors.aliyuncs.com/debian stretch-updates main contrib non-free

deb http://mirrors.aliyuncs.com/debian-security/ stretch/updates main non-free contrib
deb-src http://mirrors.aliyuncs.com/debian-security/ stretch/updates main non-free contrib
END

Debian Stretch发布的细节,可以参考这里


原文发布时间: 2017-06-19
本文来自云栖社区合作伙伴“ Debian社区”,了解相关信息可以关注“ Debian社区”。
相关文章
|
3月前
|
Ubuntu Linux 索引
Centos 7、Debian及Ubuntu系统中安装和验证tree命令的指南。
通过上述步骤,我们可以在CentOS 7、Debian和Ubuntu系统中安装并验证 `tree`命令。在命令行界面中执行安装命令,然后通过版本检查确认安装成功。这保证了在多个平台上 `tree`命令的一致性和可用性,使得用户无论在哪种Linux发行版上都能使用此工具浏览目录结构。
347 78
|
1月前
|
Ubuntu 关系型数据库 MySQL
MySQL包安装 -- Debian系列(离线DEB包安装MySQL)
本文详细介绍了在Ubuntu 24.04、22.04、20.04及Debian 12系统上,通过离线DEB包安装MySQL 8.0和8.4版本的完整步骤。涵盖下载地址、依赖处理、dpkg安装顺序、配置方法及服务启动验证,确保用户可顺利部署MySQL数据库。
515 0
MySQL包安装 -- Debian系列(离线DEB包安装MySQL)
|
1月前
|
运维 Ubuntu 关系型数据库
MySQL包安装 -- Debian系列(Apt资源库安装MySQL)
本文介绍了在Debian系列系统(如Ubuntu、Debian 11/12)中通过APT仓库安装MySQL 8.0和8.4版本的完整步骤,涵盖添加官方源、配置国内镜像、安装服务及初始化设置,并验证运行状态,适用于各类Linux运维场景。
515 0
MySQL包安装 -- Debian系列(Apt资源库安装MySQL)
|
5月前
|
Ubuntu Linux Shell
Linux环境下VSCode快速安装终极指南:debian/ubuntu/linux平台通用
以上就是在Linux环境下安装VSCode的终极指南,抛开繁复的专业词汇,以平易近人的文字、形象生动的比喻让你轻松学会这一过程。别忘了,你的小伙伴VSCode已经在应用菜单里等你了!
1408 23
|
5月前
|
安全 应用服务中间件 Linux
Debian操作系统如何安装Nginx并开启HTTP2
本指南介绍了在Linux系统中通过源码编译安装Nginx的完整流程。首先更新软件包列表并安装必要的编译依赖,接着下载指定版本的Nginx源码包(如1.24.0),检查文件完整性后解压。随后通过配置脚本指定安装路径与模块(如HTTP SSL模块),执行编译和安装命令。最后创建软链接以便全局调用,并提供启动、停止及重载Nginx的命令,同时提醒注意安全组设置以确保正常访问。
|
8月前
|
Ubuntu 安全 调度
在Ubuntu下安装Debian包:dpkg与apt命令的深度解构。
安装Debian包的知识,就像掌握了海上的航行技术,虽然起初会让人感到陌生甚至困惑,但只要你积累熟练,就能在Ubuntu的世界里畅游无阻。就像每一位成功的航海家,掌握好这些工具,去探索属于你的Ubuntu新世界吧!
285 21
|
7月前
|
Ubuntu Linux
Ubuntu中dpkg和apt命令:debian包安装详解
希望这让你对于Ubuntu中的dpkg和apt命令有了更为清晰的理解。下次你面对软件包安装的问题,就可以轻松应对,优雅地在你的Linux系统中游刃有余了。
700 10
|
8月前
|
安全 网络安全 数据库
Debian12系统如何安装宝塔面板?
宝塔面板是一款便捷的服务器管理工具,界面直观易用,适合各技术水平用户。它支持网站部署、数据库管理,并提供安全防护功能。安装步骤简单:注册账号、连接服务器、运行脚本即可。确保系统满足最低要求(内存≥1GB,硬盘≥10GB),安装后通过浏览器登录管理。根据需求安装套件,完成网站配置。注意放行防火墙端口以保证正常访问。
532 0
|
12月前
|
Ubuntu
ubuntu和debian 的安装包dpkg管理命令对安装包进行安装,查询,卸载
Ubuntu dpkg 软件包管理命令概览:安装、卸载、查看和配置软件包。包括解决依赖、强制卸载、列出及过滤已安装包、查看包详情等操作。
624 10
|
Oracle Java 关系型数据库
在 Debian 12 上安装 Java 21
在 Debian 12 上安装 Java 21