You are not logged in.

#1 2007-02-22 04:52:30

jae1227
Member
Registered: 2007-02-22
Posts: 31

autocomplete for pacman

Ok I have been using Ubuntu for about 9 months. I really liked it but the speed began to become a problem and I wanted to learn more about linux. So I have been trying many distos in VMs and had little luck. Gentoo loaded up but got issues. So I found Arch linuxand I love it. It is so easy to install and feels alot like a server install of Ubuntu but more like Debian. One this is giving me issues. In ubuntu I could just type :

sudo apt-get install nvi<tab>dia-glx

I am using <tab> to mean hit the tab button

What I am saying is that in apt-get there was an auto complete. In this case I new I wanted nvidia driver but did not know all of the package name. So how can I do this in pacman. It is probably really easy to fix. I had the same issue before with yum , no auto complete.

Offline

#2 2007-02-22 04:59:18

hacosta
Member
From: Mexico
Registered: 2006-10-22
Posts: 423

Re: autocomplete for pacman

check the bash-completion package, i think it has a file that does this

Offline

#3 2007-02-22 07:06:39

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

Re: autocomplete for pacman

or simply use ``pacman -Ss nvi''

Offline

#4 2007-02-22 22:05:29

jae1227
Member
Registered: 2007-02-22
Posts: 31

Re: autocomplete for pacman

so there is no way to just use the tab button to auto complete?

Offline

#5 2007-02-22 22:29:42

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: autocomplete for pacman

As said, bash-completion package provides that for bash. There's also zsh-completion package in AUR which provides the same for zsh.

Last edited by lucke (2007-02-22 22:30:24)

Offline

#6 2007-02-23 03:34:13

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: autocomplete for pacman

jae1227 wrote:

so there is no way to just use the tab button to auto complete?

That is what was suggested.  bash doesn't just *know* how to autocomplete everything.  It needs help.  This is what the bash_completion package does.  It helps bash by telling it how to complete things when you press tab.

Offline

#7 2007-02-23 03:55:54

jae1227
Member
Registered: 2007-02-22
Posts: 31

Re: autocomplete for pacman

ok thanks for the help with bash-completion. It works great but only when in the terminal. If I use a terminal emulator like gnome-terminal is does not work. So I have to Ctrl + Alt + F1 to be able to use the auto complete. I just don't know why it does not work in gnome-terminal. I have not tried KDE terminal yet but I doubt it will work either. So far I love the speed of Arch. I came from Ubuntu and I am still trying to get minor things to work like how they did in ubuntu. But overall Arch is awesome!

Offline

#8 2007-02-23 04:11:10

jae1227
Member
Registered: 2007-02-22
Posts: 31

Re: autocomplete for pacman

sorry for writing again so soon but I just figured out how to use community repo. It is just like apt-get in that you use uncomment something. So I did that and typed:

pacman -S nautilus-open-terminal

and it installed the only problem is that if I hit tab after "nautilus-" is only showed 4 options and none of them was the open-terminal package. I think I just need to tell it to somehow include community repo in the auto complete.

Offline

#9 2007-02-23 04:46:51

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: autocomplete for pacman

Did you updated your pacman db:
# pacman -Sy

Offline

#10 2007-02-23 04:59:16

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: autocomplete for pacman

The reason bash completion doesn't work all the time is that it is ONLY included if you run bash as a login shell.  Different terminals need different configurations to set the shell as a login shell.  You'll have to check with the docs for the terminal you are using.

Alternatively, you can manually source /etc/bash_completion in your ~/.bashrc, but that's not really the "proper" fix.

Offline

#11 2007-02-23 05:28:12

jae1227
Member
Registered: 2007-02-22
Posts: 31

Re: autocomplete for pacman

Snowman wrote:

Did you updated your pacman db:
# pacman -Sy

yeah and it still did not change the auto complete. Still only auto-completing packages from current and not community.

Offline

#12 2007-02-23 06:09:26

thepizzaking
Member
From: Melbourne, Victoria, Australia
Registered: 2006-03-13
Posts: 46

Re: autocomplete for pacman

I also had this problem and just fixed it by removing the hash in front of the [community] line in my pacman.conf file.  For some reason I still had that line commented out even though I had the repository enabled.

Offline

#13 2007-02-24 23:30:02

jae1227
Member
Registered: 2007-02-22
Posts: 31

Re: autocomplete for pacman

ok I guess alot of people don't need auto-complete. So I am wondering how everyone know what packages are avaliable and what they want. An wexample is today when I wanted oponoffice. I typed

pacman -S openoffice

but it said so such package available. Now with auto complete I found out that I should have typed :

pacman -S openoffice-base

without auto complete I would have not know that. I guess you can search on the internet each time for a package. I am used to auto complete and just wondering what people use to know what package they want.

Offline

#14 2007-02-25 00:01:03

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: autocomplete for pacman

You can search with pacman:
pacman -Ss openoffice

Offline

#15 2007-02-25 02:03:57

jae1227
Member
Registered: 2007-02-22
Posts: 31

Re: autocomplete for pacman

So searching is how everyone does it in Arch Linux?

Offline

#16 2007-02-25 02:52:18

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: autocomplete for pacman

They use pacman -Ss to search, or they use the web interfaces on archlinux.org and aur.archlinux.org. There's also several hundred scripts out there to make searching better for various reasons, faster, coloured output, regular expressions, etc. A forum search will provide links to most of them.

