[SOLVED] Pkgfile works only if I source file in shell's run command

Hello. I have created discussion here: https://wiki.archlinux.org/index.php/Talk:Pkgfile, where I was told to open forum thread.
At the Command not found section it is explained that it will automatically search the official repositories, when entering an unrecognized command
But for me, it only works if I source file, as it is explained further:
To enable it in all children shells, you need to source the hook from one of your shell initialization files.
    Example for Bash: ~/.bashrc
source /usr/share/doc/pkgfile/command-not-found.bash
I think we shold make it workable as it is explained in wiki or edit wiki as it works.
By the way, why there was removed useful information about command-not-found aur package? See https://wiki.archlinux.org/index.php?ti … did=317469 I think we should explain in wiki about this package too.
Last edited by agent0 (2014-10-25 11:42:54)

agent0 wrote:At the Command not found section it is explained that it will automatically search the official repositories, when entering an unrecognized command.  But for me, it only works if I source file, as it is explained further
Am I missing something here?  The wiki says that pkgfile includes that hook, and immediately afterwords says how to enable it.  You are claiming it only works for you when you enable it.  Good.  This is the expected behavior, that's why the instructions on how to enable that feature are right there in the wiki.  What is the issue here?
agent0 wrote:In article there is not any information that i need to run $ . /usr/share/doc/pkgfile/command-not-found.bash.
Yes, there is.  It says to source that file from your shellrc file.  It even gives explcit examples on how to do that for bash and zsh.

