nvbn / thefuck

Magnificent app which corrects your previous console command.
MIT License
85.27k stars 3.44k forks source link

Installing Redis instead of RabbitMQ after using fuck #962

Open Ignisor opened 5 years ago

Ignisor commented 5 years ago

The output of thefuck --version (something like The Fuck 3.1 using Python 3.5.0 and Bash 4.4.12(1)-release): The Fuck 3.29 using Python 3.6.8 and Bash 4.4.20(1)-release

Your system (Debian 7, ArchLinux, Windows, etc.): Linux Mint 19.2 Tina

How to reproduce the bug: So I was trying to install RabbitMQ, and I were too lazy to check the proper package name. So I decided to use the power of :zap: The Fuck :zap:

And it's pretty funny but it tried to install redis instead.

$ sudo apt install rabbitmq
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package rabbitmq

$ fuck
sudo apt install redis
Reading package lists... Done
Building dependency tree       
Reading state information... Done
redis is already the newest version (5:4.0.9-1ubuntu0.2).
0 upgraded, 0 newly installed, 0 to remove and 102 not upgraded.

What I expect is: $ sudo apt install rabbitmq-server

The output of The Fuck with THEFUCK_DEBUG=true exported (typically execute export THEFUCK_DEBUG=true in your shell before The Fuck):

$ export THEFUCK_DEBUG=true

$ sudo apt install rabbitmq
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package rabbitmq

$ fuck
DEBUG: Run with settings: {'alter_history': True,
 'debug': True,
 'env': {'GIT_TRACE': '1', 'LANG': 'C', 'LC_ALL': 'C'},
 'exclude_rules': [],
 'history_limit': None,
 'instant_mode': False,
 'no_colors': False,
 'num_close_matches': 3,
 'priority': {},
 'repeat': False,
 'require_confirmation': False,
 'rules': [<const: All rules enabled>],
 'slow_commands': ['lein', 'react-native', 'gradle', './gradlew', 'vagrant'],
 'user_dir': PosixPath('/home/ignisor/.config/thefuck'),
 'wait_command': 3,
 'wait_slow_command': 15}
DEBUG: Received output: 
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package rabbitmq

