【问题标题】:Adding Debian 9 (Stretch) Backports to my sources.list将 Debian 9 (Stretch) Backports 添加到我的 sources.list
【发布时间】:2018-10-08 10:20:53
【问题描述】:

我正在尝试通过使用 Certbot 来保护网站,我遇到的问题是关于“stretch-backports” 这是 certbot 询问我的代码行,但是我收到一条错误消息,说“stretch-backports”不是可用来源的一部分。

$ sudo apt-get install certbot -t stretch-backports

所以我尝试使用这一行添加反向端口:

deb http://ftp.debian.org/debian stretch-backports main

但“deb”未被识别。所以我安装了类似的gdebi:

sudo apt-get install gdebi

安装后,我再次尝试了上一行并稍作修改:

gdebi http://ftp.debian.org/debian stretch-backports main

现在它显示“gdebi 错误,找不到文件:http://http.debian.net/debian

所以我的问题是双重的,如果我在前面的步骤中没有搞砸,是否有人拥有伸展反向端口的功能地址,并且 gdebi 是 deb 的一个很好的替代品吗?

提前谢谢你。

【问题讨论】:

    标签: shell security debian


    【解决方案1】:

    您还可以通过 echo 将密钥附加到 sources.list。

    sudo echo "deb http://deb.debian.org/debian stretch-backports main" | tee -a /etc/apt/sources.list
    

    我的完整安装脚本是(全部以 root 或 sudo 运行)

    echo "deb http://deb.debian.org/debian stretch-backports main" | tee -a /etc/apt/sources.list
    apt-get update
    apt-get install certbot python-certbot-apache -t stretch-backports
    

    【讨论】:

    • 对于管道版本,“sudo”需要在“tee -a”调用中,而不是“echo”
    【解决方案2】:

    引用official backports documentation

    为杰西添加这一行

    deb http://ftp.debian.org/debian jessie-backports main
    

    到您的sources.list(或添加一个带有“.list”扩展名的新文件到 /etc/apt/sources.list.d/) 您还可以在以下位置找到其他镜像列表 https://www.debian.org/mirror/list

    为拉伸添加这一行

    deb http://ftp.debian.org/debian stretch-backports main
    

    到您的sources.list(或添加一个带有“.list”扩展名的新文件到 /etc/apt/sources.list.d/) 您还可以在以下位置找到其他镜像列表 https://www.debian.org/mirror/list

    现在这些说明看起来很清楚(而不是“相当模糊”),您应该编辑文件,而不是运行 deb 命令。

    (可能“你的sources.list”可以改成“你的/etc/apt/sources.list”)

    【讨论】:

    • 感谢您的意见!但是我们必须同意不同意,我看到了那个文件,对于一些官方的东西,我没有发现它很清楚,我坚持这一点!我承认我的答案并没有好多少,但感谢您的干预,它可以!
    【解决方案3】:

    好的,所以我发现了它的工作原理并想回答,因为我觉得我找到的文档非常模糊,所以这就是您将 Debian 9 拉伸反向端口添加到您的 sources.list 的方式:

    • 使用管理员权限手动导航到 /etc/apt/sources.list,然后创建您的 stretch-backport.list 文件,然后使用 nano 输入它,在我的例子中,我添加了这一整行:

      deb http://ftp.debian.org/debian stretch-backports main
      

    到这里

     sudo nano /etc/apt/sources.list.d/stretch-backports.list
    

    就这么简单,然后我可以使用以下行而不会出现任何错误:

    sudo apt-get install certbot -t stretch-backports
    

    来了!希望我是清楚的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-01
      相关资源
      最近更新 更多