首页 > 其他分享 >服务器设置

服务器设置

时间:2024-10-22 15:58:28浏览次数:1  
标签:upgrade get list apt sources 设置 软件包 服务器

服务器设置

Debian 11 替换源

  • 备份现有的 apt 源配置
cp /etc/apt/sources.list /etc/apt/sources.list_backup
  • 替换为中科大源
cat > /etc/apt/sources.list << EOF
deb https://mirrors.ustc.edu.cn/debian/ bullseye main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian/ bullseye main contrib non-free

deb https://mirrors.ustc.edu.cn/debian/ bullseye-updates main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian/ bullseye-updates main contrib non-free

deb https://mirrors.ustc.edu.cn/debian/ bullseye-backports main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian/ bullseye-backports main contrib non-free

deb https://mirrors.ustc.edu.cn/debian-security/ bullseye-security main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian-security/ bullseye-security main contrib non-free
EOF
  • 替换为默认官方源
cat > /etc/apt/sources.list << EOF
deb https://deb.debian.org/debian/ bullseye main contrib non-free
deb-src https://deb.debian.org/debian/ bullseye main contrib non-free

deb https://deb.debian.org/debian/ bullseye-updates main contrib non-free
deb-src https://deb.debian.org/debian/ bullseye-updates main contrib non-free

deb https://deb.debian.org/debian/ bullseye-backports main contrib non-free
deb-src https://deb.debian.org/debian/ bullseye-backports main contrib non-free

deb https://deb.debian.org/debian-security/ bullseye-security main contrib non-free
deb-src https://deb.debian.org/debian-security/ bullseye-security main contrib non-free
EOF
  • 替换为清华源
cat > /etc/apt/sources.list << EOF
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
  • 替换为阿里云源
cat > /etc/apt/sources.list << EOF
deb https://mirrors.aliyun.com/debian/ bullseye main contrib non-free
deb-src https://mirrors.aliyun.com/debian/ bullseye main contrib non-free

deb https://mirrors.aliyun.com/debian/ bullseye-updates main contrib non-free
deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main contrib non-free

deb https://mirrors.aliyun.com/debian/ bullseye-backports main contrib non-free
deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main contrib non-free

deb https://mirrors.aliyun.com/debian-security/ bullseye-security main contrib non-free
deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main contrib non-free
EOF
  • 更新 apt 索引
apt-get update

Debian 包管理系统

dpkg、apt-get、apt

  • dpkg 负责实际的安装工作。
  • apt-get 提供了完整的 dpkg 接口,功能强大但略显繁琐。输出格式稳定,更适合用于编写脚本,实现自动化管理。
  • apt 是更友好、更易用的 apt-get 版本,功能略有精简。不仅包含了 apt-get 的所有功能,还新增了 listsearch 等实用命令,功能更加全面。更适合日常使用。

常用命令:

apt 命令 apt-get 命令 命令的功能
apt install apt-get install 安装软件包
apt remove apt-get remove 移除软件包
apt purge apt-get purge 移除软件包及配置文件
apt update apt-get update 刷新存储库索引
apt upgrade apt-get upgrade 升级所有可升级的软件包
apt autoremove apt-get autoremove 自动删除不需要的包
apt full-upgrade apt-get dist-upgrade 在升级软件包时自动处理依赖关系
apt search apt-cache search 搜索应用程序
apt show apt-cache show 显示包的详细信息
apt 命令 命令的功能
apt list 列出包含条件的包(已安装、可升级等)
apt edit-sources 编辑源列表

apt-get update 和 upgrade 区别

apt-get update

  • apt-get update 命令用于更新软件包列表,即更新本地软件包索引数据库。当我们在系统中安装新软件或者更新现有软件之前,需要先更新软件包列表,以确保获取最新的软件包信息。
  • 更新软件包列表时,apt-get 会访问软件源(repository)中的信息,并将本地的软件包索引与之同步。软件源是存储软件包的服务器,通常由 Linux 发行版的官方维护或者第三方提供。
  • 更新软件包列表不会安装或者升级任何软件包,它只是将本地的软件包信息与软件源保持同步,使得后续的软件包操作可以基于最新的信息进行。

