更改 root 密码及初始化 root 密码:> sudo passwd
先编辑 /etc/apt/sources.list
> sudo gedit /etc/apt/sources.list
将内容全删,替换为以下全部内容
此处为 22.04 版本,更多:https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/
···
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
···
替换完后
> sudo apt-get update
建议这里重启一下虚拟机
> sudo apt update
> sudo apt install python3 python3-pip python3-dev git libssl-dev libffi-dev build-essential -y
> python3 -m pip install --upgrade pip
> pip3 install --upgrade pwntools
到这里就 OK 了,checksec 也顺带装了
方法一:
用这个命令查看一下apt-get的相关进程:
ps -e | grep apt
显示:
11669 ? 00:00:02 aptd
25379 ? 00:00:00 update-apt-xapi
然后就执行
sudo kill 25379
sudo apt-get update