Page 1 of 3 123 LastLast
Results 1 to 10 of 25

Thread: wget command help to download packages from mirror

  1. #1
    Join Date
    Oct 2009
    Location
    Dhaka,Bangladesh
    Posts
    251

    Default wget command help to download packages from mirror

    Index of /distribution/openSUSE-stable/repo/oss/suse/i586

    How can i download packages with wget from that mirror with a string "alsa"?
    Such as:
    alsa-1.0.23-2.12.i586.rpm
    alsa-devel-1.0.23-2.12.i586.rpm
    alsa-oss-1.0.17-29.2.i586.rpm

  2. #2

    Default Re: wget command help to download packages from mirror

    wget http://download.opensuse.org/distribution/openSUSE-stable/repo/oss/suse/i586/{alsa-1.0.23-2.12,alsa-devel-1.0.23-2.12,alsa-oss-1.0.17-29.2}.i586.rpm

  3. #3

    Default Re: wget command help to download packages from mirror

    The simple answer is:
    wget http://download.opensuse.org/distrib...-2.12.i586.rpm

    I'm guessing what you are really after is an automated way to parse the whole repo via http and wget them? In that case, you could use curl, then parse the output and feed the result set you want into wget with a for loop in bash.

    Lews Therin

  4. #4
    Join Date
    Oct 2009
    Location
    Dhaka,Bangladesh
    Posts
    251

    Default Re: wget command help to download packages from mirror

    Not manually downloading packages.
    But i'm trying to download packages that has a string/word "alsa".
    wget will automatically download those packages.

    How can it be done?

  5. #5

    Default Re: wget command help to download packages from mirror

    Code:
    for pkg in $(wget -O - http://download.opensuse.org/distribution/openSUSE-stable/repo/oss/suse/i586/ | sed -n '/alsa/s|.*href="\(.*\)\(.i586.rpm\).*|\1\2|p') ; do
        wget http://download.opensuse.org/distribution/openSUSE-stable/repo/oss/suse/i586/$pkg 
    done
    It works ... but that might be possible to do it just with wget command line.
    man wget

  6. #6
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: wget command help to download packages from mirror

    colao wrote:
    > How can i download packages with wget from that mirror with a string
    > "alsa"?


    does man wget not help?

    does the following not work? did you try it?

    Code:
    wget [option] [URL]/*alsa*
    is this homework?

    --
    DenverD
    CAVEAT: http://is.gd/bpoMD [posted via NNTP w/openSUSE 10.3]

  7. #7
    Join Date
    Mar 2009
    Location
    sri mayapur, west bengal, india
    Posts
    958

    Default Re: wget command help to download packages from mirror

    On Tue, 30 Nov 2010 19:36:03 +0530, colao
    <colao@no-mx.forums.opensuse.org> wrote:

    >
    > Not manually downloading packages.
    > But i'm trying to download packages that has a string/word "alsa".
    > wget will automatically download those packages.
    >
    > How can it be done?
    >


    you can tell wget to download files according to regex. i did this once
    for images, but don't remember the syntax. instead of me looking this up
    for you, i recommend "man wget", which answers your question.

    --
    phani.

  8. #8
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    19,585
    Blog Entries
    14

    Default Re: wget command help to download packages from mirror

    Quote Originally Posted by DenverD View Post
    colao wrote:
    > How can i download packages with wget from that mirror with a string
    > "alsa"?


    does man wget not help?

    does the following not work? did you try it?

    Code:
    wget [option] [URL]/*alsa*
    is this homework?

    --
    DenverD
    CAVEAT: http://is.gd/bpoMD [posted via NNTP w/openSUSE 10.3]
    Does not work. Gives a 404 Error.
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    https://en.opensuse.org/openSUSE:Board#Members
    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  9. #9
    Join Date
    Mar 2009
    Location
    sri mayapur, west bengal, india
    Posts
    958

    Default Re: wget command help to download packages from mirror

    On Tue, 30 Nov 2010 21:36:02 +0530, Knurpht
    <Knurpht@no-mx.forums.opensuse.org> wrote:

    > Does not work. Gives a 404 Error.


    of course, you can't use wget like you would a bash command, specifying
    reg.ex. as URL. wget tried to download from the exact location you
    specified as argument, with asterisks and all: such an address doesn't
    exist, that's what 404 means.

    you'll really have to read the manual on this if you want to use wget for
    anything else than downloading one particular file. to in- or exclude
    certain files, you use these command options (from the wget manual):
    Code:
    -A acclist --accept acclist
    -R rejlist --reject rejlist
    Specify comma-separated lists of file name suffixes or patterns to accept
    or reject. Note that if any of the wildcard characters, *, ?, [ or ],
    appear in an element of acclist or rejlist, it will be treated as a
    pattern, rather than a suffix.
    --
    phani.

  10. #10
    Join Date
    Mar 2009
    Location
    sri mayapur, west bengal, india
    Posts
    958

    Default Re: wget command help to download packages from mirror

    On Tue, 30 Nov 2010 22:16:27 +0530, phanisvara <listmail@phanisvara.com>
    wrote:

    >
    Code:
    > -A acclist --accept acclist
    > -R rejlist --reject rejlist
    >  Specify comma-separated lists of file name suffixes or patterns to
    > accept or reject. Note that if any of the wildcard characters, *, ?, [
    > or ], appear in an element of acclist or rejlist, it will be treated as
    > a pattern, rather than a suffix.
    >


    i'm sorry, i have been writing nonsense. this allows you only to specify
    file suffixes, not file names. (haven't actually tried this out, but from
    the man text it seems clear it's only suffix, not filename.) then i'm
    afraid i don't know if or how this is possible with wget. since wget is
    otherwise very complex, i'd be surprised if it couldn't handle this (file
    name patterns). my man file says it's not the complete documentation for
    wget:
    For more complete information, including more detailed
    explanations of some of the options, and a number of commands
    available for use with .wgetrc files and the -e option, see the GNU Info
    entry for wget.
    i don't have the time right now, but do believe the answer is in there
    somewhere.

    --
    phani.

Page 1 of 3 123 LastLast

Posting Permissions

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