apt-get upgrade

  • apt-get upgrade 命令用于升级已经安装的软件包到最新版本。在执行 apt-get upgrade 之前,通常需要先执行 apt-get update 命令,以确保软件包列表是最新的。
  • apt-get upgrade 会遍历已安装的软件包,查找是否有可用的更新版本。如果有更新版本的软件包,apt-get 会将其下载并安装,实现软件的升级。
  • 升级软件包时,apt-get 会在不影响系统稳定性的前提下尽量保持向后兼容,以确保系统的稳定运行

标签:upgrade,get,list,apt,sources,设置,软件包,服务器
From: https://www.cnblogs.com/sprinining/p/18493135

相关文章

  • chrony服务器
    1.安装yuminstallchrony-y2.配置文件主配置文件:/etc/chrony.conf   serverntp.aliyun.comiburst       ---指定阿里云ntp服务器allow192.168.159.0/24          ---允许的网段localstratum1(取值范围:1-16,同步层数由大到小,16代表未做时......
  • java程序设置开机自启
    Linux系统jar包开机自启第一步:创建service文件sudonanoetc/systemd/system/myapp.service第二步:将下面代码复制到刚才创建的文件里面,保存[Unit]Description=JavacameraserviceAfter=network.target[Service]WorkingDirectory=/home/app/javaEnvironment="LD_LIBR......
  • 金融交易系统延迟,NTP时间同步服务器为其保驾护航
    金融交易系统延迟,NTP时间同步服务器为其保驾护航金融交易系统延迟,NTP时间同步服务器为其保驾护航京准电子科技官微——ahjzsz“2024年9月27日,上海证券交易所(上交所)的交易系统出现了延迟现象,导致投资者在关键时刻无法及时进行操作。这一现象不仅影响了多家交易平台,还引发了投资......
  • 工作站和塔式服务器有什么区别
    工作站和塔式服务器的区别:1、架构和用途;2、处理能力和扩展性;3、操作系统和软件支持;4、外观和尺寸。其中,工作站通常是为专业的计算和设计任务而设计的高性能计算机。而塔式服务器则主要用于托管和管理网络服务、存储数据和处理大量的网络请求等服务器任务。1、架构和用途工作......
  • mysql innodb_data_file_path参数忘记设置或者重新调整办法
    目录mysqlinnodb_data_file_path参数忘记设置或者重新调整办法mysqlinnodb_data_file_path参数忘记设置或者重新调整办法my.cnf文件中,默认配置为innodb_data_file_path=ibdata1:10M:autoextend目前该文件已经扩大到了1g多:-rw-r-----1mysqlmysql14701035524月161......
  • NFS服务器
    0.安装和重启服务yum-yinstallnfs-utils,nfs重启服务systemctlrestartnfs-serviceshowmount-eIP地址   //当安装完成后可以见检查服务是否正常运行,没有共享文件夹时则返回空行1.配置文件夹得格式/etc/exports         ----nfs配置文件夹共享......
  • 京准电钟:NTP时间同步服务器助力精准计算机数据网络
    京准电钟:NTP时间同步服务器助力精准计算机数据网络京准电钟:NTP时间同步服务器助力精准计算机数据网络京准电子科技官微——ahjzsz摘要:首先对计算机网络时间同步相关技术进行了介绍,然后阐述了时间同步技术在现代计算机网络中的应用与发展,最后指出时间同步网络在下一代网络(......
  • 在K8S中,有一家拼车公司希望通过同时扩展其平台来增加服务器数量,公司如何有效地实现这
    在Kubernetes(K8S)中,对于一家拼车公司希望通过同时扩展其平台来增加服务器数量以实现有效的资源分配,可以按照以下步骤进行:1.准备阶段评估需求:拼车公司需要明确其业务增长预期、用户访问量、峰值负载等关键指标,以确定所需的服务器数量和资源配置。规划架构:设计一个可扩展......
  • 在K8S中,公司该如何处理服务器及其安装?
    在Kubernetes(K8S)环境中,公司处理服务器及其安装的过程需要细致规划和执行。以下是一个详细的步骤指南,帮助公司有效地处理服务器及其安装:1.服务器准备硬件选择与配置根据业务需求选择合适的服务器硬件,包括CPU、内存、存储等。确保服务器满足Kubernetes的最低硬件要求,例如64位......
  • 服务器开启FTP
    服务器开启FTP服务器开启FTP操作系统:Windows服务器镜像:WindowsServer2022数据中心版(简体中文)64位一、新建用户以及文件夹步骤1:新建用户打开计算机管理。打开”系统工具“中的”本地用户和组“,右键选择”新建组“。右键选择”新用户“,设置用户名和密码,并选择”......