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
相关推荐
麦a~M了M22 分钟前
ansible
linux·运维·ansible
2501_906314321 小时前
MCP-RAG 服务器:完整设置和使用指南
运维·服务器
QQ_4376643142 小时前
Linux下可执行程序的生成和运行详解(编译链接汇编图解)
linux·运维·c语言·汇编·caffe
搬码临时工2 小时前
远程连接电脑的方法?异地远程桌面连接和三方软件实现
运维·服务器·网络·物联网·电脑·远程工作
窦再兴2 小时前
来一个复古的技术FTP
linux·运维·服务器
梦在深巷、2 小时前
nginx配置之负载均衡
运维·nginx·负载均衡
xiaobin889993 小时前
【2025最新版】VMware虚拟机下载安装教程 保姆级图文详解(附安装包+常用镜像Linux,win11,ubuntu,centos)
linux·其他·ubuntu·centos
小黑_深呼吸3 小时前
Prometheus实战教程:k8s平台-Mysql监控案例
运维·学习·kubernetes·prometheus
ALex_zry3 小时前
Ubuntu 20.04 C++开发环境搭建指南(2025版)
linux·c++·ubuntu
疯狂的挖掘机4 小时前
记一次从windows连接远程Linux系统来控制设备采集数据方法
linux·运维·windows