Linux_Debian学习笔记

news/2024/7/7 19:19:18

文章目录

  • 系统管理
    • 软件源
      • Debian11
        • debian11 ustc中国科技大学软件源
        • debian11 清华大学软件源
        • debian11 阿里云软件源
      • Debian12
        • debian12 清华大学软件源
    • 系统全局设置
      • debian12 修改静态IP地址
      • 修改语言环境成中文
    • 系统输入法
      • Debian11 fcxe 安装rime中州韵五笔输入法
  • 常用软件安装
    • Docker安装

系统管理

软件源

Debian11

debian11 ustc中国科技大学软件源
  1. 生成软件源
    # 备份软件源
    mv /etc/apt/sources.list /etc/apt/sources.list.backup.$(date "+%Y-%m-%d_%H:%M")
    cat > /etc/apt/sources.list << 'EOF'
    deb http://mirrors.ustc.edu.cn/debian stable main contrib non-free
    # deb-src http://mirrors.ustc.edu.cn/debian stable main contrib non-free
    deb http://mirrors.ustc.edu.cn/debian stable-updates main contrib non-free
    # deb-src http://mirrors.ustc.edu.cn/debian stable-updates main contrib non-free
    
    # deb http://mirrors.ustc.edu.cn/debian stable-proposed-updates main contrib non-free
    # deb-src http://mirrors.ustc.edu.cn/debian stable-proposed-updates main contrib non-free
    EOF
    
    
debian11 清华大学软件源
  1. 生成软件源
    # 备份软件源
    mv /etc/apt/sources.list /etc/apt/sources.list.backup.$(date "+%Y-%m-%d_%H:%M")
    cat > /etc/apt/sources.list << 'EOF'
    # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
    
    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
    
    deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
    EOF
    
debian11 阿里云软件源
  1. 生成软件源
    # 备份软件源
    mv /etc/apt/sources.list /etc/apt/sources.list.backup.$(date "+%Y-%m-%d_%H:%M")
    cat > /etc/apt/sources.list << 'EOF'
    deb http://mirrors.aliyun.com/debian/ bullseye main non-free contrib
    deb-src http://mirrors.aliyun.com/debian/ bullseye main non-free contrib
    deb http://mirrors.aliyun.com/debian-security/ bullseye-security main
    deb-src http://mirrors.aliyun.com/debian-security/ bullseye-security main
    deb http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
    deb-src http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
    deb http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
    deb-src http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
    EOF
    

Debian12

debian12 清华大学软件源
  1. 生成软件源
    # 备份软件源
    mv /etc/apt/sources.list /etc/apt/sources.list.backup.$(date "+%Y-%m-%d_%H:%M")
    cat > /etc/apt/sources.list << 'EOF'
    # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
    deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
    # deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
    
    deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
    # deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
    
    deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
    # deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
    
    # deb http://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
    # # deb-src http://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
    
    deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
    # deb-src http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
    EOF
    

系统全局设置

