«

»

Mar 26 2014

command-not-found now available for OpenMandriva Lx

command-not-found, a tool that has been made for ROSA is now also available in OpenMandriva Lx repository (at this time, only development version).

What is this package about?

It may arrive that you need to launch a command inside a terminal, even if you’re a new user, sometimes things are done quicker with a simple command.

Sometimes you can see this message «command not found». This can happen for several reasons, for example, a necessary package is not installed, or there is a typo. Many other distributions are already able to return a message such as: “this command needs the package xxx to be installed”. This avoid to investigate for finding the correct package, if it exists.

Thanks to “command-not-found”, as an example, if you ask for a non existing “foo” command (or make a typo), here is what you get

$ foo
No command ‘foo’ found, did you mean:
Command ‘fio’ from package ‘fio’ (contrib)
Command ‘fop’ from package ‘fop’ (main, installed)
Command ‘for’ from package ‘execline’ (contrib)
Command ‘zoo’ from package ‘zoo’ (restricted)

Notice that not only is returned a list of close looking command, but also informs if the package is already installed or not.

If you ask for an actual command, but being part of a non installed package:

$ zoo
Command ‘zoo’ can be found in:
package ‘zoo’ (restricted)
You can install it by typing:
urpmi zoo
Do you want to install it? (y/N)

If you want to install the package, just type “y”. By default, no is selected.

One more command-not-found feature is analysis of installed packages:

$ ifconfig
Command ‘ifconfig’ can be found in:
package ‘net-tools’ (main, installed)
File /sbin/ifconfig exists! Check your PATH variable, or call it using an absolute path.

Last, but not least, command-not-found comes with a little utility called “cnf”. Using cnf in conjunction with the name of a command will give you the same informations without executing the command. Very useful to quickly know from which package an installed command is coming. For example, “cnf screen” will tell you from which package comes the command screen, without launching it.

Notes:

  • You can install it in Lx 2013/2014 directly from repository by clicking on the package command-not-found and then opening it with the software installer, however, you need to install command-not-found-data first.
  • Until we have a full documentation in our wiki, you can find more informations in ROSA Wiki

2 comments

  1. Quiroga

    I have translated some notes from this blog, but In this case the wording is not very understandable. Please review the text and make it clearer.
    Blogdrake!!! … (???) :(

  2. quiroga

    command-not-found ya está disponible para OpenMandriva Lx

    Command-not-found, una herramienta que se ha hecho para ROSA ahora también está disponible en el repositorio de OpenMandriva Lx (en este momento, sólo lpara la versión de desarrollo).

    ¿Qué es este paquete?

    Puede llegar que necesitas ejecutar un comando en un terminal, incluso si eres un usuario nuevo, a veces las cosas se hacen más rápido con un simple comando.

    A veces puedes ver este mensaje «command not found». Esto puede ocurrir por varias razones, por ejemplo, un paquete necesario no está instalado, o hay un error tipográfico. Muchas otras distribuciones ya son capaces de devolver un mensaje como: “este comando necesita el paquete xxx para instalarse”. Esto evita investigar para encontrar el paquete correcto, si es que existe.

    Gracias a “command-not-found”, por ejemplo, si usted pide un comando “foo” y no existente (o hace un error tipográfico), esto es lo que obtienes:

    $ foo
    No command ‘foo’ found, did you mean:
    Command ‘fio’ from package ‘fio’ (contrib)
    Command ‘fop’ from package ‘fop’ (main, installed)
    Command ‘for’ from package ‘execline’ (contrib)
    Command ‘zoo’ from package ‘zoo’ (restricted)

    Tenga en cuenta que no sólo se devuelve una lista con comandos que se escriben de manera muy similar , sino que también informa si el paquete ya está instalado o no.

    Si usted solicita un comando real, pero es parte de un paquete no instalado:

    $ zoo
    Command ‘zoo’ can be found in:
    package ‘zoo’ (restricted)
    You can install it by typing:
    urpmi zoo
    Do you want to install it? (y/N)

    Si desea instalar el paquete, sólo tienes que escribir “y”. Por defecto, no se selecciona.

    Una característica más de command-not-found es el análisis de paquetes instalados:

    $ ifconfig
    Command ‘ifconfig’ can be found in:
    package ‘net-tools’ (main, installed)
    File /sbin/ifconfig exists! Check your PATH variable, or call it using an absolute path.

    Por último, pero no menos importante, command-not-found viene con una pequeña utilidad llamada “cnf”. Usando la cnf en conjunción con el nombre de un comando te dará las mismas informaciones sin ejecutar el comando. Muy útil saber rápidamente de paquete que viene instalado un comando. Por ejemplo, “cnf screen” le dirá que paquete proviene de la pantalla del sistema, sin necesidad de iniciar ella.

    Notas:

    Puede instalarlo en Lx 2013/2014 directamente del repositorio haciendo clic en el paquete command-not-found y luego abrirlo con el instalador del software, sin embargo, es necesario instalar primero command-not-found-data
    Hasta que tengamos una documentación completa en nuestro wiki, usted puede encontrar más informaciones en ROSA Wiki

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>