ubuntu18.04换源,装pwntools问题
title: ubuntu18.04换源,装pwntools问题
tags:
- ubuntu
首先当然要安装好vmware tools
换源
备份源
1 | sudo cp /etc/apt/sources.list /etc/apt/sources_init.list |
更换源
用gedit文本编辑器就相当方便,不知道为什么一堆人用vim1
sudo gedit /etc/apt/sources.list
删除文件中的所有内容,替换成1
2
3
4
5
6
7
8
9
10
11# 阿里源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse1
2sudo apt update
sudo apt upgrade
安装pwntools(可参考)
pwntools需要python3的环境了1
2
3
4apt-get update
apt-get install python3 python3-pip python3-dev git libssl-dev libffi-dev build-essential
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade git+https://github.com/Gallopsled/pwntools.git@dev3
未解决问题(已解决)
pip3 ImportError: cannot import name ‘main’
解决方法1
2
3
4
5
6
7
8
9sudo gedit /usr/bin/pip
将:
from pip import main
if __name__ == '__main__':
sys.exit(main())
替换成:
from pip import __main__
if __name__ == '__main__':
sys.exit(__main__._main())
最后输入1
2
3
4pip install pwntools --user
#因为可能出现ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/filelock.py'
Consider using the `--user` option or check the permissions.