[SOLVED] Check for Dependencies

Hey, I'm trying to write a script that'll check for dependencies to install and build something. I can check to see if the file exists but that seems kind of brute force. I'm trying to use
pacman -Q
but I can't get it quite right.
Example:
DEPS="python2-setuptools git curl wget"
if ( sudo pacman -Q $DEPS >/dev/null ) ; then
echo "Deps not installed, installing now"
sudo pacman -S $DEPS
else
echo "Dependencies met."
fi
But this always returns that DEPS aren't installed and prompts to reinstall.
Last edited by 0X1A (2013-10-03 18:55:03)

kaszak696 wrote:
Direct fix of your code would look like this:
#!/bin/bash
DEPS="python2-setuptools git curl wget"
pacman -Q $DEPS &> /dev/null
if [ $? -ne 0 ] ; then
echo "Deps not installed, installing now"
sudo pacman -S $DEPS
else
echo "Dependencies met."
fi
, but as pointed above, it's not the best approach, what exactly are you trying to accomplish?
This works, but still prompts for re-installation. I'm just trying to see if the user has those packages installed and if not then install them.

Similar Messages

  • [SOLVED] Check for old configuration files and directories in ~/

    Hello,
    Since I started with Arch I tried and uninstalled a few programs and would like to check for possible left overs in ~/
    I tried the "lostfiles" script, but it does not seem to check the home directory. Then I followed this: https://wiki.archlinux.org/index.php/Pa … ny_package - But using the suggested alias in my bash, it gives me the below:
    $ pacman-disowned-files
    [sudo] password for [my user]:
    bash: -path: command not found
    bash: /root: Is a directory
    bash: -print: command not found
    What am I doing wrong?
    Regards
    Martin
    Last edited by onslow77 (2015-02-04 23:52:44)

    Hello,
    ohh, I see, I need to do this (in directory where I put the script)
    sh pacman-disowned -files > test.txt
    That solved the usage of the commands, but it does not however list files [in the test.txt file] that do not belong to any package in my ~/ directory (I put a dummy file in my ~/ to see if it got noticed) - but it did not. So how can I list files and directories in my ~/ directory that is not put there by any package that currently is installed?
    Regards
    Martin
    Last edited by onslow77 (2015-02-04 22:49:11)

  • [Solved] checking for makeinfo... no

    I'm trying to install stumpwm-git but it complain about installing makeinfo. I have other packages like automake installed and I tried reinstalling my kernel-headers, but I don't know how to install makeinfo.
    Last edited by shadeheim (2007-10-28 12:06:08)

    make-info is in AUR. Hope this helps:
    http://aur.archlinux.org/packages.php?d … ns=&SeB=nd

  • Does Pacman Have A Command To Check For Left Over Dependencies?

    Does pacman have a command to check for left over dependencies?
    I know that when you remove something it's checking for dependencies and I've seen it show these before, but I swear I removed something that had dependencies and it don't show any and just removed only the single program.
    So basically I wanted to know if there are any pacman cmds like this to check the system with and clean it up?
    THANKS
    P.S. I didn't notice anything like this in the Wiki, only for cleaning out the cache....

    jasonwryan wrote:
    DasFox wrote:One I was reading the Wiki and I overlooked the information.
    I saw no evidence of that: you might have mentioned it in your post...
    Also I'm not your noob or your boy, I'm a middle age man that's been using Linux 10 years, running a Slack box most packages and kernel all custom compiled only running OpenBox...
    So next time you want to start telling people to do the basic research before posting, stop and think that maybe they've done it already.
    Again, there was no evidence of you having done any research: without evidence there is no reason to assume what the observed behaviour contradicts...
    So I've RTFM, just be careful with your choice of words and attitude, being the MOD doesn't give you rights to SPIT on people!
    Your perception about being insulted is your own - my post contains nothing insulting or offensive, just a very clear answer to your question.
    P.S. And if you were being nice in your odd sort of way I also don't appreciate it, because when we gone out and done the research and overlooked something we have every right to come here and ask and not be told like you've done.
    You have every right to ask questions; we have every right to insist that you follow the Forum Etiquette when doing so: https://wiki.archlinux.org/index.php/Fo … ow_to_Post
    No you didn't reply which you could of simply done, or asked if I read the Wiki which would of been the proper thing, not telling me to RTFM!
    I'm like this at times because I've seen it all to often....
    Next time before telling someone, ask them, in case they forget to mention it to you...
    Anyhow let's move on....
    P.S. So I can remove those packages without a problem?
    Last edited by DasFox (2010-11-26 06:16:08)

  • When i connect my ipad2 to iTune, it show "iTunes could not check for an update to the carrier settings for your iPad. An unknown error occured (1651)". What should i do to solve this problem? My iTune version is 10.1.4.10 and my ipad is 4.3.5.

    When i connect my ipad2 to iTune, it show "iTunes could not check for an update to the carrier settings for your iPad. An unknown error occured (1651)". What should i do to solve this problem? My iTune version is 10.1.4.10 and my ipad is 4.3.5.

    If you have iOS 7.1 then you must be a developer, so you should be posting in the developer forums : https://devforums.apple.com/index.jspa

  • My MacKeeper says iPhoto is out of date.  When I try to update the App Store says I need IOS 10.9 or later.  I have 10.7.5 and when I check for updates my Mac says the software is up to date.  How do I solve this problem??

    My MacKeeper says iPhoto is out of date.  When I try to update it, the App Store says I need IOS 10.9 or later.  I have 10.7.5 and when I check for updates my Mac says the OS software is up to date.  How do I solve this problem??

    1. First step to solving the Problem: Trash MacKeeper. It's a pile of trash that does far more harm to your computer than good.
    https://discussions.apple.com/docs/DOC-3691
    2. What version of iPhoto do you have? (iPhoto Menu -> About iPhoto)

  • [Solved] Makepkg hanging on checking runtime dependencies.

    Hey guys, as above really.
    Recently I've been having problems with makepkg and installing from AUR. It seems to fetch dependencies from the official repositories fine, but when makepkg goes to compile the PKGBUILD, it hangs at '==> checking runtime dependencies'.
    I've checked htop and I've a yaourt process running like:
    /bin/bash /usr/bin/yaourt -T gtk-perl
    the process is using around 40% CPU and even if I leave it running for a while, nothing happens.
    I've made no system changes (besides changing http to https in the yaourt config to stop the 301 error after AUR came out of maintenance https://bbs.archlinux.org/viewtopic.php?pid=1182722) since this started happening so I'm pretty stumped to what it could be.
    Any ideas?
    edit: It works if I run as root, strange, but not ideal.
    Last edited by dunks (2012-10-28 01:38:46)

    I do not use yaourt.  We have been having issues with the AUR server over the last couple days.  It is back up now on a new server, but there were issues relating to that move.  Does this thread have any bearing on the issue?
    Edit: Never mind.  I am distracted and get low scores for comprehension today
    Last edited by ewaller (2012-10-27 23:14:57)

  • [solved] pacman 4 hangs after "checking for file conflicts"

    Like others, I removed yaourt and package-query because they conflicted with pacman4... not worried about that, I'll reinstall them later.
    I put the new pacman.conf in place (my old one wasn't really customized).  I left SigLevel = Never.
    Now, I can run pacman -Sy fine, but if I try to install anything, I it just hangs:
    sudo pacman -S audacity
    resolving dependencies...
    looking for inter-conflicts...
    Targets (1): audacity-1.3.14-2
    Total Download Size: 3.21 MiB
    Total Installed Size: 15.29 MiB
    Net Upgrade Size: -0.00 MiB
    Proceed with installation? [Y/n]
    :: Retrieving packages from extra...
    audacity-1.3.14-2-x86_64 3.2 MiB 1397K/s 00:02 [###########################] 100%
    (1/1) checking package integrity [###########################] 100%
    (1/1) loading package files [###########################] 100%
    (1/1) checking for file conflicts [###########################] 100%
    I've waited up to 20 or 30 minutes and nothing happens.  It's not just audacity, any package I try to install does this.
    Suggestions?
    Last edited by TheAmigo (2012-01-17 18:55:38)

    With --debug switch it prints:
    checking for file conflicts...
    debug: looking for file conflicts
    debug: searching for file conflicts: coreutils
    debug: searching for filesystem conflicts: coreutils
    debug: searching for file conflicts: ethtool
    debug: searching for filesystem conflicts: ethtool
    debug: searching for file conflicts: fail2ban
    debug: searching for filesystem conflicts: fail2ban
    debug: searching for file conflicts: gpgme
    debug: searching for filesystem conflicts: gpgme
    debug: searching for file conflicts: vim-runtime
    debug: searching for filesystem conflicts: vim-runtime
    debug: searching for file conflicts: gvim
    debug: searching for filesystem conflicts: gvim
    debug: searching for file conflicts: hdparm
    debug: searching for filesystem conflicts: hdparm
    debug: searching for file conflicts: inetutils
    debug: searching for filesystem conflicts: inetutils
    debug: searching for file conflicts: lib32-glibc
    debug: searching for filesystem conflicts: lib32-glibc
    debug: searching for file conflicts: lib32-gcc-libs
    debug: searching for filesystem conflicts: lib32-gcc-libs
    debug: searching for file conflicts: lib32-glib2
    debug: searching for filesystem conflicts: lib32-glib2
    debug: searching for file conflicts: lib32-gdk-pixbuf2
    debug: searching for filesystem conflicts: lib32-gdk-pixbuf2
    debug: searching for file conflicts: lib32-pango
    debug: searching for filesystem conflicts: lib32-pango
    debug: searching for file conflicts: lib32-gtk2
    debug: searching for filesystem conflicts: lib32-gtk2
    debug: searching for file conflicts: linux
    debug: searching for filesystem conflicts: linux
    debug: searching for file conflicts: nspluginwrapper
    debug: searching for filesystem conflicts: nspluginwrapper
    debug: searching for file conflicts: nvidia
    debug: searching for filesystem conflicts: nvidia
    debug: searching for file conflicts: qtwebkit
    debug: searching for filesystem conflicts: qtwebkit
    debug: searching for file conflicts: rpcbind
    debug: searching for filesystem conflicts: rpcbind
    debug: searching for file conflicts: unrar
    debug: searching for filesystem conflicts: unrar
    debug: searching for file conflicts: xscreensaver
    debug: searching for filesystem conflicts: xscreensaver
    checking available disk space...
    debug: checking available disk space
    Without the --debug switch
    Proceed with installation? [Y/n]
    (21/21) checking package integrity [############################] 100%
    (21/21) loading package files [############################] 100%
    (21/21) checking for file conflicts [############################] 100%
    Note that the 'checking available disk space...' is not printed without the --debug option although it doesn't look like being 'debug output'.
    I don't see much disk activity after that and the pacman process uses no CPU time and the process status goes to D in `ps` (man ps says: D: Uninterruptible sleep (usually IO)).
    Last edited by drrossum (2012-01-18 21:58:28)

  • [solved] "pacman -Syu" hangs after "checking for file conflicts"

    This is my third attempt.  I let it run yesterday for 20 hours on the theory that maybe it was actually doing something.  It always completes "checking for file conflicts" but never goes any further.
    Does anyone have any suggestions how to get it to continue?
    [ken@xxxxx ~]$ sudo pacman -Syu
    :: Synchronizing package databases...
    core is up to date
    extra 1421.6 KiB 2.03M/s 00:01 [######################] 100%
    community 1775.0 KiB 3.00M/s 00:01 [######################] 100%
    :: Starting full system upgrade...
    resolving dependencies...
    looking for inter-conflicts...
    Targets (27): binutils-2.23-1 coreutils-8.20-1 cryptsetup-1.5.1-1
    device-mapper-2.02.98-1 emacs-24.2-2 filesystem-2012.10-2
    firefox-16.0.2-1 gcc-4.7.2-2 gcc-libs-4.7.2-2 glibc-2.16.0-5
    hwids-20121022-1 imagemagick-6.8.0.3-1 libidn-1.25-1
    libwbclient-3.6.9-1 linux-api-headers-3.6.3-1 lvm2-2.02.98-1
    mkinitcpio-0.11.0-1 nspr-4.9.3-1 nss-3.14-1
    nss-myhostname-0.3-3 smbclient-3.6.9-1 systemd-195-2
    thunderbird-16.0.2-1 tzdata-2012h-1 util-linux-2.22.1-2
    wget-1.14-2 xulrunner-16.0.2-1
    Total Download Size: 47.80 MiB
    Total Installed Size: 550.57 MiB
    Net Upgrade Size: 6.43 MiB
    Proceed with installation? [Y/n] y
    :: Retrieving packages from extra...
    libwbclient-3.6.9-1... 19.5 KiB 407K/s 00:00 [######################] 100%
    smbclient-3.6.9-1-x... 7.9 MiB 2.71M/s 00:03 [######################] 100%
    thunderbird-16.0.2-... 17.1 MiB 2.92M/s 00:06 [######################] 100%
    xulrunner-16.0.2-1-... 22.9 MiB 2.92M/s 00:08 [######################] 100%
    (27/27) checking package integrity [######################] 100%
    (27/27) loading package files [######################] 100%
    (27/27) checking for file conflicts [######################] 100%
    Last edited by KenJackson (2012-10-30 14:25:05)

    Allan wrote:Can you run with --debug?
    OK.  That garnered an additional piece of info.  Here's the end of the long output:
    debug: searching for filesystem conflicts: wget
    debug: searching for file conflicts: xulrunner
    debug: searching for filesystem conflicts: xulrunner
    checking available disk space...
    debug: checking available disk space
    Disk space?  I think I have enough disk space.
    [ken@xxxxx ~]$ df
    Filesystem Size Used Avail Use% Mounted on
    rootfs 47G 11G 34G 25% /
    dev 2.0G 0 2.0G 0% /dev
    run 2.0G 292K 2.0G 1% /run
    /dev/sda3 47G 11G 34G 25% /
    shm 2.0G 140K 2.0G 1% /dev/shm
    /dev/sda1 99M 21M 74M 22% /boot
    /dev/sda4 72G 1.9G 66G 3% /home
    Is disk space really the problem?  Or is that just where it hung?

  • (solved)-Windows update cannot currently check for updates, because the service is not running. You may need to restart your computer

    (solved)-Windows update cannot currently check for updates, because the service is not running. You may need to restart your computer
    Hetti Arachchige V Aravinda | Network Administrator (B.Sc, MCP, MCTS, MCSA, MCSE, MCITP, CCNA, CEH, MBCS)| http://www.windowstechinfo.com |

    Hi,
    Glad to see your problem resolved, Hope your experience is helpful with others.
    Roger Lu
    TechNet Community Support

  • Spell checker for KWrite doesn't work [SOLVED]

    How do I enable spell checking for the KDE editors, i.e. KWrite, Kate, etc?  I've installed aspell via pacman, it's in /usr/bin which is in my PATH.  In KWrite's Settings>Configure Editor>Plugins, there is an option "KTextEditor KDataTool Plugin: Enable data tools like thesaurus and spell check (if installed)" which I've checked.  In another distro, that's how I enabled spell checking with aspell, i.e. by checking this box for the spell check plugin.  But in Arch this doesn't seem to be sufficient.  When I try to spell check a document in KWrite, I get this error:
    "The spelling program could not be started. Please make sure you have set the correct spelling program and that it is properly configured and in your PATH."
    What else do I need to do?
    Robert
    EDIT: Sorry, searching this forum for "spellcheck" hadn't yielded any solution but after I posted this I also searched for "spell AND check" and found the solution: I had neglected to pick Aspell as the client for spell checking in Control Center>KDE Components>Spell Checker.
    Last edited by RobF (2007-06-10 18:10:36)

    [skottish@localhost ~]$ grep -i spell ~/.kde/share/config/*
    /home/skottish/.kde/share/config/kdeglobals:[KSpell]
    /home/skottish/.kde/share/config/kdeglobals:KSpell_Client=1
    /home/skottish/.kde/share/config/kdeglobals:KSpell_DictFromList=1
    /home/skottish/.kde/share/config/kdeglobals:KSpell_Dictionary=
    /home/skottish/.kde/share/config/kdeglobals:KSpell_Encoding=0
    /home/skottish/.kde/share/config/kdeglobals:KSpell_NoRootAffix=0
    /home/skottish/.kde/share/config/kdeglobals:KSpell_RunTogether=0
    /home/skottish/.kde/share/config/kdeglobals418fla.new:[KSpell]
    /home/skottish/.kde/share/config/kdeglobals418fla.new:KSpell_Client=1
    /home/skottish/.kde/share/config/kdeglobals418fla.new:KSpell_DictFromList=1
    /home/skottish/.kde/share/config/kdeglobals418fla.new:KSpell_Dictionary=
    /home/skottish/.kde/share/config/kdeglobals418fla.new:KSpell_Encoding=0
    /home/skottish/.kde/share/config/kdeglobals418fla.new:KSpell_NoRootAffix=0
    /home/skottish/.kde/share/config/kdeglobals418fla.new:KSpell_RunTogether=0
    /home/skottish/.kde/share/config/kdictrc:Strategies=Spell Check,Exact,Prefix
    /home/skottish/.kde/share/config/kofficerc:[Spelling]
    /home/skottish/.kde/share/config/kookarc:[ocrSpellSettings]
    /home/skottish/.kde/share/config/kookarc:ocrKSpellEnabled=true
    /home/skottish/.kde/share/config/kwordrc:[Spelling]

  • Won't stop checking for mail!!! *fixed but not solved*

    Hey all, my iPod touch is stuck in a weird way. It's working fine in every aspect except it will not stop "checking for mail". It's been in that mode for about 10 hours now, it isn't' receiving mail, just got the little spinning wheel and saying "checking for mail". I even have the wi-fi turned off!
    It appears to be wearing my battering down much faster and I have tried everything I can think of, connected it to my mac, synced content, turned off wi-fi.
    Does anyone know of anything else I can do?
    Thanks in advance,
    Stephen
    EDIT: Forget it, tried turning it off and on and that fixed it. Sorry I didn't try that first...
    Still have no idea why it happened though...
    Message was edited by: halcyonseven

    Thanks so much for your reply!
    I should have also mentioned that I've deleted the account, did a reset, and even a restore (at apple's suggestion) and nothing has helped.  I just finished reentering all the account info after the restore and it still has the "checking for mail wheel spinning". I have 15 iPads in this office and haven't had an issue with any of them expect this one.
    It also has the "Load More Messages..." 29 messages total, 0 unread - at the bottom of the inbox, but it won't let me select it or "load" any more messages.  It does send and receive emails just fine though.  Slow, but fine.
    Any other thoughts?!

  • Check for empty visa resource?

    When I am developing the VI at my desk and not a the test station PC, the VISA resource name is empty.
    Once the VI is moved to the test station PC, the user can select a VXI board.
    How do I make sure the user has selected a VISA resource before continuing?
    I can wire a Comparision to check for Empty String, and that works. But is there any method that I should use?
    Solved!
    Go to Solution.

    Additionally, you can limit the selectable items by interface type. Right-click VISA Resource Name Control and select I/O Name Filtering.
    National Instruments
    Product Support Engineer

  • FireFox 3.6.8 & ThunderBird 3.1.2 check for updates never connects, nor does plug-in update or get plug-ins

    FireFox 3.6.8 & ThunderBird 3.1.2 check for updates never connects, nor does plug-in update or get plug-ins
    I am doing several re-installs.
    I installed FireFox 3.6.8 and ThunderBird 3.1.2 on a fresh install of Windows XP Home SP3 x32.
    All Windows updates and IE8, etc were done first after the WinXP install.
    IE8 works fine.
    Firefox can connect to the internet to view webpages, but NOT do a check for a newer version.
    (by going, on the main menu at the top, to Help --> Check for updates...)
    Neither can Tbird.
    See screenshots below.
    Neither Tbird nor Firefox will complete the add-ons check nor updates nor 'Browse All Add-ons' feature.
    (by going, on the main menu at the top, to Tools --> Add-ons --> Get Add-ons {upper left} or Find Updates {lower right for any of the selections})
    Another computer, same 'build' (different hardware, but WinXP SP3, etc) using a connection from the same router going out to the internet works fine, so it is not an overall connection problem outside of the individually affected computer.
    There is not yet any anti-virus nor firewall, etc installed that could be blocking things, except for Windows built in firewall, and there is no blocking action showing. Disabling it did not solve the issue.
    6 hours of searching has not found an answer. Trying some of the search results just to see has not proven to be successful.
    Thanks.

    dianej,
    Try this, go to tools, add-ons, extensions. if you have more than one (the latest) Java consoles, uninstall them. You only need the latest console and it should match the Java Platform in Plugins.
    I had a VERY similar problem displaying weatherunderground. It would not display the pages correctly and I would get pages of errors that stated
    "window.addEvent is not a function" I spent the last two hours fixing this problem. All I did was remove the 6.0.18, 6.0.19, 6.0.20 Java consoles from my 3.6.8 Firefox. After a FF restart, no more errors.
    There should be more information in FF when you update Java. No one tells you that you should go in and delete the older consoles.
    Good luck
    Mick

  • I can't seem to download anything on my iTunes when I use Check for available downloads. I have preorders that I can't download cos it just says 'iTunes store temporarily unavailable' even tho when I actually go on iTunes itself it work fine..

    I've been in contact with Apple support team regarding this issue. I have about 9 items available for download(preorders mostly) but it's not listed under download. When I click on Check for available download, a message with 'iTunes temporarily unavailable' appears but when I go to the iTunes store itself, its working just fine. I've already been charged twice for the same movie which Apple have kindly refunded me for one of them but I still haven't managed to download that movie yet. Apple says its a problem with my computer and given me all sort of ways to rectify the issue and still no hope. Everything else seems to work just fine including the actual iTunes store, wifi syncing and cable syncing etc. Can somebody help me with this if you know how to solve this problem or if you've had the same issue now or before?
    I am using the latest Software updates on my iTunes and these 9 items were purchased whilst on this new updates

    Launch iTunes on your computer.
    From the menu bar click iTunes > Preferences then select the Advanced tab.
    Click Reset warnings and Reset cache
    Click OK.
    Restart your computer, launch iTunes.
    Click Store > Check for Available Downloads...

Maybe you are looking for

  • Customer due date analaysis report

    Hi In customer due date analysis report S_ALR_87012068 figures are different from customer local currency report.  In vendors due date analysis report figures matches with vendor local currency figures. But some different amount is showing in custome

  • I can't get home sharing to work on my new computer

    I just got a new computer I turn on home sharing but it does not work.

  • My ipod nano goes into sleep mode automatically and the music pauses

    Hi, The music on my Ipod Nano 6th, automatically stops after a minute. I have to go to the sleep/wake up button, then press play to start the music again. Is there any way to stop this. Is this happening because I have activated the watch on my home

  • Export mide files

    I have a session whith Au instruments. I want export midi file. When I import again exported midi file logic place each regions which stand in one track to many tracks. I have many many tracks thith one region on them. I shood to glue all regions on

  • Flash Navigation Problem

    http://www.pccadv.com/flashdemoexternal/b2b/ I'm having trouble getting the round circle (with numbers in them) buttons to navigate correctly. It doesn't happen all the time, but enough to make it an issue. The user might watch one of the chapters un