Find the answer to your Linux question:
Results 1 to 4 of 4
I'm trying this out with a shell script - to download rpms from below link,i used this, wget http://archive.nl.eu.kernel.org/fedo...s/Fedora/*.rpm it says "wildcards are not allowed" any thoughts about how to ...
  1. #1
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568

    Exclamation how to download rpms from website using shell script ?

    I'm trying this out with a shell script - to download rpms from below link,i used this,

    it says "wildcards are not allowed"

    any thoughts about how to download rpms using shell scripts?
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  2. #2
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    665
    for this one instance, I believe everything in that directory is an RPM, so just

    Code:
    wget -r http://archive.nl.eu.kernel.org/fedora-archive/releases/7/Fedora/i386/os/Fedora
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

  3. #3
    Linux Newbie imranka's Avatar
    Join Date
    Dec 2007
    Location
    Kolkata
    Posts
    177
    From wget manual 1.11.3:

    `accept = acclist'
    The argument to `--accept' option is a list of file suffixes or patterns that Wget
    will download during recursive retrieval. A suffix is the ending part of a fi le, and
    consists of \normal" letters, e.g. `gif' or `.jpg'. A matching pattern contains
    shell-like wildcards, e.g. `books*' or `zelazny*196[0-9]*'.

    So, specifying `wget -A gif,jpg' will make Wget download only the les end-
    ing with `gif' or `jpg', i.e. gifs and jpegs. On the other hand, `wget -A
    "zelazny*196[0-9]*"' will download only files beginning with `zelazny' and con-
    taining numbers from 1960 to 1969 anywhere within. Look up the manual of your
    shell for a description of how pattern matching works.

    Of course, any number of suffixes and patterns can be combined into a comma-
    separated list, and given as an argument to `-A'.
    So, you can do
    Code:
    wget -r -A.rpm -N http://archive.nl.eu.kernel.org/fedora-archive/releases/7/Fedora/i386/os/Fedora
    Imran
    Linux User #467555 | Debian Squeeze | Intel(R) Core(TM)2 Duo CPU 4500 @ 2.20GHz | Gigabyte GA-G41MT-ES2L
    | 2 GB RAM | 320 GB SATA | Kernel: 2.6.32-5-686

  4. #4
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568

    Smile

    thanks guyz .... here is another question, I need to download few packages (just download them -- don't want to install )

    i need to download specific package along with it's dependency.(for example download zsh and zlib-devel along with their dependencies)

    I have a file with required rpms :
    $cat listofrpms.txt
    zsh-4.2.6-6.fc7.i386.rpm
    zlib-devel-1.2.3-10.fc7.i386.rpm
    Shell script to download the required files:

    URLS="http://archive.nl.eu.kernel.org/fedora-archive/releases/7/Fedora/i386/os/Fedora/zlib-devel-1.2.3-10.fc7.i386.rpm
    http://archive.nl.eu.kernel.org/fedora-archive/releases/7/Fedora/i386/os/Fedora/zsh-4.2.6-6.fc7.i386.rpm"
    for pkg in $URLS;
    do
    echo "downloading...$pkg"
    wget $pkg;
    done

    Shell script-2 to display the dependencies of a package:
    while read line
    do
    echo -e "RPM:::: $line \n"
    rpm -pqR $line
    sleep 1;
    done <listofrpms.txt
    Now how to integrate these pieces to make the final shell script that downloads required rpms (as specified in
    listofrpms.txt file) along with its dependencies?

    I came across "yum with downloadonly" plugin does that download dependencies too?

    I'm trying it out -- if you know any solution for this new requirement, please let me know.
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...