At some moment, the apt-get install autocomplete was broken. It was very useful to me to see the names of packages available for installation when pressing Tab.
For example, if I would press the Tab key after sudo apt-get install ruby, all packages starting with ruby would be displayed, such as ruby-mysql, ryby-dev, etc.
Instead of this behavior, if I press Tab, I get a list of directories, as I get when I use cd and press Tab.
How to repair this autocomplete?