Apt-get autocomplete package name is broken


Type the following command:

sudo -H gedit /etc/bash.bashrc

Look for these lines:

# enable bash completion in interactive shells # if ! shopt -oq posix; then # if [ -f /usr/share/bash-completion/bash_completion ]; then # . /usr/share/bash-completion/bash_completion # elif [ -f /etc/bash_completion ]; then # . /etc/bash_completion # fi # fi

Uncomment some lines, to make it look like this:

# enable bash completion in interactive shells if ! shopt -oq posix; then if [ -f /usr/share/bash-completion/bash_completion ]; then . /usr/share/bash-completion/bash_completion elif [ -f /etc/bash_completion ]; then . /etc/bash_completion fi fi

Save, close terminal, then reopen it.

I have this issue after installing 13.04, and that's how I resolve...

0 0

Debian does not come with 'bash-completion' installed and enabled.

To fix this, run (as root):

apt-get install bash-completion

Then, you have two options. You can either (1) enable it on a per-user basis for yourself, or (2) enable it globally.

If you want to enable it for just your user, edit ~/.bash_profile and ~/.bashrc - add the following:

if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi

To try it without logging out and back in, run:

. ~/.bashrc

Or open a new shell. Then try to use tab-completion with apt. That dot and space at the beginning (.) is the same as using the source keyword in bash, but is more portable.

If you want it to work when su'd into the root account, do the same thing in root's home directory (typically /root).

To enable it globally, do the changes from (1) in the file /etc/bash.bashrc...

0 0

I was wondering how to enable auto complete of packages for apt-get command in Backtrack linux. I recalled a day when I firstly installed Ubuntu on my laptop, and I was searching for a way to manipulate packages. I was not able to know every package nor versioning. Thus, searching on the Internet I finally found the bash_completion. This is a utility with very powerful abilities for users and programmers. In order to understand better what bash_completion is, I advice you to take a look at debian’s article about bash_completion utility .

Now lets tell how to enable this feature if not already enabled. There are two ways both includes shell commands and the changes last for the terminal session you use.


source /etc/bash_completion


. /etc/bash_completion

From now on you are able to use Tab key to autocomplete / suggest commands like:

apt-get ins [TAB]apt-get install dove[TAB]apt-get install dovecot[TAB]dovecot dovecot-gssapi...
0 0

Open up a terminal, then type:

nano /etc/bash.bashrc

Now, search for the following commented lines (lines with a starting #)

# enable bash completion in interactive shells
#if [ -f /etc/bash_completion ]; then
#. /etc/bash_completion

And uncomment them like this:

# enable bash completion in interactive shells
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion

Now whenever you want to install a package, for example, you need only type the first letters of the package in the apt-get install command line and then hit tab twice to list available packages starting with those letters.

e.g. Typing

apt-get ins

will autocomplete to apt-get install. Now continue and type

apt-get install amar

and a list with every package with “amar” in their name will be shown. In this example, it will probably list packages such as amaroK and...

0 0

At some moment

apt-get install

autocomplete was broken

It was very useful to me to see packages name with Tab press

How to repair this autocomplete?

As stated in the comments to the other answer, first make sure that bash-completion is installed:

sudo apt-get install bash-completion

and apparently for @diapir, it helped to reinstall it:

sudo apt-get install --reinstall bash-completion

However, for me, the problem was not that bash-completion was not installed or broken, the problem was that I had accidently deleted my .bashrc file. You can get a new one by copying it from /etc/skel:

cp /etc/skel/.bashrc ~/

Type the following command:

sudo -H gedit /etc/bash.bashrc

Look for these lines:

# enable bash completion in interactive shells # if ! shopt -oq posix; then # if [ -f /usr/share/bash-completion/bash_completion ]; then # . /usr/share/bash-completion/bash_completion # elif [ -f /etc/bash_completion ]; then # ....
0 0

I have Ubuntu 10.10 x64 and x86 running on various servers and auto complete works on all of them bar one.

The issue: apt- would show a list of options but sudo apt- would not.

After fiddling with it for a few hours i've found that /etc/bash_autocomplete did not exist. on the broken server. Copying the one from a working one it now works. but still not properly.

sudo apt-get ins does not show do anything.

listing the files in /etc/bash_autocomplete.d/ on the working server has about 50 files, and the broken one only two or three.

i dont think that i can just copy these files though as it might show commands for things that are not even installed.


autocomplete broken, how can i fix it. Seems like its disabled somewhere, why is this

EDIT: Ok, it was not ever installed...

$ sudo apt-get install bash-completion Reading package lists... Done Building dependency tree Reading state information... Done The following NEW...
0 0

Whether you're online or not--

How do you find the package that's got the feature you're looking for? First, do

so your package list is up-to-date, and then try something like

That is how you tell


to search the packages you've downloaded, using REGEX (regular expression, a pattern-matching 'language') -- if your pattern uses any keystrokes that mean something to your command shell (e.g.


) you'll need to quote them so that


