Why can't I run ack from the terminal after I switched from ubuntu to archlinux?

StackOverflow https://stackoverflow.com/questions/14598687

  •  06-03-2022
  •  | 
  •  

سؤال

I just switch from ubuntu to archlinux and I installed ack-grep via pacman. However what I found is I can't run $ ack from terminal directy. I have to type $ perl ack , which is a pain...I wonder if anyone hve experienced similar situation and how do you solve it.

Thanks

هل كانت مفيدة؟

المحلول 2

It depends on the shell you're using. Probably the simplest thing you can do (assuming bash) is to create an alias for your desired command, something like:

alias acx='perl ack'

You'll probably want to place that somewhere in one of your startup scripts, such as .profile, or .bash_profile in your home directory.

If you're using a different sheel that doesn't support aliases, you can still resort to providing a script to do the translation for you, such as putting the following acx file in your path:

perl ack "$@" # or however your particular sheel transfers all arguments.

نصائح أخرى

There is no reason to use an alias here. It is perl's job to update $PATH in this case. Seeing that the perl package is included in the base group then at most re-logging in should correct everything.

I've also tested this on my system and pacman -Syu ack (-Syu should always be used when installing).

# pacman -Syu ack

# ack --help (no error)

Also

$ which ack

/usr/bin/vendor_perl/ack

You should not have to make an alias to run ack as the answer above suggests. Rather than make the workaround alias, let's get your problem fixed.

Why can't you run ack? What happens when you run it? Did you get an error message? What was the error message?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top