TheFuck

TheFuck

自从用了 “TheFuck” 妈妈再也不担心用命令行报错了!

The Fuck 是一款用于检查上一条出错的指令中的错误,并提供修正选项的软件。它不仅适合新手学习和了解自己的错误,同样也适合一个稳固在一个 Linux 发行版上突然要使用另一个发型版不适应的老鸟。The Fuck 不仅支持 Linux 发行版,还支持 macOS 和 FreeBSD。

https://github.com/nvbn/thefuck#manual-installation

权限不够无法安装二进制软件包的报错咋办?

➜ apt-get install vim
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

➜ fuck
sudo apt-get install vim [enter/↑/↓/ctrl+c]
[sudo] password for nvbn:
Reading package lists... Done
...

明明是自己拼错了却没发现?

➜ puthon
No command 'puthon' found, did you mean:
 Command 'python' from package 'python-minimal' (main)
 Command 'python' from package 'python3' (main)
zsh: command not found: puthon

➜ fuck
python [enter/↑/↓/ctrl+c]
Python 3.4.2 (default, Oct  8 2014, 13:08:17)
...

安装"TheFuck"

CentOS、RHEL

yum -y install epel-release python-pip python-devel
sudo -H pip install thefuck

Ubuntu、Debian

sudo apt install python3-dev python3-pip
sudo pip3 install thefuck

install pip for python3.x

setuptools:

wget --no-check-certificate  https://pypi.python.org/packages/source/s/setuptools/setuptools-19.6.tar.gz#md5=c607dd118eae682c44ed146367a17e26

tar -zxvf setuptools-19.6.tar.gz

cd setuptools-19.6.tar.gz

python3 setup.py build

python3 setup.py install

install pip:

wget --no-check-certificate  https://github.com/pypa/pip/archive/refs/tags/21.3.tar.gz
tar -zxvf 21.3.tar.gz
cd pip-21.3
python3 setup.py build
python3 setup.py install