Arjun Yadav's Webpage


Cool trick to install software via apt package manager

2021-11-01

to install software via apt in debian and debian based distros you have to type "sudo apt install foo" however there are two problems with this:

1- you have to know the exact name of the package you want to install

2- you have to type "sudo apt install foo" which is somewhat long.

there is a cool trick which someone posted on reddit.(and i can't remember the exact source at this moment)

paste this code in terminal:

apt-cache search "" | sort | cut --delimiter " " --fields 1 | fzf --multi --cycle --reverse --preview "apt-cache show {1}" --preview-window=:57%:wrap:rounded:hidden --bind=space:toggle-preview | xargs -r sudo apt install -y

fapt

(ofcourse you can make a simple script or make alias of this big command to make it short)

technically he just added apt repository with fuzzy finder, but no one had ever thought of doing this simple thing, and that's why i'm thankful to the guy who originally posted this on reddit.



prerequisite:

you should have fzf installed in order to use it.