Debian11系统简单配置

debian11系统简单配置

网卡配置

  1. 修改/etc/network/interfaces
bash 复制代码
address 192.168.0.188 
gateway 192.168.0.1 
netmask 255.255.255.0
  1. 重启网卡systemctl restart networking.service
    systemctl restart networking

执行apt 报错

bash 复制代码
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) 手册以了解仓库创建和用户配置方面的细节。

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

bash 复制代码
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

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

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

bash 复制代码
#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

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

bash 复制代码
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
然后重启服务

systemctl restart systemd-resolved.service

查看结果
bash 复制代码
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
重启网络服务
bash 复制代码
root@localhost:/# /etc/init.d/networking restart
Restarting networking (via systemctl): networking.servic
相关推荐
likfishdn3 分钟前
Linux的文件与目录管理
linux·运维·服务器
chian-ocean22 分钟前
Linux 文件缓冲区:高效数据访问的幕后推手
linux·运维·服务器
加油=^_^=24 分钟前
【Linux】进程优先级 | 进程调度(三)
linux·运维·服务器
吃汤圆的抹香鲸1 小时前
GoLand 安装包 绿色版 Win,Mac,Linux 包含IntelliJ全家桶 专为Go语言设计的集成开发环境(IDE)
linux·windows·macos·go·intellij-idea·go1.19
追寻光1 小时前
Cannot find a valid baseurl for repo: base/7/x86_64
linux
元气满满的热码式1 小时前
Docker数据卷操作实战
linux·运维·docker·云原生·容器
陆沙1 小时前
deepseek-r1-centos-本地服务器配置方法
linux·服务器·centos
北京耐用通信1 小时前
航空装配自动化神器Ethercat转profient网关搭配机器人精准控制
运维·机器人·自动化
吃汤圆的抹香鲸1 小时前
Rider 安装包 绿色版 Win/Mac/Linux 适合.NET和游戏开发者使用 2025全栈开发终极指南:从零配置到企业级实战
linux·运维·windows·sql·游戏·macos·.net
sz66cm2 小时前
Linux基础 -- ARM 32 位架构动态注入代码技术文档
linux·arm开发·架构