Dusty

Offline

#17 2007-02-25 04:00:49

chaosgeisterchen
Member
From: Kefermarkt, Upper Austria
Registered: 2006-11-20
Posts: 550

Re: autocomplete for pacman

Dusty wrote:

They use pacman -Ss to search, or they use the web interfaces on archlinux.org and aur.archlinux.org. There's also several hundred scripts out there to make searching better for various reasons, faster, coloured output, regular expressions, etc. A forum search will provide links to most of them.

Dusty

Although these scripts are available, autocompletion is a feature, which makes it a lot easier to install exactly the program you need. Nevertheless, pacman -Ss is also a very good tool and I would not like to miss it. First I was also used to use Debian-style autocompletion, but it did not take me too long to adapt to the Arch way, which I also very much appreciate. Are tools like aptitude search $packagename tools equivalent to pacman -Ss? I do not seem to remember it correctly.


celestary
Intel Core2Duo E6300 @ 1.86 GHz
kernel26
KDEmod current repository

Offline

#18 2007-02-25 22:08:05

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: autocomplete for pacman

chaosgeisterchen wrote:

Are tools like aptitude search $packagename tools equivalent to pacman -Ss? I do not seem to remember it correctly.

We'd probably be able to answer that better if you explained what that command did.

Offline

#19 2007-02-25 22:30:14

test1000
Member
Registered: 2005-04-03
Posts: 834

Re: autocomplete for pacman

when did you forget to google? http://en.wikipedia.org/wiki/Aptitude_(program)


KISS = "It can scarcely be denied that the supreme goal of all theory is to make the irreducible basic elements as simple and as few as possible without having to surrender the adequate representation of a single datum of experience." - Albert Einstein

Offline

#20 2007-02-26 07:56:30

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: autocomplete for pacman

You miss my point.  I don't actually _care_ about what aptitude does, compared to pacman.  It is just far easier to answer a question when it is of the form "why doesn't X do Y?" as opposed to "why doesn't X do the same thing that Y does?"

Offline

#21 2007-02-26 11:42:26

Kern
Member
From: UK
Registered: 2005-02-09
Posts: 464

Re: autocomplete for pacman

OP:

In this case I new I wanted nvidia driver but did not know all of the package name. So how can I do this in pacman.

autocomplete depends on you knowing the first part of the name. Altho Arch doesnt use autocomplete, afaik, it can be more versatile by giving it a little help. so its really a 2 stage process if you're  not knowing the exact package name.  pacman also searches the description, you can search even if you cant remember _any_ of the package name.
(with full acknowledgement to the previous repliers)

i need a video driver: pacman -Ss driver :  oh man too many ...
<snip results>

i think my driver package has the word nvidia in it (but i cant remember the full name) this is the usual first step:
pacman -Ss nvidia
<snip results>
this look like quite a few and its awkward to read ... what if i only need see the package names?

pacman -Ss nvidia |grep -F /
<snip results>
OK im a control freak/lets be pedantic, this still shows the nforce things, im sure it begins with nvidia i dont need the rest,
pacman -Ss nvidia |grep -F /nvid   or  pacman -Ss ^nvidia   or   pacman -Ss ^nvidia |grep -F /

etc blah blah
altho this may look a little over the top with nvidia as an example it shows the inbuilt versatility that pacman offers when you're really stuck on what package You need. play around, have fun :)

hth
Kern

Last edited by Kern (2007-02-26 11:44:07)

Offline

#22 2009-02-10 09:18:56

hugopicado
Member
Registered: 2009-02-10
Posts: 3

Re: autocomplete for pacman

Hi.

It should be considered that sometimes autocomplete is useful.
It is possible to get autocomplete working on gnome terminal.

You just install the bash-completion package:

pacman -S bash-completion

and then you should enable it in your ~/.bashrc configuration file by adding
the following:

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

After restarting the terminal you might have this working.

Regards,
Hugo.

Last edited by hugopicado (2009-02-10 11:32:03)

Offline

#23 2009-02-11 11:15:40

jordz
Member
Registered: 2006-02-01
Posts: 250

Re: autocomplete for pacman

Or

ln -s ~/.bashrc ~/.bash_profile
source /etc/profile

/etc/profile sources ~/.bashrc

Last edited by jordz (2009-02-11 11:16:42)

Offline

#24 2017-09-28 14:01:48

alirezaimi
Member
Registered: 2015-05-18
Posts: 3

Re: autocomplete for pacman

hugopicado wrote:

Hi.

It should be considered that sometimes autocomplete is useful.
It is possible to get autocomplete working on gnome terminal.

You just install the bash-completion package:

pacman -S bash-completion

and then you should enable it in your ~/.bashrc configuration file by adding
the following:

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

After restarting the terminal you might have this working.

Regards,
Hugo.

Work for me , thanks.

Offline

#25 2017-09-28 14:04:10

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,257

Re: autocomplete for pacman

Please refrain from necrobumping a 10 year old thread with the equivalent of a "me too" post, further infractions might lead to a ban, this information is also readily available in the wiki.

https://wiki.archlinux.org/index.php/Co … bumping.22


Closing.

Last edited by V1del (2017-09-28 14:06:25)

Offline

Board footer

Powered by FluxBB