美文网首页
docker-debian8 jessie修改软件源

docker-debian8 jessie修改软件源

作者: 雨中星辰0 | 来源:发表于2024-07-31 21:47 被阅读0次
作者 时间
雨中星辰 2024-08-01

概述

debian8默认的软件源,已经不可用了,如下。

root@0dfb1a8cd84e:/# apt-get update
Ign http://security.debian.org jessie/updates InRelease
Ign http://security.debian.org jessie/updates Release.gpg
Ign http://deb.debian.org jessie InRelease
Ign http://security.debian.org jessie/updates Release
Ign http://deb.debian.org jessie-updates InRelease
Err http://security.debian.org jessie/updates/main amd64 Packages

Ign http://deb.debian.org jessie Release.gpg
Ign http://deb.debian.org jessie-updates Release.gpg
Err http://security.debian.org jessie/updates/main amd64 Packages

Ign http://deb.debian.org jessie Release
Ign http://deb.debian.org jessie-updates Release
Err http://security.debian.org jessie/updates/main amd64 Packages

Err http://security.debian.org jessie/updates/main amd64 Packages

Err http://security.debian.org jessie/updates/main amd64 Packages
  404  Not Found [IP: 151.101.130.132 80]
Err http://deb.debian.org jessie/main amd64 Packages
  404  Not Found
Err http://deb.debian.org jessie-updates/main amd64 Packages
  404  Not Found
W: Failed to fetch http://security.debian.org/debian-security/dists/jessie/updates/main/binary-amd64/Packages  404  Not Found [IP: 151.101.130.132 80]

W: Failed to fetch http://deb.debian.org/debian/dists/jessie/main/binary-amd64/Packages  404  Not Found

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/main/binary-amd64/Packages  404  Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.

解决思路

修改默认的软件源,例如,阿里的软件源


image.png

由于容器没有vim,我们使用vim打开文件并修改,这里使用 echo将数据写入文件。

    echo "deb https://mirrors.aliyun.com/debian-archive/debian/ jessie main non-free contrib" > /etc/apt/sources.list
    echo "deb-src https://mirrors.aliyun.com/debian-archive/debian/ jessie main non-free contrib" >> /etc/apt/sources.list

更新apt,apt-get update

root@0dfb1a8cd84e:/# apt-get update
E: The method driver /usr/lib/apt/methods/https could not be found.
N: Is the package apt-transport-https installed?

更新时,遇到了错误,提示https不存在,需要安装,我们这里安装一下

root@0dfb1a8cd84e:/# apt-get install apt-transport-https
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package apt-transport-https

提示找不到这个包。
查看上面的步骤,我们发现,我们安装的apt源是https,猜测是否跟这个有关系,将apt源的https修改为http

    echo "deb http://mirrors.aliyun.com/debian-archive/debian/ jessie main non-free contrib" > /etc/apt/sources.list
    echo "deb-src http://mirrors.aliyun.com/debian-archive/debian/ jessie main non-free contrib" >> /etc/apt/sources.list

然后,再次更新下apt,一切都比较顺利

root@0dfb1a8cd84e:/# apt-get update
Ign http://mirrors.aliyun.com jessie InRelease
Get:1 http://mirrors.aliyun.com jessie Release.gpg [2420 B]
Hit http://mirrors.aliyun.com jessie Release
Ign http://mirrors.aliyun.com jessie Release
Get:2 http://mirrors.aliyun.com jessie/main Sources [9169 kB]
Get:3 http://mirrors.aliyun.com jessie/non-free Sources [119 kB]
Get:4 http://mirrors.aliyun.com jessie/contrib Sources [58.9 kB]
Get:5 http://mirrors.aliyun.com jessie/main amd64 Packages [9098 kB]
Get:6 http://mirrors.aliyun.com jessie/non-free amd64 Packages [101 kB]
Get:7 http://mirrors.aliyun.com jessie/contrib amd64 Packages [59.2 kB]
Fetched 14.2 MB in 10s (1373 kB/s)
Reading package lists... Done
W: GPG error: http://mirrors.aliyun.com jessie Release: The following signatures were invalid: KEYEXPIRED 1587841717

安装个软件软件测试一下,一切顺利,至此软件源就修改完毕了。

root@0dfb1a8cd84e:/# apt-get install net-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  net-tools
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 225 kB of archives.
After this operation, 803 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  net-tools
Install these packages without verification? [y/N] y
Get:1 http://mirrors.aliyun.com/debian-archive/debian/ jessie/main net-tools amd64 1.60-26+b1 [225 kB]
Fetched 225 kB in 0s (1094 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package net-tools.
(Reading database ... 7621 files and directories currently installed.)
Preparing to unpack .../net-tools_1.60-26+b1_amd64.deb ...
Unpacking net-tools (1.60-26+b1) ...
Setting up net-tools (1.60-26+b1) ...

相关文章

  • docker swarm部署minio集群

    安装系统 略 更换软件源 首先备份原来的软件源并另存: 编辑软件源文件 注释所有软件源 阿里云源: 清华源 修改完...

  • Docker 常用工具

    替换 apt 源 Dockerfile 修改 debian 设置软件源为阿里云

  • Ubuntu修改镜像源的两种方法

    由于Ubuntu软件源默认下载服务器为外网,下载速度较慢,因此常常需要修改下载源,修改源有图形界面修改和文件修改两...

  • 今日头像|乘风破浪的姐姐

    图源:陈四节Jessie

  • 修改Linux软件源

    生物信息中,常用的Linux发行版为 Ubuntu 以及CentOS。本文以设置清华大学软件源为例,更改替换 Ub...

  • Linux修改软件源

    以Ubuntu16.04为例 操作步骤 1 备份原来的源文件 2 编辑源文件 编辑器打开源文件 清空后输入以下内容...

  • 更改源

    修改官方软件源: System Settings --> Software & Updates --> Ubunt...

  • 多快好省,Linux下载及软件源修改(含python)

    目录 linux发行版下载 linux软件源配置 pip软件源修改 前言:折腾linux及python多年,竟不了...

  • NPM模块patch流程

    下载模块对应的开源软件源码 进入源码目录,使用link命令安装为本地源 到应用目录下把对应模块修改为本地源 修改源...

  • 树莓派上配置Snowboy

    1 树莓派系统 09-07版本的系统,不要jessie版 2 修改阿里的源 3 按照文档给的安装依赖 4 配置麦克...

网友评论

      本文标题:docker-debian8 jessie修改软件源

      本文链接:https://www.haomeiwen.com/subject/vbnnhjtx.html