Jump to content

URPMI -- download packages without install


skyhawk
 Share

Recommended Posts

I have built a growing collection of RPM packages stored in a single home directory which I use as a custom repository and which will also be stored on CD. Presently, I am using Mozilla Firefox to find and download the packages to my hard disk, using URPMI only to select package filenames and their dependencies.

 

I have read the URPMI man page and I see that the command-line backend program supports download without install via the '--no-install' parameter. I would like to use the GUI frontend program to do the same -- just download without installing -- and I would like to have packages downloaded to the directory of my choosing, not the default directory '/var/cache/urpmi/rpms'. Is it possible to do this?

Edited by skyhawk
Link to comment
Share on other sites

My two cents: I really liked the "no clean" option and wish it was still available. (if it is still available, I'll go back to cli urmpi)

 

Skyhawk,

I thought I was the only one doing this. I do it because I am on dial up and I go to friends houses w/ dsl to download my laundry list of files, put it on my flash drive and back home . Then If i do manage to screw something up, I can be right back to where I was in no time.

 

 

I'm not sure how big of an interest there would be, but for those still surfing the web from the stonage , we would sure like to see iso's available for the repos(main / contrib/ plf). I know it would not / could not contain updates. Dial up is my one complaint about countryside living. That and the ocassional skunk.

Link to comment
Share on other sites

I believe noclean still works, although I can't remember if it is -noclean or --noclean or --no-clean or whatever, should be easy to find though in the help or man pages

 

also you can edit the file

 

/usr/lib/perl5/vendor_perl/5.8.8/urpm/install.pm

 

by finding

 

if (@l == 0 && !$options{test} && $options{post_clean_cache}) {

 

and either commenting it out, and/or replacing it with

 

if ( 0 ) {

 

this will keep the files that are downloaded, whether you use cli urpmi, or via MCC Software Manager.

 

I used to use it under 2007 and 2008, it works fine.

Edited by esulcer
Link to comment
Share on other sites

I believe noclean still works, although I can't remember if it is -noclean or --noclean or --no-clean or whatever, should be easy to find though in the help or man pages ...

 

The '--no-clean' option is still covered on the man page included with Mandriva 2007.0. I do not know if the option is still actually functional.

 

The problem with using the CLI to do URPMI is that it is not always possible to know the exact filename of the package to be downloaded. The procedure I am using now involves using the GUI to select package filenames with their dependencies, pasting those filenames (not always precise ones) into a text file, then going to a web source for RPM packages and doing a search for the filenames I pasted into the text file. This works fine, but is a rather slow way of doing things.

 

I want to store packages on hard disk and CD in case of unexpected 'emergencies'. There is always the possibility of hard disk failure, and the situation will probably arise in the future where I might have a second system unit for Linux, or I might want to changeover someone's Windows unit to Linux.

 

Thanks to everyone for the assistance.

Link to comment
Share on other sites

You used to be able to edit the 'global options' in your /etc/urpmi/urpmi.cfg file with 'no-clean'. The 'global options' are placed between the first set of {} braces in urpmi.cfg. I believe this still works with 2007.0?

 

Thanks for the useful information, Greg2. That simple 'hack' could be the solution to my little problem. It is not absolutely vital that the packages be downloaded to a directory of my choosing, only that they be retained on hard disk for later transfer to CD.

Link to comment
Share on other sites

The problem with using the CLI to do URPMI is that it is not always possible to know the exact filename of the package to be downloaded. The procedure I am using now involves using the GUI to select package filenames with their dependencies, pasting those filenames (not always precise ones) into a text file, then going to a web source for RPM packages and doing a search for the filenames I pasted into the text file. This works fine, but is a rather slow way of doing things.

 

Some urpmi tips:

urpmq -y --sources [part-of-pkgname]

 

will tell you the url of the pkg in your repositories that you have configured. -y, or --fuzzy is match part of the pkgname.

 

One trick I use for that is

 

wget $(urpmq -y --sources <<pkgname>>)

 

This will give you an error if

urpmq -y --sources <<pkgname>>

returns more than one url (I think). To avoid that, you could do:

 

for pkg in $(urpmq -y --sources <<pkgname>>)

do

wget $pkg

done

 

And for normal urpmi installs, you don't need to know the exact name:

 

urpmi --no-install --noclean kopete

 

will work. I'm not exactly sure why you are wanting to do what you're doing. Are you doing a urpmi --auto or are you wanting to do this for any pkg? I can probably whip up a shell script for whatever you are trying to do.

Edited by Steve Scrimpshire
Link to comment
Share on other sites

... I'm not exactly sure why you are wanting to do what you're doing. Are you doing a urpmi --auto or are you wanting to do this for any pkg? I can probably whip up a shell script for whatever you are trying to do.

 

My reason for doing what I am doing is to store packages safely away on CD, in addition to those on my Mandriva 2007.0 installation discs. When downloading additional packages from repos, I want to do so selectively, not doing so randomly, so I do not find myself downloading packages which I will later discover to be unnecessary. I am aware that URPMI is capable of downloading all packages from a selected repository, but that capability is way beyond what I need.

 

I am also aware that some Linux software sources can provide custom-made CDs that can contain all files from any particular URL, and I will be looking into services of that type. I want software beyond what is available on the Mandriva Free distributions, but I do not need all the software contained in a commercial boxed distribution from Mandriva.

Link to comment
Share on other sites

For the benefit of all who are following this thread, here is my follow-up on what has been suggested thus far, in condensed, edited form.

 

Edit: /usr/lib/perl5/vendor_perl/5.8.8/urpm/install.pm

Find: if (@l == 0 && !$options{test} && $options{post_clean_cache}) {

Comment the line out and/or replace it with: if ( 0 ) {

This will keep the files that are downloaded, whether you use cli urpmi, or MCC Software Manager.

 

[me@mycomputer ~]$ cd /usr/lib/perl5/vendor_perl/5.8.8/urpm/
[me@mycomputer urpm]$ ls
args.pm  cfg.pm  download.pm  msg.pm  prompt.pm  sys.pm  util.pm

 

This directory does not contain the file install.pm. The file args.pm includes code for the '--no-install' and '--noclean' options, so they are available for use (Mandriva 2007.0). According to the man urpmi page, adding the '--no-install' option will keep packages in the /var/cache/urpmi/rpms/ directory. I interpret this to mean that '--noclean' is not needed, if '--no-install' is used.

 

==================================================

 

Edit 'global options' in /etc/urpmi/urpmi.cfg file by adding 'no-clean'. The global options are located between the first set of {} braces in urpmi.cfg.

 

The /etc/urpmi/urpmi.cfg file only contains info on how media are configured, such as:

 

[me@mycomputer ~]$ cd /etc/urpmi/
[me@mycomputer urpmi]$ cat urpmi.cfg
Installation\ i586\ CD\ 1 removable://mnt/cdrom/i586/media/main {
 hdlist: hdlist.Installation i586 CD 1.cz
 ignore
 key-ids: 70771ff3
 removable: /dev/hdc
 static
 with_hdlist: media_info/hdlist.cz
}

 

... and so on, for all configured media. CD 1 (install disc 1) is disabled here, in this example.

 

==================================================

 

Some urpmi tips: urpmq -y --sources <<packagename>>

will tell you the URL of the package in the repositories that you have configured. The -y, or --fuzzy option will list all possible matches for <<packagename>>.

 

This is a very useful tip. Doing this shows the complete URL for any package and its dependencies. Multiple packages can then be easily selected and downloaded using CURL or WGET by using the proper syntax. It is not necessary to download packages one at a time from the CLI; an entire list of packages can be downloaded via a single command-line.

 

==================================================

 

Mandriva 2007.0, kernel 2.6.17-5mdv, text mode install. Compaq Deskpro EN, Pentium III, 933 MHz, 256 MB RAM. Best Data 56SX92 external serial modem, hp L1720 lcd monitor, Canon BJC-610 printer.

Link to comment
Share on other sites

If you don't have install.pm in that directory, then urpmi is not installed correctly.

[root@localhost urpm]# rpm -ql urpmi

<<snip>>

/usr/lib/perl5/vendor_perl/5.8.8/urpm

/usr/lib/perl5/vendor_perl/5.8.8/urpm.pm

/usr/lib/perl5/vendor_perl/5.8.8/urpm/args.pm

/usr/lib/perl5/vendor_perl/5.8.8/urpm/bug_report.pm

/usr/lib/perl5/vendor_perl/5.8.8/urpm/cfg.pm

/usr/lib/perl5/vendor_perl/5.8.8/urpm/download.pm

/usr/lib/perl5/vendor_perl/5.8.8/urpm/get_pkgs.pm

/usr/lib/perl5/vendor_perl/5.8.8/urpm/install.pm

/usr/lib/perl5/vendor_perl/5.8.8/urpm/lock.pm

/usr/lib/perl5/vendor_perl/5.8.8/urpm/main_loop.pm

/usr/lib/perl5/vendor_perl/5.8.8/urpm/md5sum.pm

/usr/lib/perl5/vendor_perl/5.8.8/urpm/media.pm

/usr/lib/perl5/vendor_perl/5.8.8/urpm/msg.pm

/usr/lib/perl5/vendor_perl/5.8.8/urpm/parallel.pm

/usr/lib/perl5/vendor_perl/5.8.8/urpm/prompt.pm

/usr/lib/perl5/vendor_perl/5.8.8/urpm/removable.pm

/usr/lib/perl5/vendor_perl/5.8.8/urpm/select.pm

/usr/lib/perl5/vendor_perl/5.8.8/urpm/signature.pm

/usr/lib/perl5/vendor_perl/5.8.8/urpm/sys.pm

<<snip>>

 

The file /etc/urpmi/urpmi.cfg should start like this:

{

// this is where global options go

}

 

plf-free ftp://ftp.free.fr/pub/Distributions_Linux...ase/binary/i586 {

<<snip>>

 

Unfortunately, noclean or noinstall are not viable options. You could try putting pre-clean in there, and copy all your files out after each run. I'm not 100% sure if pre-clean cleans between sets of pkgs or not, so not sure if it will do what you expect without testing. I do know for sure that if something causes urpmi to restart without your guidance (like urpmi being one of the pkgs it installs), it will clean the cache before you get a chance to copy pkgs out of it.

Edited by Steve Scrimpshire
Link to comment
Share on other sites

If you don't have install.pm in that directory, then urpmi is not installed correctly.

 

This is what my RPM query shows (Mandriva 2007.0, kernel 2.6.17-5mdv):

 

[root@localhost urpm]# cd /usr/lib/perl5/vendor_perl/5.8.8/urpm/
[root@localhost urpm]# rpm -ql urpmi
<<snip>>
/usr/lib/perl5/vendor_perl/5.8.8/urpm
/usr/lib/perl5/vendor_perl/5.8.8/urpm.pm
/usr/lib/perl5/vendor_perl/5.8.8/urpm/args.pm
/usr/lib/perl5/vendor_perl/5.8.8/urpm/cfg.pm
/usr/lib/perl5/vendor_perl/5.8.8/urpm/download.pm
/usr/lib/perl5/vendor_perl/5.8.8/urpm/msg.pm
/usr/lib/perl5/vendor_perl/5.8.8/urpm/prompt.pm
/usr/lib/perl5/vendor_perl/5.8.8/urpm/sys.pm
/usr/lib/perl5/vendor_perl/5.8.8/urpm/util.pm
<<snip>>

 

From all the info that has been provided to me, it seems the best and safest route to accomplish what I want to do is:

 

1. urpmq -y --sources <packagename>

2. manually select packagenames from the output, if necessary, and save to file

3. wget -i <file>

 

... then, to do what I have been doing ...

 

4. delete <hdlist.cz> and <synthesis.hdlist.cz> from /home/userID/rpms/; then do genhdlist

5. update and use MCC Software Manager to install the new packages from HDD

 

Step 3 will download all packages listed in <file> to pwd, /home/userID/rpms/, in my case. In step 5, a media update must be done to avoid 'Invalid signature ...' messages.

 

Following this procedure will allow me to save a considerable amount of time, and I will be able to download from my preferred mirror source. The packages are retained in /home/userID/rpms/ for later transfer to CD.

 

Thanks Greg2 and Steve for your contributions. If you, or anyone else, knows any way to further 'accelerate' this CLI routine, feel free to offer suggestions. Mandriva 2007.0 is my first, and only, Linux distribution, so I am definitely not up-to-speed using the CLI, nor have I yet explored all the GUI programs installed by my install discs.

 

I have some other questions pending concerning URPMI, but they are unrelated to this specific topic, so I will save them for later. The "Tools/urpmi" pages available from Mandriva Community Wiki is the best source of general URPMI information I have found thus far.

 

==================================================

Mandriva 2007.0, kernel 2.6.17-5mdv, text mode install. Compaq Deskpro EN, Pentium III, 933 MHz, 256 MB RAM. Best Data 56SX92 external serial modem, hp L1720 lcd monitor, Canon BJC-610 printer.

==================================================

Link to comment
Share on other sites

The CLI procedure I have outlined works beautifully. Wget is a great little program with all kinds of possibilities. Read the Wget man page or the Wget GNU manual (html, pdf, text versions available) if you haven't done so already. You will be convinced that the CLI is the ultimate power tool for power users.

 

Here is some sample output from Wget. Login is automatic, as is retrieval of all files listed sequentially in the file <test>.

 

[userID@localhost temp]$ wget -i test
--08:46:14--  ftp://mirror.cs.wisc.edu/pub/mirrors/linux/Mandrakelinux/official/2007.0/i586/media/contrib/release/
allegro-4.2.0-3mdv2007.0.i586.rpm
	   => `allegro-4.2.0-3mdv2007.0.i586.rpm'
Resolving mirror.cs.wisc.edu... 128.105.103.12
Connecting to mirror.cs.wisc.edu|128.105.103.12|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.	==> PWD ... done.
==> TYPE I ... done.  ==> CWD /pub/mirrors/linux/Mandrakelinux/official/2007.0/i586/media/contrib/release ... done.
==> PASV ... done.	==> RETR allegro-4.2.0-3mdv2007.0.i586.rpm ... done.
Length: 653,398 (638K) (unauthoritative)

100%[====================================>] 653,398		5.37K/s	ETA 00:00

08:48:41 (5.34 KB/s) - `allegro-4.2.0-3mdv2007.0.i586.rpm' saved [653398]

--08:48:41--  ftp://mirror.cs.wisc.edu/pub/mirrors/linux/Mandrakelinux/official/2007.0/i586/media/contrib/release/ liballegro4.2-devel-4.2.0-3mdv2007.0.i586.rpm
	   => `liballegro4.2-devel-4.2.0-3mdv2007.0.i586.rpm'
Connecting to mirror.cs.wisc.edu|128.105.103.12|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.	==> PWD ... done.
==> TYPE I ... done.  ==> CWD /pub/mirrors/linux/Mandrakelinux/official/2007.0/i586/media/contrib/release ... done.
==> PASV ... done.	==> RETR liballegro4.2-devel-4.2.0-3mdv2007.0.i586.rpm ... done.
Length: 3,430,108 (3.3M) (unauthoritative)

100%[====================================>] 3,430,108	  5.35K/s	ETA 00:00

08:59:17 (5.28 KB/s) - `liballegro4.2-devel-4.2.0-3mdv2007.0.i586.rpm' saved [3430108]

--08:59:17--  ftp://mirror.cs.wisc.edu/pub/mirrors/linux/Mandrakelinux/official/2007.0/i586/media/contrib/release/
liballegro4.2-4.2.0-3mdv2007.0.i586.rpm
	   => `liballegro4.2-4.2.0-3mdv2007.0.i586.rpm'
Connecting to mirror.cs.wisc.edu|128.105.103.12|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.	==> PWD ... done.
==> TYPE I ... done.  ==> CWD /pub/mirrors/linux/Mandrakelinux/official/2007.0/i586/media/contrib/release ... done.
==> PASV ... done.	==> RETR liballegro4.2-4.2.0-3mdv2007.0.i586.rpm ... done.
Length: 458,718 (448K) (unauthoritative)

100%[====================================>] 458,718		6.63K/s	ETA 00:00

09:00:46 (5.20 KB/s) - `liballegro4.2-4.2.0-3mdv2007.0.i586.rpm' saved [458718]


FINISHED --09:00:46--
Downloaded: 4,542,224 bytes in 3 files
[userID@localhost temp]$

 

I use dial-up for my connection (57600), so the download speed might look slow, but it is very good for my situation.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...