• Debian11系统简单配置


    debian11系统简单配置

    网卡配置

    1. 修改/etc/network/interfaces
    
    address 192.168.0.188 
    gateway 192.168.0.1 
    netmask 255.255.255.0
    
    • 1
    • 2
    • 3
    • 4
    1. 重启网卡systemctl restart networking.service
      systemctl restart networking

    执行apt 报错

    root@debian:~# apt update
    忽略:1 cdrom://[Debian GNU/Linux 11.7.0 _Bullseye_ - Official amd64 DVD Binary-1 20230429-11:50] bullseye InRelease
    错误:2 cdrom://[Debian GNU/Linux 11.7.0 _Bullseye_ - Official amd64 DVD Binary-1 20230429-11:50] bullseye Release
      请使用 apt-cdrom,通过它可以让 APT 识别该盘片。apt-get upgdate 不能被用来加入新的盘片。
    正在读取软件包列表... 完成
    E: 仓库 “cdrom://[Debian GNU/Linux 11.7.0 _Bullseye_ - Official amd64 DVD Binary-1 20230429-11:50] bullseye Release” 没有 Release 文件。
    N: 无法安全地用该源进行更新,所以默认禁用该源。
    N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8

    修改源,禁用DVD,并设置为网易源

    cat > /etc/apt/sources.list << EOF
    deb https://mirrors.163.com/debian/ bullseye main non-free contrib
    deb-src https://mirrors.163.com/debian/ bullseye main non-free contrib
    deb https://mirrors.163.com/debian-security/ bullseye-security main
    deb-src https://mirrors.163.com/debian-security/ bullseye-security main
    deb https://mirrors.163.com/debian/ bullseye-updates main non-free contrib
    deb-src https://mirrors.163.com/debian/ bullseye-updates main non-free contrib
    deb https://mirrors.163.com/debian/ bullseye-backports main non-free contrib
    deb-src https://mirrors.163.com/debian/ bullseye-backports main non-free contrib
    EOF
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10

    配置DNS:(此方法重启失效)

    root@localhost:/# cat /etc/resolv.conf

    #This file is managed by man:systemd-resolved(8). Do not edit.
    #See man:systemd-resolved.service(8) for details about the supported modes of
    #operation for /etc/resolv.conf. 
    nameserver 192.168.0.1
    options edns0 trust-ad
    
    • 1
    • 2
    • 3
    • 4
    • 5

    配置DNS 长期有效,resolv.conf 现在归systemd管,需要修改/etc/systemd/resolved.conf 文件

    root@localhost:/# cat /etc/systemd/resolved.conf 
    #This file is part of systemd.
    #See resolved.conf(5) for details
    [Resolve]
    DNS=192.168.0.1
    #FallbackDNS=
    #Domains=
    #LLMNR=no
    #MulticastDNS=no
    #DNSSEC=no
    #DNSOverTLS=no
    #Cache=no-negative
    #DNSStubListener=yes
    #ReadEtcHosts=yes
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    然后重启服务

    systemctl restart systemd-resolved.service

    查看结果
    root@localhost:/# systemd-resolve --status
    Global
           LLMNR setting: no                  
    MulticastDNS setting: no                  
      DNSOverTLS setting: no                  
          DNSSEC setting: no                  
        DNSSEC supported: no                  
             DNS Servers: 192.168.0.1         
              DNSSEC NTA: 10.in-addr.arpa     
                          16.172.in-addr.arpa 
                          168.192.in-addr.arpa
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    重启网络服务
    root@localhost:/# /etc/init.d/networking restart
    Restarting networking (via systemctl): networking.servic
    
    • 1
    • 2
  • 相关阅读:
    DALL E2【论文阅读】
    postgresql之except函数和strpos函数
    对比学习系列(三)-----SimCLR
    单体120万连接,小爱网关如何架构?
    C Primer Plus(6) 中文版 第6章 C控制语句:循环 6.11 数组简介
    kafka生产者和消费者(python版)
    S7-200SMART PLC实现冒泡排序的具体方法和程序示例
    渗透测试-域内密码凭证获取
    IOS自动化之批量解锁&锁定屏幕
    Python 常用的开源爬虫库介绍
  • 原文地址:https://blog.csdn.net/weixin_42414349/article/details/133933330