will be able to see them, instead of having the shell expand the term to a list of file names that mean something else entirely.

" NOTE -- apt-cache only knows about the package descriptions you've already downloaded. To search among ALL known Debian packages just browse to http://packages.debian.org/PACKAGESUBSTRING to see what's available. For example: http://packages.debian.org/vnc That would get you a listing of packages that contain the term "vnc" somewhere in the...

0 0

This article applies to all supported versions of Ubuntu

Package management via apt-get runs hand-in-hand with the /etc/apt/sources.list file. For information on editing or updating your sources list see SourcesList.


This page describes how to handle the packages on your system using apt-get and related commands. For example, you can install a new package, remove an installed package, or update all installed packages to the latest versions.


Installation commands

apt-get install This command installs a new package.apt-get build-dep

This command searches the repositories and installs the build dependencies for . If the package is not in the repositories it will return an error.

aptitude install

Aptitude is an Ncurses viewer of packages installed or available. Aptitude can be used from the command line in a similar way to apt-get. Enter man aptitude for more information.

APT and aptitude will accept...
0 0
0 0

How to Fix Broken Packages on Ubuntu 16.04 / Debian 9. When a Linux user or sysadmin performs package management on Ubuntu / Debian most of them preferred apt-get or dpkg as a package management utility to install and upgrade the new packages. This types of errors occurs periodically where installation is done in mean time when user faces broken packages issues due to various reasons including improper package management, incorrect packages installation, incorrect installation of packages from source files, installation of unwanted packages, installation of in-compatible packages, etc. This tutorial explains how to fix those broken packages in mean time by integrating given tips and tricks on your Ubuntu / Debian distribution.

Pre-Steps-1 (Remove the apt-get package locks)$ sudo rm -rf /var/lib/apt/lists/lock /var/cache/apt/archives/lock /var/lib/dpkg/lockPre-Steps-2 (Restart your Ubuntu / Debian distribution)$ sudo init 6Step-1 (Remove the repository cache using apt-get...
0 0

Get sync 1.1 installation error

I try to install sync 1.1 according to the instructions in the https://docs.services.mozilla.com/howtos/run-sync.html#howto-run-sync11

System Ubuntu LTS 14.04

After you download the source and try to build it has reported a number of ssl errors. Online advice, I installed a few python packages that made the error to go away. (Wiping the local directory and restart after each error).

Now, it gives me an error related to SQLAlchemy. It's even after a succesfull apt - get install python-sqlalchemy it seems to want a local version.

The output to build:
Prescription already up-to-date: docopt a./lib/python2.7/site-packages/docopt-0.6.2-py2.7.egg (from m
etlog-py > = 0.9.6-> r dev - reqs.txt (line 20))
Installation of packages collected: WebOb, WebTest, beaker, python-Memcache, SQLAlchemy, Zope.interface, r
epoze.who, zope.deprecation, metlog-cef scrypt
Found existing...

0 0

I included this answer in my blog. If you want to see that you can go there from this link.

The above error is very common in Ubuntu terminal when you try to upgrade (apt-get upgrade). This usually happens because dependencies of one package you install has changed. In order to upgrade you need to upgrade those as well first. So it is very straightforward to solve that. You will be able to see those packages that kept back below this error message. as an example I can see following packages in the list:

gnome-software gnome-software-common linux-generic linux-headers-generic linux-image-generic snapd ubuntu-core-launcher ubuntu-software

Don't just type sudo apt-get dist-upgrade It is very dangerous since it installs all pending updates. This could take your working environment to a highly unstable state.

Therefore my opinion is to use famous

sudo apt-get install [package]

You can replace [package] with whatever package is in the error...

0 0

We're using fake root environment at work. Basically it is a bunch of directories which emulate apt-get and dpkg if some environment variables are set. I.e. you run apt-get install xxx and package xxx is being installed into this environment but not into the system.

When I used bash, apt-get autocomplete worked perfectly. When I typed apt-get install , it showed me the list of local packages if I was in a fake root and the global list otherwise.

However, when I switched to zsh weird things happened. Currently only global packages show up in the list, though it was not always the case. Here is the complete story.

I install Ubuntu and setup the fake root and zsh. I reinstall Ubuntu from scratch, saving /home which was on a separate partition. Now zsh autocomplete always show me the packages from the fake root, regardless whether I have the env vars set. I reinstall zsh and zsh-common. Now completion always work as no fake root exist. At the same moment I realize...
0 0