Debian/Ubuntu配置aliyun源和安装工具

Debian 10 的 apt-get 源更换为 aliyun,以提升国内环境 apt install 的速度。

1)备份原 apt-get 源文件

复制代码
root@e3c22f627b9e:~# cd /etc/apt
root@e3c22f627b9e:/etc/apt# cp sources.list sources.list.bak

2)清除原 apt 源文件内容

复制代码
root@e3c22f627b9e:/etc/apt# > sources.list

3)添加 aliyun apt-get 源

复制代码
root@e3c22f627b9e:~# cd /etc/apt
root@e3c22f627b9e:/etc/apt# echo "deb http://mirrors.aliyun.com/debian  stable main contrib non-free" >> sources.list
root@e3c22f627b9e:/etc/apt# echo "deb http://mirrors.aliyun.com/debian  stable-updates main contrib non-free" >> sources.list

4)更新 apt

执行如下命令更新 apt 源

复制代码
root@e3c22f627b9e:/etc/apt# apt update

参考阿里云镜像

复制代码
https://developer.aliyun.com/mirror/debian

阿里云 debian 镜像支持版本

复制代码
http://mirrors.aliyun.com/debian/dists/

5)ps 命令所在的安装包名字为procps

可在Debian/Centos 中使用命令apt-file search /bin/ps | grep -w "/bin/ps" 搜索命令对应安装包的名字

安装

复制代码
apt-get update
apt-get  install  procps

6)Debian/Ubuntu安装ping命令

复制代码
apt-get update 
apt-get install inetutils-ping

7)Centos安装ping 命令

复制代码
yum install iputils

8)Debian/Ubuntu安装telnet命令

复制代码
apt-get update 
apt-get install telnet

9)Debian/Ubuntu、CentOS安装netstat命令

复制代码
# Debian
apt-get install net-tools
# Ubuntu
apt-get install net-tools
# Alpine
apk add net-tools
# Arch Linux
pacman -S net-tools
# Kali Linux
apt-get install net-tools
# CentOS
yum install net-tools
# Fedora
dnf install net-tools
# Raspbian
apt-get install net-tools
相关推荐
徐小黑ACG1 小时前
nginx配置文件
linux·服务器·nginx
新时代牛马2 小时前
Linux VFS 完整篇:从path_openat、dentry/inode 到page cache 与挂载排障
linux·运维·服务器
java_logo2 小时前
Docker 部署 Rocky Linux:轻松搭建 RHEL 兼容企业级基础镜像平台
linux·docker·容器·rocky linux·基础镜像·轩辕镜像·rhel 兼容
拂拉氏2 小时前
【知识讲解】 Linux虚拟地址空间认识
linux·虚拟地址空间
新时代牛马4 小时前
Linux 驱动中断与定时完整篇:从 request_threaded_irq 到hrtimer 选型与排障
linux·运维·服务器
分支预测失败6 小时前
RISC-V 核间中断 IPI 实战:从 MSIP 寄存器到 IMSIC 消息投递
linux·后端
GeW7 小时前
RHCE考试避坑指南"90%考生容易忽略的细节
linux
键盘会跳舞8 小时前
【C++多线程】死锁诊断工具实战:从 Windows 到 Linux 的全链路排查
linux·c++·windows·死锁
拂拉氏9 小时前
【知识讲解】 Linux环境变量的认识与使用
linux·环境变量
zhangrelay9 小时前
答疑-是否软件源问题都必须更换为国内呢-
linux·笔记·学习·ubuntu·ros2