DEBUG: Call: sudo apt install rabbitmq; with env: {'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:', 'LC_MEASUREMENT': 'uk_UA.UTF-8', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'LC_PAPER': 'uk_UA.UTF-8', 'LC_MONETARY': 'uk_UA.UTF-8', 'LANG': 'C', 'GDM_LANG': 'en_US', 'DISPLAY': ':0', 'GTK_OVERLAY_SCROLLING': '1', 'COLORTERM': 'truecolor', 'TF_SHELL_ALIASES': 'alias aa=\'source .env/bin/activate\'\nalias alert=\'notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e \'\\\'\'s/^\\s*[0-9]\\+\\s*//;s/[;&|]\\s*alert$//\'\\\'\')"\'\nalias apt-get=\'apt\'\nalias charm=\'pycharm-professional\'\nalias egrep=\'egrep --color=auto\'\nalias fgrep=\'fgrep --color=auto\'\nalias fuck=\'fuck -y\'\nalias grep=\'grep --color=auto\'\nalias l=\'ls -CF\'\nalias la=\'ls -A\'\nalias ll=\'ls -alF\'\nalias ls=\'ls --color=auto\'\nalias p3=\'python3.7\'\nalias penv=\'p3 -m venv .env && aa && pip install -r requirements.txt\'', 'DESKTOP_AUTOSTART_ID': '10180f21e4dc496c02157008586240940000000025230008', 'XDG_VTNR': '7', 'PYTHONIOENCODING': 'utf-8', 'SSH_AUTH_SOCK': '/run/user/1000/keyring/ssh', 'MANDATORY_PATH': '/usr/share/gconf/cinnamon.mandatory.path', 'LC_NAME': 'uk_UA.UTF-8', 'XDG_SESSION_ID': 'c2', 'XDG_GREETER_DATA_DIR': '/var/lib/lightdm-data/ignisor', 'USER': 'ignisor', 'DESKTOP_SESSION': 'cinnamon', 'TF_SHELL': 'bash', 'DEFAULTS_PATH': '/usr/share/gconf/cinnamon.default.path', 'QT_QPA_PLATFORMTHEME': 'qt5ct', 'PWD': '/home/ignisor/dev/trains-the-new-beggining/opencv-text-detection', 'HOME': '/home/ignisor', 'GUAKE_TAB_UUID': '681c4b9c-5884-4ead-bf4e-5ac970dfa5cf', 'SSH_AGENT_PID': '2590', 'QT_ACCESSIBILITY': '1', 'XDG_SESSION_TYPE': 'x11', 'XDG_DATA_DIRS': '/usr/share/cinnamon:/usr/share/gnome:/home/ignisor/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop', 'XDG_SESSION_DESKTOP': 'cinnamon', 'LC_ADDRESS': 'uk_UA.UTF-8', 'LC_NUMERIC': 'uk_UA.UTF-8', 'GTK_MODULES': 'gail:atk-bridge', 'TERM': 'xterm-256color', 'SHELL': '/bin/bash', 'VTE_VERSION': '5202', 'XDG_SEAT_PATH': '/org/freedesktop/DisplayManager/Seat0', 'XDG_CURRENT_DESKTOP': 'X-Cinnamon', 'GPG_AGENT_INFO': '/run/user/1000/gnupg/S.gpg-agent:0:1', 'TF_ALIAS': 'fuck', 'XDG_SEAT': 'seat0', 'SHLVL': '1', 'LANGUAGE': 'en_US', 'LC_TELEPHONE': 'uk_UA.UTF-8', 'GDMSESSION': 'cinnamon', 'GNOME_DESKTOP_SESSION_ID': 'this-is-deprecated', 'LOGNAME': 'ignisor', 'DBUS_SESSION_BUS_ADDRESS': 'unix:path=/run/user/1000/bus', 'XDG_RUNTIME_DIR': '/run/user/1000', 'XAUTHORITY': '/home/ignisor/.Xauthority', 'TF_HISTORY': '\t sudo apt install rabbitmq-server\n\t thefuck --version\n\t uname\n\t uname -a\n\t lsb-release\n\t lsb_release\n\t lsb_release -c\n\t lsb_release -a\n\t export THEFUCK_DEBUG=true\n\t sudo apt install rabbitmq', 'XDG_SESSION_PATH': '/org/freedesktop/DisplayManager/Session0', 'XDG_CONFIG_DIRS': '/etc/xdg/xdg-cinnamon:/etc/xdg', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin', 'LC_IDENTIFICATION': 'uk_UA.UTF-8', 'THEFUCK_DEBUG': 'true', 'SESSION_MANAGER': 'local/ignisor-WombatPC:@/tmp/.ICE-unix/2523,unix/ignisor-WombatPC:/tmp/.ICE-unix/2523', 'LESSOPEN': '| /usr/bin/lesspipe %s', '_': '/usr/local/bin/thefuck', 'LC_ALL': 'C', 'GIT_TRACE': '1'}; is slow:  took: 0:00:00.494457
DEBUG: Importing rule: adb_unknown_command; took: 0:00:00.000212
DEBUG: Importing rule: ag_literal; took: 0:00:00.000351
DEBUG: Importing rule: apt_get; took: 0:00:00.008818
DEBUG: Importing rule: apt_get_search; took: 0:00:00.000642
DEBUG: Importing rule: apt_invalid_operation; took: 0:00:00.000897
DEBUG: Importing rule: apt_list_upgradable; took: 0:00:00.000382
DEBUG: Importing rule: apt_upgrade; took: 0:00:00.000354
DEBUG: Importing rule: aws_cli; took: 0:00:00.000544
DEBUG: Importing rule: az_cli; took: 0:00:00.000238
DEBUG: Importing rule: brew_cask_dependency; took: 0:00:00.000457
DEBUG: Importing rule: brew_install; took: 0:00:00.000094
DEBUG: Importing rule: brew_link; took: 0:00:00.000216
DEBUG: Importing rule: brew_reinstall; took: 0:00:00.000456
DEBUG: Importing rule: brew_uninstall; took: 0:00:00.000220
DEBUG: Importing rule: brew_unknown_command; took: 0:00:00.000108
DEBUG: Importing rule: brew_update_formula; took: 0:00:00.000225
DEBUG: Importing rule: brew_upgrade; took: 0:00:00.000077
DEBUG: Importing rule: cargo; took: 0:00:00.000068
DEBUG: Importing rule: cargo_no_command; took: 0:00:00.000216
DEBUG: Importing rule: cat_dir; took: 0:00:00.000224
DEBUG: Importing rule: cd_correction; took: 0:00:00.000894
DEBUG: Importing rule: cd_mkdir; took: 0:00:00.000320
DEBUG: Importing rule: cd_parent; took: 0:00:00.000078
DEBUG: Importing rule: chmod_x; took: 0:00:00.000075
DEBUG: Importing rule: composer_not_command; took: 0:00:00.000247
DEBUG: Importing rule: cp_omitting_directory; took: 0:00:00.000394
DEBUG: Importing rule: cpp11; took: 0:00:00.000210
DEBUG: Importing rule: dirty_untar; took: 0:00:00.001007
DEBUG: Importing rule: dirty_unzip; took: 0:00:00.000965
DEBUG: Importing rule: django_south_ghost; took: 0:00:00.000097
DEBUG: Importing rule: django_south_merge; took: 0:00:00.000073
DEBUG: Importing rule: dnf_no_such_command; took: 0:00:00.001053
DEBUG: Importing rule: docker_login; took: 0:00:00.000232
DEBUG: Importing rule: docker_not_command; took: 0:00:00.000432
DEBUG: Importing rule: dry; took: 0:00:00.000082
DEBUG: Importing rule: fab_command_not_found; took: 0:00:00.000293
DEBUG: Importing rule: fix_alt_space; took: 0:00:00.000242
DEBUG: Importing rule: fix_file; took: 0:00:00.002078
DEBUG: Importing rule: gem_unknown_command; took: 0:00:00.000383
DEBUG: Importing rule: git_add; took: 0:00:00.000596
DEBUG: Importing rule: git_add_force; took: 0:00:00.000397
DEBUG: Importing rule: git_bisect_usage; took: 0:00:00.000361
DEBUG: Importing rule: git_branch_delete; took: 0:00:00.000301
DEBUG: Importing rule: git_branch_exists; took: 0:00:00.000336
DEBUG: Importing rule: git_branch_list; took: 0:00:00.000536
DEBUG: Importing rule: git_checkout; took: 0:00:00.000373
DEBUG: Importing rule: git_commit_amend; took: 0:00:00.000355
DEBUG: Importing rule: git_commit_reset; took: 0:00:00.000230
DEBUG: Importing rule: git_diff_no_index; took: 0:00:00.000225
DEBUG: Importing rule: git_diff_staged; took: 0:00:00.000215
DEBUG: Importing rule: git_fix_stash; took: 0:00:00.000279
DEBUG: Importing rule: git_flag_after_filename; took: 0:00:00.000224
DEBUG: Importing rule: git_help_aliased; took: 0:00:00.000218
DEBUG: Importing rule: git_merge; took: 0:00:00.000226
DEBUG: Importing rule: git_merge_unrelated; took: 0:00:00.000223
DEBUG: Importing rule: git_not_command; took: 0:00:00.000219
DEBUG: Importing rule: git_pull; took: 0:00:00.000249
DEBUG: Importing rule: git_pull_clone; took: 0:00:00.000221
DEBUG: Importing rule: git_pull_uncommitted_changes; took: 0:00:00.000216
DEBUG: Importing rule: git_push; took: 0:00:00.000216
DEBUG: Importing rule: git_push_different_branch_names; took: 0:00:00.000215
DEBUG: Importing rule: git_push_force; took: 0:00:00.000218
DEBUG: Importing rule: git_push_pull; took: 0:00:00.000217
DEBUG: Importing rule: git_push_without_commits; took: 0:00:00.000271
DEBUG: Importing rule: git_rebase_merge_dir; took: 0:00:00.000228
DEBUG: Importing rule: git_rebase_no_changes; took: 0:00:00.000174
DEBUG: Importing rule: git_remote_delete; took: 0:00:00.000233
DEBUG: Importing rule: git_remote_seturl_add; took: 0:00:00.000154
DEBUG: Importing rule: git_rm_local_modifications; took: 0:00:00.000207
DEBUG: Importing rule: git_rm_recursive; took: 0:00:00.000257
DEBUG: Importing rule: git_rm_staged; took: 0:00:00.000205
DEBUG: Importing rule: git_stash; took: 0:00:00.000205
DEBUG: Importing rule: git_stash_pop; took: 0:00:00.000198
DEBUG: Importing rule: git_tag_force; took: 0:00:00.000310
DEBUG: Importing rule: git_two_dashes; took: 0:00:00.000213
DEBUG: Importing rule: go_run; took: 0:00:00.000245
DEBUG: Importing rule: gradle_no_task; took: 0:00:00.000428
DEBUG: Importing rule: gradle_wrapper; took: 0:00:00.000225
DEBUG: Importing rule: grep_arguments_order; took: 0:00:00.000218
DEBUG: Importing rule: grep_recursive; took: 0:00:00.000209
DEBUG: Importing rule: grunt_task_not_found; took: 0:00:00.000375
DEBUG: Importing rule: gulp_not_task; took: 0:00:00.000233
DEBUG: Importing rule: has_exists_script; took: 0:00:00.000216
DEBUG: Importing rule: heroku_multiple_apps; took: 0:00:00.000247
DEBUG: Importing rule: heroku_not_command; took: 0:00:00.000217
DEBUG: Importing rule: history; took: 0:00:00.000082
DEBUG: Importing rule: hostscli; took: 0:00:00.000387
DEBUG: Importing rule: ifconfig_device_not_found; took: 0:00:00.000269
DEBUG: Importing rule: java; took: 0:00:00.000210
DEBUG: Importing rule: javac; took: 0:00:00.000209
DEBUG: Importing rule: lein_not_task; took: 0:00:00.000322
DEBUG: Importing rule: ln_no_hard_link; took: 0:00:00.000203
DEBUG: Importing rule: ln_s_order; took: 0:00:00.000205
DEBUG: Importing rule: long_form_help; took: 0:00:00.000081
DEBUG: Importing rule: ls_all; took: 0:00:00.000216
DEBUG: Importing rule: ls_lah; took: 0:00:00.000205
DEBUG: Importing rule: man; took: 0:00:00.000214
DEBUG: Importing rule: man_no_space; took: 0:00:00.000074
DEBUG: Importing rule: mercurial; took: 0:00:00.000215
DEBUG: Importing rule: missing_space_before_subcommand; took: 0:00:00.000087
DEBUG: Importing rule: mkdir_p; took: 0:00:00.000210
DEBUG: Importing rule: mvn_no_command; took: 0:00:00.000212
DEBUG: Importing rule: mvn_unknown_lifecycle_phase; took: 0:00:00.000220
DEBUG: Importing rule: no_command; took: 0:00:00.000213
DEBUG: Importing rule: no_such_file; took: 0:00:00.000089
DEBUG: Importing rule: npm_missing_script; took: 0:00:00.000459
DEBUG: Importing rule: npm_run_script; took: 0:00:00.000278
DEBUG: Importing rule: npm_wrong_command; took: 0:00:00.000327
DEBUG: Importing rule: open; took: 0:00:00.000265
DEBUG: Importing rule: pacman; took: 0:00:00.000316
DEBUG: Importing rule: pacman_not_found; took: 0:00:00.000085
DEBUG: Importing rule: path_from_history; took: 0:00:00.000094
DEBUG: Importing rule: php_s; took: 0:00:00.000242
DEBUG: Importing rule: pip_install; took: 0:00:00.000276
DEBUG: Importing rule: pip_unknown_command; took: 0:00:00.000270
DEBUG: Importing rule: port_already_in_use; took: 0:00:00.000152
DEBUG: Importing rule: prove_recursively; took: 0:00:00.000227
DEBUG: Importing rule: pyenv_no_such_command; took: 0:00:00.000448
DEBUG: Importing rule: python_command; took: 0:00:00.000233
DEBUG: Importing rule: python_execute; took: 0:00:00.000208
DEBUG: Importing rule: quotation_marks; took: 0:00:00.000074
DEBUG: Importing rule: react_native_command_unrecognized; took: 0:00:00.000272
DEBUG: Importing rule: remove_trailing_cedilla; took: 0:00:00.000079
DEBUG: Importing rule: rm_dir; took: 0:00:00.000223
DEBUG: Importing rule: rm_root; took: 0:00:00.000271
DEBUG: Importing rule: scm_correction; took: 0:00:00.000229
DEBUG: Importing rule: sed_unterminated_s; took: 0:00:00.000217
DEBUG: Importing rule: sl_ls; took: 0:00:00.000077
DEBUG: Importing rule: ssh_known_hosts; took: 0:00:00.000226
DEBUG: Importing rule: sudo; took: 0:00:00.000081
DEBUG: Importing rule: sudo_command_from_user_path; took: 0:00:00.000215
DEBUG: Importing rule: switch_lang; took: 0:00:00.000110
DEBUG: Importing rule: systemctl; took: 0:00:00.000332
DEBUG: Importing rule: test.py; took: 0:00:00.000076
DEBUG: Importing rule: tmux; took: 0:00:00.000213
DEBUG: Importing rule: touch; took: 0:00:00.000236
DEBUG: Importing rule: tsuru_login; took: 0:00:00.000255
DEBUG: Importing rule: tsuru_not_command; took: 0:00:00.000277
DEBUG: Importing rule: unknown_command; took: 0:00:00.000098
DEBUG: Importing rule: unsudo; took: 0:00:00.000071
DEBUG: Importing rule: vagrant_up; took: 0:00:00.000327
DEBUG: Importing rule: whois; took: 0:00:00.000344
DEBUG: Importing rule: workon_doesnt_exists; took: 0:00:00.000292
DEBUG: Importing rule: yarn_alias; took: 0:00:00.000228
DEBUG: Importing rule: yarn_command_not_found; took: 0:00:00.000563
DEBUG: Importing rule: yarn_command_replaced; took: 0:00:00.000326
DEBUG: Importing rule: yarn_help; took: 0:00:00.000238
DEBUG: Trying rule: path_from_history; took: 0:00:00.000345
DEBUG: Trying rule: dry; took: 0:00:00.000063
DEBUG: Trying rule: git_stash_pop; took: 0:00:00.000018
DEBUG: Trying rule: test.py; took: 0:00:00.000002
DEBUG: Trying rule: adb_unknown_command; took: 0:00:00.000009
DEBUG: Trying rule: ag_literal; took: 0:00:00.000009
DEBUG: Trying rule: apt_get; took: 0:00:00.000002
DEBUG: Trying rule: apt_get_search; took: 0:00:00.000007
DEBUG: Trying rule: apt_invalid_operation; took: 0:00:00.000042
DEBUG: Trying rule: apt_list_upgradable; took: 0:00:00.000035
DEBUG: Trying rule: apt_upgrade; took: 0:00:00.000010
DEBUG: Trying rule: aws_cli; took: 0:00:00.000008
DEBUG: Trying rule: az_cli; took: 0:00:00.000007
DEBUG: Trying rule: brew_link; took: 0:00:00.000017
DEBUG: Trying rule: brew_reinstall; took: 0:00:00.000007
DEBUG: Trying rule: brew_uninstall; took: 0:00:00.000005
DEBUG: Trying rule: brew_update_formula; took: 0:00:00.000006
DEBUG: Trying rule: cargo; took: 0:00:00.000001
DEBUG: Trying rule: cargo_no_command; took: 0:00:00.000007
DEBUG: Trying rule: cat_dir; took: 0:00:00.000008
DEBUG: Trying rule: cd_correction; took: 0:00:00.000034
DEBUG: Trying rule: cd_mkdir; took: 0:00:00.000009
DEBUG: Trying rule: cd_parent; took: 0:00:00.000001
DEBUG: Trying rule: chmod_x; took: 0:00:00.000002
DEBUG: Trying rule: composer_not_command; took: 0:00:00.000010
DEBUG: Trying rule: cp_omitting_directory; took: 0:00:00.000035
DEBUG: Trying rule: cpp11; took: 0:00:00.000009
DEBUG: Trying rule: dirty_untar; took: 0:00:00.000008
DEBUG: Trying rule: dirty_unzip; took: 0:00:00.000007
DEBUG: Trying rule: django_south_ghost; took: 0:00:00.000002
DEBUG: Trying rule: django_south_merge; took: 0:00:00.000001
DEBUG: Trying rule: docker_login; took: 0:00:00.000007
DEBUG: Trying rule: docker_not_command; took: 0:00:00.000033
DEBUG: Trying rule: fab_command_not_found; took: 0:00:00.000008
DEBUG: Trying rule: fix_alt_space; took: 0:00:00.000005
DEBUG: Trying rule: fix_file; took: 0:00:00.000009
DEBUG: Trying rule: gem_unknown_command; took: 0:00:00.000016
DEBUG: Trying rule: git_add; took: 0:00:00.000011
DEBUG: Trying rule: git_add_force; took: 0:00:00.000006
DEBUG: Trying rule: git_bisect_usage; took: 0:00:00.000006
DEBUG: Trying rule: git_branch_delete; took: 0:00:00.000006
DEBUG: Trying rule: git_branch_exists; took: 0:00:00.000005
DEBUG: Trying rule: git_branch_list; took: 0:00:00.000005
DEBUG: Trying rule: git_checkout; took: 0:00:00.000005
DEBUG: Trying rule: git_commit_amend; took: 0:00:00.000005
DEBUG: Trying rule: git_commit_reset; took: 0:00:00.000008
DEBUG: Trying rule: git_diff_no_index; took: 0:00:00.000006
DEBUG: Trying rule: git_diff_staged; took: 0:00:00.000006
DEBUG: Trying rule: git_fix_stash; took: 0:00:00.000005
DEBUG: Trying rule: git_flag_after_filename; took: 0:00:00.000005
DEBUG: Trying rule: git_help_aliased; took: 0:00:00.000005
DEBUG: Trying rule: git_merge; took: 0:00:00.000005
DEBUG: Trying rule: git_merge_unrelated; took: 0:00:00.000005
DEBUG: Trying rule: git_not_command; took: 0:00:00.000005
DEBUG: Trying rule: git_pull; took: 0:00:00.000007
DEBUG: Trying rule: git_pull_clone; took: 0:00:00.000009
DEBUG: Trying rule: git_pull_uncommitted_changes; took: 0:00:00.000009
DEBUG: Trying rule: git_push; took: 0:00:00.000009
DEBUG: Trying rule: git_push_different_branch_names; took: 0:00:00.000008
DEBUG: Trying rule: git_push_pull; took: 0:00:00.000008
DEBUG: Trying rule: git_push_without_commits; took: 0:00:00.000008
DEBUG: Trying rule: git_rebase_merge_dir; took: 0:00:00.000008
DEBUG: Trying rule: git_rebase_no_changes; took: 0:00:00.000007
DEBUG: Trying rule: git_remote_delete; took: 0:00:00.000009
DEBUG: Trying rule: git_remote_seturl_add; took: 0:00:00.000008
DEBUG: Trying rule: git_rm_local_modifications; took: 0:00:00.000007
DEBUG: Trying rule: git_rm_recursive; took: 0:00:00.000007
DEBUG: Trying rule: git_rm_staged; took: 0:00:00.000007
DEBUG: Trying rule: git_stash; took: 0:00:00.000007
DEBUG: Trying rule: git_tag_force; took: 0:00:00.000007
DEBUG: Trying rule: git_two_dashes; took: 0:00:00.000007
DEBUG: Trying rule: go_run; took: 0:00:00.000012
DEBUG: Trying rule: gradle_no_task; took: 0:00:00.000012
DEBUG: Trying rule: gradle_wrapper; took: 0:00:00.000013
DEBUG: Trying rule: grep_arguments_order; took: 0:00:00.000010
DEBUG: Trying rule: grep_recursive; took: 0:00:00.000009
DEBUG: Trying rule: grunt_task_not_found; took: 0:00:00.000009
DEBUG: Trying rule: gulp_not_task; took: 0:00:00.000009
DEBUG: Trying rule: has_exists_script; took: 0:00:00.000072
DEBUG: Trying rule: heroku_multiple_apps; took: 0:00:00.000011
DEBUG: Trying rule: heroku_not_command; took: 0:00:00.000010
DEBUG: Trying rule: hostscli; took: 0:00:00.000053
DEBUG: Trying rule: ifconfig_device_not_found; took: 0:00:00.000012
DEBUG: Trying rule: java; took: 0:00:00.000012
DEBUG: Trying rule: javac; took: 0:00:00.000009
DEBUG: Trying rule: lein_not_task; took: 0:00:00.000052
DEBUG: Trying rule: ln_no_hard_link; took: 0:00:00.000007
DEBUG: Trying rule: ln_s_order; took: 0:00:00.000036
DEBUG: Trying rule: ls_all; took: 0:00:00.000021
DEBUG: Trying rule: ls_lah; took: 0:00:00.000012
DEBUG: Trying rule: man; took: 0:00:00.000015
DEBUG: Trying rule: mercurial; took: 0:00:00.000013
DEBUG: Trying rule: mkdir_p; took: 0:00:00.000006
DEBUG: Trying rule: mvn_no_command; took: 0:00:00.000015
DEBUG: Trying rule: mvn_unknown_lifecycle_phase; took: 0:00:00.000011
DEBUG: Trying rule: no_such_file; took: 0:00:00.000824
DEBUG: Trying rule: open; took: 0:00:00.000033
DEBUG: Trying rule: php_s; took: 0:00:00.000016
DEBUG: Trying rule: pip_install; took: 0:00:00.000057
DEBUG: Trying rule: pip_unknown_command; took: 0:00:00.000042
DEBUG: Trying rule: port_already_in_use; took: 0:00:00.000343
DEBUG: Trying rule: prove_recursively; took: 0:00:00.000021
DEBUG: Trying rule: pyenv_no_such_command; took: 0:00:00.000016
DEBUG: Trying rule: python_command; took: 0:00:00.000039
DEBUG: Trying rule: python_execute; took: 0:00:00.000015
DEBUG: Trying rule: quotation_marks; took: 0:00:00.000003
DEBUG: Trying rule: react_native_command_unrecognized; took: 0:00:00.000013
DEBUG: Trying rule: remove_trailing_cedilla; took: 0:00:00.000002
DEBUG: Trying rule: rm_dir; took: 0:00:00.000007
DEBUG: Trying rule: scm_correction; took: 0:00:00.000014
DEBUG: Trying rule: sed_unterminated_s; took: 0:00:00.000013
DEBUG: Trying rule: sl_ls; took: 0:00:00.000002
DEBUG: Trying rule: ssh_known_hosts; took: 0:00:00.000012
DEBUG: Trying rule: sudo; took: 0:00:00.000005
DEBUG: Trying rule: sudo_command_from_user_path; took: 0:00:00.000017
DEBUG: Trying rule: switch_lang; took: 0:00:00.000002
DEBUG: Trying rule: systemctl; took: 0:00:00.000272
DEBUG: Trying rule: tmux; took: 0:00:00.000015
DEBUG: Trying rule: touch; took: 0:00:00.000013
DEBUG: Trying rule: tsuru_login; took: 0:00:00.000012
DEBUG: Trying rule: tsuru_not_command; took: 0:00:00.000011
DEBUG: Trying rule: unknown_command; took: 0:00:00.000203
DEBUG: Trying rule: unsudo; took: 0:00:00.000005
DEBUG: Trying rule: vagrant_up; took: 0:00:00.000015
DEBUG: Trying rule: whois; took: 0:00:00.000014
DEBUG: Trying rule: workon_doesnt_exists; took: 0:00:00.000013
DEBUG: Trying rule: yarn_alias; took: 0:00:00.000013
DEBUG: Trying rule: yarn_command_not_found; took: 0:00:00.000012
DEBUG: Trying rule: yarn_command_replaced; took: 0:00:00.000011
DEBUG: Trying rule: yarn_help; took: 0:00:00.000012
DEBUG: Trying rule: man_no_space; took: 0:00:00.000003
DEBUG: Trying rule: no_command; took: 0:00:00.000094
DEBUG: Trying rule: missing_space_before_subcommand; took: 0:00:00.000013
DEBUG: Trying rule: long_form_help; took: 0:00:00.000376
DEBUG: Trying rule: history; took: 0:00:00.005554
sudo apt install redis
DEBUG: PYTHONIOENCODING: utf-8
DEBUG: Total took: 0:00:00.582621
Reading package lists... Done
Building dependency tree       
Reading state information... Done
redis is already the newest version (5:4.0.9-1ubuntu0.2).
0 upgraded, 0 newly installed, 0 to remove and 102 not upgraded.

If the bug only appears with a specific application, the output of that application and its version:

---

Anything else you think is relevant:

---
scorphus commented 5 years ago

The sudo apt install redis being suggested is a result of the history rule searching shell history and finding a similar command.

There's yet no such rule for APT. One that would suggest a correction for a mistyped package. Are you willing to contribute?

fsabr commented 5 years ago

@scorphus Hi, newbie here. So will this work properly if apt-get was used instead?

scorphus commented 5 years ago

Hey, @ebby21! Welcome aboard!

Yes, it should work for both apt and apt-get. The for_app decorator can help with that (e.g. thefuck/rules/gradle_no_task.py).

fsabr commented 5 years ago

I noticed that there are multiple rules for apt: apt_get, apt_get_search, apt_invalid_operation, apt_list_upgradable, apt_upgrade

Could you tell me which one corrects mistyped packages for apt-get?

scorphus commented 5 years ago

Could you tell me which one corrects mistyped packages for apt-get?

None of them. That rule needs to be created. Hence this very issue 🙂

fsabr commented 5 years ago

Hmm... Does CommandNotFound provide an api for this? If not, can I execute a system command to invoke the package manager (apt) to search for the package and return the closest match?

chiral-carbon commented 5 years ago

Hi, is this issue claimed or can I work on it? Newbie here. :smile:

cjoshmartin commented 4 years ago

I noticed this problem with apt-get as well. photo of problem