Similar Messages

  • [SOLVED] Creating src package when the source files must d/l manually

    There's a program which requires to input some data before the GPL source can be downloaded.
    http://www.csse.uwa.edu.au/cnet/download.html
    When I put `source=('cnet-3.3.1.tgz')` in the PKGBUILD and put the archive in PKGBIULD's dir - it compiles and installs just fine.
    However when creating a source file with `mkaurball` it puts the whole archive in the .src.tar.gz.
    What do I do?
    Last edited by axper (2014-06-28 12:11:58)

    You should file a bug against pkgbuild-introspection , looks like mkaurball needs an extra check for archives in source array.
    You could use makepkg --source for now, and upload the file that creates.
    An alternative may be to edit the .src.tar.gz mkaurball created and delete the cnet*.tgz manually .
    Not sure is editing .AURINFO is also needed .

  • [SOLVED] startx works only as root

    Hi to all,
    I just installed arch on a vaio SVS13A with EFI and dual graphics, both HD4000 and nvidia. I am having troubles running X, startx works and shows the minimal environment only if I'm running it as root, if I'm running it as a normal user only a black screen appears and nothing happens, but there are no errors in Xorg.log. What's happening?
    A thing I noticed is that if I try to run
    Xorg -configure
    it is not able to do it because it says there are two screens and only one device or something like that (I'm sorry I can't remember well but I'll check next time). Maybe Xorg is not able to find the correct screen (?) when I'm running it as normal user?
    On the laptop there's a switch between "stamina" and "speed" to enable the discrete graphics card, I'm doing everything with the graphics disabled but the nvidia card seems to be recognized corretly anyway, maybe it's only a sw thing?
    Thank you in advance!
    p.s. I searched trough the forum and google but wasn't able to find a solution to my problem.
    Last edited by Mocco (2012-07-24 13:24:23)

    I added the configuration file for the two graphic cards but startx for the normal user is still terribly slow to start and I'm not able to use gdm.
    I don't want to use both graphic cards or use nvidia optimus or something like that for now, I just want to access gnome and use X. I'm using the intel integrated graphics since it seems the other is not working (if I configure xorg to use it it's not able to run). From xorg.log it seems intel i915 module is able to recognize the card but for some reason gdm is still not working and whowing me only black screen with the clock instead of mouse cursor. To me it seems HD4000 is recognized but for some reason gdm is not working.
    The situation is: two graphic cards (intel HD4000 and nvidia) and one monitor (my laptop monitor). I'm using nouveau and intel. No Ati and no dual screen.
    Where can I find some logs in order to find the problem? daemons.log says there's a problem with dbus: no such file or directory but it seems dbus is up and running.
    Last edited by Mocco (2012-07-24 11:32:59)

  • [SOLVED]Sound works only in phonon

    Good evening,
    I'd like to know why I can hear nothing. I've tried lots of solutions, but none has worked fine. But strangely the tests in Phonon work.
    My sound cards are:
    card 0: MID [HDA Intel MID], device 3: HDMI 0 [HDMI 0]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 0: MID [HDA Intel MID], device 7: HDMI 1 [HDMI 1]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 1: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 1: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    And the one that should work is the 1,0; I can tell you that because it works in Phonon.
    - I've checked out both alsamixer and Kmix and the channels were unmuted.
    - I've tried to set the default sound card using a global asound.conf.
    - I've checked whether all modules have been loaded correctly
    - Trying to play something with aplay, the device is busy
    - In the UEFI, the audio is enabled
    The issue is always the same:
    ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave
    Playback open error: -2, No such file or directory
    I think I've written everything, I'm sorry if I haven't.
    Last edited by Grant (2013-11-24 12:30:35)

    I just had an issue with no sound after recent updates.  Not sure it's the same problem you are having. 
    I found I had to open Audio Mixer, select Sound card: HDA Intel PCH (Alsa mixer), Select Controls, check box for Speaker and check box for Headphones.  After doing this I found the Speaker volume was set at minimum (although Master and PCM were already set at maximum).  Adjusted Speaker volume up and I finally had sound again.

  • [solved] Scanner works only under sudo

    arch x86_64 / gnome 3 / Canon Pixma MP230
    scanimage -V
    scanimage (sane-backends) 1.0.24; backend version 1.0.24
    -> is OK
    scanimage -L
    device `v4l:/dev/video0' is a Noname BisonCam, NB Pro virtual device
    device `pixma:04A9175F_315075' is a CANON Canon PIXMA MP230 multi-function peripheral
    then, with
    scanimage --device pixma:04A9175F_315075 --format=tiff > test.tiff
    no work, i must kill de process
    Any Ideas? I will not work withe the Drivers from Canon, to many 32-bit Dependencies.
    Last edited by dino (2015-01-17 17:49:30)

    dino wrote:
    After I 've now got me with the problem to two nights of sleep , and customize sheer and taste of udev rules and directories get a big head , I resign myself.
    I scan about 3-5 times a week , as I can with
    sudo scanimage --device pixma:04A9175F_315075 --format=tiff > test.tiff
    and then
    xsane
    first time live well.
    Currently I'm testing nor the commercial software VueScan ( http://www.hamrick.com/ ), which has so far worked without complaint , just click this without any configuration , and sit back. If this is so , I 'm going to set the professional license for it.
    Thank you for your willingness to help in this matter , but if someone can think what we can revive the thread so happy again ...
    I had similar issues to you and also found that vuescan works fine - my previous investigation of this issue seemed for my system to point to a problem with a scanner plugged into a usb3 port where the same scanner plugged into a computer that only has usb2 worked fine.   I wonder if your scanner is plugged into a usb3 port? You might also find that plugging your scanner into a machine with only usb2 might work - this has been the subject of a bug report in the xsane scanner bug list for quite some time without a resolution yet.
    Last edited by mcloaked (2015-01-17 15:31:20)

  • Javascript function not working in template-based html files

    Does anyone have any insight as to why the following function works only in the .dwt file but not in the related html files?
    *Note: it only works in the dwt file if I change the path of:
    var imgs = new  Array('images/header1.jpg','images/header2.jpg','images/header3.jpg');
    to
    var imgs = new  Array(../'images/header1.jpg',../'images/header2.jpg',../'images/header3.jpg');
    but with the paths reading correctly (as below) in the html files it still doesn't work...
    <script type="text/javascript">
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    var imgs = new Array('images/header1.jpg','images/header2.jpg','images/header3.jpg');
    var delay = 7500;
    var counter = 0;
    function preloadImgs(){
      for(var i=0;i<imgs.length;i++){
        MM_preloadImages(imgs[i]);
    function randomImages(){
      if(counter == (imgs.length)){
        counter = 0;
      MM_swapImage('rotator', '', imgs[counter++]);
      setTimeout('randomImages()', delay);
    </script>
    </head>
    <body onLoad="preloadImgs();randomImages()">
    Any help would be appreciated!
    Andy

    Wow - now I have a real doozy for you. That duplicate function has generated itself all on its own. The script in the template file is:
    <script type="text/javascript">
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    // Comma separated list of images to rotate
    var imgs = new Array('images/header1.jpg','images/header2.jpg','images/header3.jpg');
    // delay in milliseconds between image swaps 1000 = 1 second
    var delay = 5000;
    var counter = 0;
    function preloadImgs(){
      for(var i=0;i<imgs.length;i++){
        MM_preloadImages(imgs[i]);
    function randomImages(){
      if(counter == (imgs.length)){
        counter = 0;
      MM_swapImage('rotator', '', imgs[counter++]);
      setTimeout('randomImages()', delay);
    </script>
    As you can see - no duplication.
    For some inexplicable reason, this is being added in to all the html pages based on the template:
    MM_swapImage('rotator', '', imgs[counter++]imgs[i]);
    function randomImages(){
      if(counter == (imgs.length)){
        counter = 0;
    Which explains why it works in the template file but not in any the html files. Of course, because the code is not in an editable region, I can't remove it manually from the html files. Have you ever heard of code generating itself in this manner? Or how to solve it?

  • Cannot compile source file with Ctrl-F7 in VS 2008

    I have added an existing .cpp file to my project.  When I want to compile
    only one file, I usually press Ctrl-F7, but that does not work on this file (it works on some other source files).  When I pull down the Build menu, the Compile option is missing, like it is when a header
    (*.h) file is active.
    When I right-click on the source file in the Solution Explorer, the context menu shows "Compile\tCtrl+F7"; I can compile a single source file that way, but Ctrl-F7 is so much easier and faster.
    I have tried resetting the keyboard shortcut, resetting the profile to the original C/C++ profile, and closing and reopening Visual Studio, but nothing corrected the issue.
    It feels like VS is not recognizing that my source file is a C++ file, despite its name (something.cpp).  Why has this started happening, and how can I get the shortcut (and Build menu) to reset?

    This happens in the following way.  You manually create a new C++ class in an existing project using the editor in VC++.  You then (with the editor still open) add the file to your project.  Visual Studio finds your class info
    and adds it intellisense, making it seem as though VC++ knows your file is in the project.  However, it does not and ctrl f7 will therefore not work.  Removing and adding the file does not help...unless you close the editor window...in which
    case VC++ will correctly add the file if you remove and add it to your project.
    This is not an uncommon way to create a new class - one does not always use the VC++ create class option.  The manual creation method may be preferable if you are not using automated features from VC++ and instead want to copy some code
    from another file, headers for example.   My view is that this is a VC++ bug that should be repaired; apparently VC++ thinks the file is already included if it is open in the editor rather than checking its file list.  But it is easy
    to work around once you know what is happening.

  • Parser converting java source file

    I want to build a parser, which reads a java source and adds stubs at the start and end of a method, which might be for a public/protected/private method.
    This public/protected/private keyowrd , and source file will be passed as command line arguments to the parser.
    The generated output java source file should be similar to input source file with stubs.
    For example , we have a java source file( A.java) file as specified below
    class A{
         public m1(int m1_a, int m1_b){  }
         protected m2(int m2_x, int m2_y){ }
         private m3(int m3_p, int m3_q) {  }
    parser public A.java;
    after parsing it should generate output source file as A.JAVA as specified below
    class A{
         public m1(int m1_a, int m1_b)
    {  System.out.println(" start of "A:m1"" +  time: +"parameters:" +" a="+a ," b="+b)
         System.out.println(" End of "A:m1"" + time: +"parameters:" +" a="+a ," b="+b)
         protected m2(int m2_x, int m2_y){ }
         private m3(int m3_p, int m3_q) {  }
    Are there any tools , example programs , tips on the above problem .
    Anticipating help at the earliest

    HI dcminter,
    I am not talking about performance tuning,
    I need to build a program ( tool) which add System.out.println() statements as specified above for specific methods ( which might be public/private/protected ) which will be passed to the parser along with the java source text file.
    This program(tool)should only convert from one java source text file (A.java) to another java source text (A.JAVA) file , by adding the extra System.out.println() statements.
    Please help in this regard about any sample or tool or tips in solving.
    Awaiting for ur reply
    --gvr123                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Assessing Command 'Analyze Source Files' via Command Line when running TestSTand Deployment Utility

    Our Software Configuration Manager is running the TestStand Command Line Deployment Build Tool (Ref: https://decibel.ni.com/content/docs/DOC-38947).
            When he builds the application,  the code will not be at the same location it was in development. 
    If you are Manually running the TestStand Deployment Utility, This is not a problem because everything is relative in the workspace.   Simply go to the Distributed Files Tab (of TestSTand Deployment Utility) and hit the, "Analyze Source Files" button.  This finds the required files and apparently creates an updated hard path to be used during the build (probably in the *.tsd).
    PROBLEM:  We auto-run the Command Line Deployment Build Tool (Command Line), and we do not have access to the, 'Analyze Source Files' command.
                As a result, our build consist of many warnings and the output is missing many files (the location of the files have not been updated).
    If we could access the 'Analyze Source Files' Command via command line, that would fix the issue. 
    FYI:  We use an automatic builder called Quick Build as our builder.
    Attachments:
    TestSTand Deployment Utility-Distributed Files Tab.PNG ‏76 KB

    Unfortunately it looks like Analyze Source Files does not have a command equivalent for the command line based on this article and attached PDF:
    https://decibel.ni.com/content/docs/DOC-38947
    That may be a good post for the TestStand Idea Exchange for consideration in future versions of TestStand.
    Michael K.

  • [SOLVED] Can't save UTF-8 encoded source file in IDE

    I had a problem where I could not save a c++ source file from anjuta using the gtksourceview plugin, but could using the scintilla plugin.  I would get an error message with "invalid byte sequence in conversion input" in the text.  Eclipse CDT also would not save a modified file with a similar error message.
    The fix was to uncomment the proper lines in the file /etc/locale.gen for my locale and run locale-gen as described in the Archlinux wiki article "Configuring locales."
    I did not find any help for this problem using internet searches, so I thought I would document it here.  Just in case someone else fails to setup their locale and runs into the same trouble.

    I think so (haven't checked), but it is a really simple test xml which is not really error prone).
    But the problem is a different one, because I also just tried to read a txt file with some Japanese characters into an NSString using initWithContentsOfURL.
    When I print the string in the console, I only get messed up characters (the latin characters next to the Japanese are displayed fine).
    It is a general problem of reading out an UTF-8 file from an url.
    Spent the whole last night to google something helpful but couldn't find anything. Now I'm tired at work
    Thomas

  • Why we can have only one public class in one source file

    why we can have only one public class in one source file

    When the java compiler is run it looks for classes referenced by the classes you are directly compiling. When looking for these referenced classes it looks for source as well as class files and compiles them automatically if the coresponding class files are missing, or older than the source.
    In order to do this it must be able to work out the source file name for any given class which might be referenced from another (the rule also applies to package level access).

  • Whenever i try to download a rather large file i continue to get the "could not read source file" error. Tried new profile, uninstalling and looking for the compreg.dat file to delete nothing is working. Please help

    whenever i try to download a rather large file i continue to get the "could not read source file" error. Tried new profile, uninstalling and looking for the compreg.dat file to delete nothing is working. Please help

    Did you reinstall CS3 after CC?
    For that matter, doing an in-place upgrade on the OS is always a gamble with Adobe programs. Reinstalling all the versions you need, in order, would probably solve your problem.
    And you shouldn't need to save as IDML after opening the .inx in CC.

  • Analyze Source Files works not properly

    Hello everybody,
    I want to deploy a TS sequence with TS 4.0.
    The sequence includes both CVI and LabView modules.
    The first time I deployed the system (from a TS Workspace file), the "Analyze Source Files" tool identified correctly the VI used by the sequence, and added them to the files to distribute. 
    The deployment was successfully generated, and I saved the configuration (.tsd).
    Then I modified my sequence adding a VI which wasn't previously used.
    When I tried to deploy the system again (with the configuration saved previously), I noticed that the "Analyze Source Files" didn't add the new VI. (Remark: I saved the sequence and the workspace before start the deployment tool)
    Is there something wrong in my LabView Options settings? (I didn't modify the default settings).
    Note:
    The VIs mentioned are from an agilent driver library downloaded by NI site.
    Any help would be appreciated
    Thank you
    Baloss

    Hi Johann,
    thank you for your suggestions. Sorry for my late answer but I take some sunny week holidays...
    Meanwhile my collegue (working on the same project) has decided to replace the VI agilent driver with the corresponding CVI code.
    Now everything works fine, but of course the TS only call CVI modules.
    About new installation: we worked with the same PC, deinstalling the code with Windows tools ("Control Panel"-> "Add or Remove SW")
    Thank you
    baloss

  • How can multiple users work on one source file?

    Hi There,
    I'm currently working on a project that I would like to hand-off to another person to finish. I've tried sending the source file located in at: Home>Movie>iMovie Projects but apparently that doesn't work as the second user is unable to work on the project.
    Is this achievable? If so, how?
    Thank you in advance for any help! It's greatly appreciated =)

    For iMovie 09, you:
    You have to plug in an external drive, and within iMovie, drag the project file to the external drive. It will ask you if you want to "copy project" or "copy project and events".
    If you want to move the project and not just make a copy, then hold down the Command key while you drag the project file to the external drive.
    iMovie 08 does not have the capability of having project files on the external drive, but you can try to manually copy it to the external drive with the finder, and then move the associated events +from within iMovie+ (critical for the other machine to find the files) and when copying the project file to the other computer, it would be critical to find the iMovie project folder in the Movies folder and put it in exactly the same place on the other machine. Otherwise iMovie won't find it.
    The way you want to use it, iLife09 might be worth the upgrade, especially if my suggestions don't work.

  • Working with Outlook 2011 for Mac, my mails are slow and I can work only on-line, when off-line, mail cannot be opened because it is only partially downloaded. How to solve??

    working with Outlook 2011 for Mac, my mails are slow and I can work only on-line, when off-line, mail cannot be opened because it is only partially downloaded. How to solve??

    Try http://www.microsoft.com/mac/support.

Maybe you are looking for