debian12 修改静态IP地址

  1. eth0为dhcp获取ip,eth1为静态ip,使用"systemctl restart networking.service"命令生效
  2. debian12 修改静态IP地址
    # 备份配置文件
    sudo mv /etc/network/interfaces /etc/network/interfaces.backup.$(date "+%Y-%m-%d_%H:%M")
    sudo cat > /etc/network/interfaces << 'EOF'
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    
    source /etc/network/interfaces.d/*
    
    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    allow-hotplug eth0 eth1
    iface eth0 inet dhcp
    iface eth1 inet static
      address 10.10.10.10/24
      broadcast 10.10.10.255
      network 10.10.10.0
    EOF
    

修改语言环境成中文

  1. 修改语言环境成中文
    dpkg-reconfigure locales
    #设置成zh_CN.UTF-8后,重启
    

系统输入法

Debian11 fcxe 安装rime中州韵五笔输入法

  1. 安装rime输入法
    sudo apt -y install fcitx5-rime
    
  2. 下载安装五笔输入方案
    # 下载五笔输入法
    wget https://github.com/rime/rime-wubi/archive/refs/heads/master.zip -O rime-wubi.zip
    # 五笔拼音反查依赖pinyin-simp
    wget https://github.com/rime/rime-pinyin-simp/archive/refs/heads/master.zip -O rime-pinyin-simp.zip
    unzip rime-wubi.zip
    unzip rime-pinyin-simp.zip
    在GUI界面注销,再登录用户
    在输入法中调出中州韵输入法
    cp rime-wubi-master/wubi* ~/.local/share/fcitx5/rime/
    cp rime-pinyin-simp-master/pinyin_simp* ~/.local/share/fcitx5/rime/
    vi ~/.local/share/fcitx5/rime/build/default.yaml
    # 编辑文件,在schema_list:下增加五笔输入法
    - schema: wubi_pinyin
    保存退出,重新启动中州韵输入法,按F4切换输入法
    在五笔拼音输入法下,可直接输入拼音,反查五笔编码
    
    

常用软件安装

Docker安装

  1. Docker官方文档
  2. 使用apt仓库安装,国内网络可能非常慢
    # Add Docker's official GPG key:
    sudo apt-get update
    sudo apt-get install ca-certificates curl
    sudo install -m 0755 -d /etc/apt/keyrings
    sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
    sudo chmod a+r /etc/apt/keyrings/docker.asc
    
    # Add the repository to Apt sources:
    echo \
      "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
      $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
      sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    sudo apt-get update
    sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    
  3. 使用离线包安装
    1. 打开网页
    2. 选择Debian的版本
    3. 进入pool/stable/,选择平台
    4. 下载以下deb文件
      containerd.io_<version>_<arch>.deb
      docker-ce_<version>_<arch>.deb
      docker-ce-cli_<version>_<arch>.deb
      docker-buildx-plugin_<version>_<arch>.deb
      docker-compose-plugin_<version>_<arch>.deb
      
    5. 以Debian12(bookworm)为例,下载链接
      1. containerd.io_1.6.28-2
      2. docker-ce_26.0.0-1
      3. docker-ce-cli_26.0.0-1
      4. docker-buildx-plugin_0.13.1-1
      5. docker-compose-plugin_2.25.0-1
    6. 安装离线包
      # 如果没有iptables,需要先安装iptables:apt install -y iptables
      sudo dpkg -i ./containerd.io_1.6.28-2_amd64.deb \
        ./docker-ce_26.0.0-1~debian.12~bookworm_amd64.deb \
        ./docker-ce-cli_26.0.0-1~debian.12~bookworm_amd64.deb \
        ./docker-buildx-plugin_0.13.1-1~debian.12~bookworm_amd64.deb \
        ./docker-compose-plugin_2.25.0-1~debian.12~bookworm_amd64.deb
      
    7. 验证是否安装成功
    docker ps
    

http://lihuaxi.xjx100.cn/news/2157307.html

相关文章

【Unity添加远程桌面】使用Unity账号远程控制N台电脑

设置地址&#xff1a; URDP终极远程桌面&#xff1b;功能强大&#xff0c;足以让开发人员、设计师、建筑师、工程师等等随时随地完成工作或协助别人https://cloud-desktop.u3dcloud.cn/在网站登录自己的Unity 账号上去 下载安装被控端安装 保持登录 3.代码添加当前主机 "…

AI技术创业机会之智慧城市与智慧交通

人工智能(AI)技术的创新与发展为智慧城市与智慧交通领域带来了革命性的变革,为创业者创造了大量创新与创业机会。以下详述了智慧城市与智慧交通背景下AI技术的创业机会及其具体细节与内容,以5000字篇幅深入剖析各细分领域,为有志于投身这一领域的创业者提供全面、深入的商…

深入理解JVM垃圾收集器

相关系列 深入理解JVM垃圾收集算法-CSDN博客 目前市面常见的垃圾收集器有Serial、ParNew、Parallel、CMS、Serial Old、Parallel Old、G1、ZGC以及有二种不常见的Epsilon、Shenandoah的&#xff0c;从上图可以看到有连线的的垃圾收集器是可以组合使用&#xff0c;是年轻代老年代…

AGI(通用人工智能Artificial General Intelligence)知识点

通用人工智能AGI知识点 AGI1. prompt提示工程是什么&#xff1f;2. 怎么构建prompt&#xff1f;2. Prompt怎么防注入&#xff1f;3. Function Calling是什么&#xff1f;10. Agent是什么如果处理添加多个Agent&#xff1f;4. RAG是什么&#xff1f;构建 RAG 模型的步骤&#xf…

通俗易懂地解释Go语言不同版本中垃圾回收机制的演进过程

完整课程请点击以下链接 Go 语言项目开发实战_Go_实战_项目开发_孔令飞_Commit 规范_最佳实践_企业应用代码-极客时间 Go 1.3时代 - 标记清除算法 这就像一个人要打扫房间,首先需要暂停其他活动。然后开始查看房间里的每件物品,对于自己仍需要使用的物品做上记号。查看完毕后…

创建型模式--2.简单工厂模式【人造恶魔果实工厂1】

1. 工厂模式的特点 在海贼王中&#xff0c;作为原王下七武海之一的多弗朗明哥&#xff0c;可以说是新世界最大的流氓头子&#xff0c;拥有无上的权利和无尽的财富。他既是德雷斯罗萨国王又是地下世界的中介&#xff0c;控制着世界各地的诸多产业&#xff0c;人造恶魔果实工厂就…

Vue - 你知道Vue2中对象动态新增属性,视图无法更新的原因吗

难度级别:中高级及以上 提问概率:55% 这道题面试官会这样描述,比如有这样一个场景,一个对象里有name属性,可以正常显示在页面中。但后续动态添加了一个age属性,通过调试打印发现对象里的age属性已经添加了上了,但试图中却没有展示出来,…

lua学习笔记15(元表的学习)

print("*****************************元表的学习*******************************") print("*****************************元表的概念*******************************") --任何变量都可以作为另一个表变量的元表 --任何表变量都可以有自己的元表 --当我…