Download and *save* a package instead of installing it? [SOLVED]

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
jharris1993
Level 3
Level 3
Posts: 128
Joined: Mon Nov 05, 2012 9:43 pm
Location: Woprcester Ma. (USA) when I'm not in Moscow Russia
Contact:

Download and *save* a package instead of installing it? [SOLVED]

Post by jharris1993 »

Greetings!

Version: Mint 18.1. Cinnamon, Mate and KDE desktops, free and non-free.

Issue:
1. I am presently at a location where the download speeds are nothing less than abysmal. (i,e, "modem" speed connections are not unusual.) As a result, downloading and installing relatively small packages can take non-trivial amounts of time. Larger packages like FlightGear, (> 1 gig including dependencies), can take hours. Even the initial set of updates to the installed system can take over an hour to complete.

2. In order to do some required software testing, it is necessary for me to create several different Mint installs.
For example:
Cinnamon vs Mate.
Proprietary NVIDIA video drivers vs the open-source variant.
Etc.

3. Because of the number of installs I need, downloading and re-downloading and re-re-re-re-downloading the same packages again and again is horrifically inefficient.

Viz., This example shows a total of four. In my particular case, I will need eight separate installs to complete the required testing. If I assume a package download with dependencies takes (at least!) two hours, I will need a minimum of 16 hours just to download the package - assuming the download doesn't fail!

4. In the Windows environment, I can download an installer executable package, (.exe or .msi), store it someplace, and when I need to install it, I can use and re-use it without downloading it again and again. In other words, if the initial install download is time-expensive, I only incur that time-expense once, and can re-use the installer again without having to download it each time. If an installer has dependencies that are not internally solved, (dot-net 4.5 or the C++ 2010 runtime for example), I download these only once as well, and re-use as required.

Question:
Is this possible with Mint/Ubuntu installer packages? What I want to do is to take a package, download the .deb file and all the dependencies into some specified location. Then at a later point in time I can take that package, in the place where I put it, and install it onto the system.

What I want to do:
1. Download the entire package and all the dependencies into a known directory. (Hopefully a directory I can specify)
2. Copy, (or transfer to my file server), the entire content of that directory which represents the entire installer context of that installation package to someplace on my local network, (or to a USB stick, etc.)
3. Copy this context - all the installation files - to the system I am building.
4, Install using the package context I have just copied, from the place I have just copied it to.
5. Ideally, if there are packages missing because of the target location, (i.e. KDE requires packages that Mate/Cinnamon do not), the few additional packages needed would be downloaded automatically.

Is this possible? If so, how do I do it?

Thanks!

Jim (JR)
Last edited by jharris1993 on Mon Apr 24, 2017 10:55 pm, edited 1 time in total.
Jim "JR"

Some see things as they are, and ask "Why?"
I dream things that never were, and ask "Why Not".

Robert F. Kennedy

“Impossible” is only found in the dictionary of a fool.
Old Chinese Proverb

Cosmo.
Level 23
Level 23
Posts: 17827
Joined: Sat Dec 06, 2014 7:34 am

Re: Download and *save* a package instead of installing it?

Post by Cosmo. »

You can use synaptic for that, with 2 possibilities:

1. If you apply the installation you get a confirmation dialog at first; there you have the choice to download only without install; now you have to pick those packages out of the apt cache (/var/cache/apt/archives).

2. You find in the file menu the command to create a download script. You can transfer the script to another computer (with a fast Internet connection) and execute it there. The download files go into the same folder as the script and are easy to reach. The only prerequisite for this is wget, what should be present on any Linux computer and can be installed also inside of a Windows system, in this case a few accommodations for the script are necessary.

jharris1993
Level 3
Level 3
Posts: 128
Joined: Mon Nov 05, 2012 9:43 pm
Location: Woprcester Ma. (USA) when I'm not in Moscow Russia
Contact:

Re: Download and *save* a package instead of installing it?

Post by jharris1993 »

Thanks!

Having done that - creating the script and downloading all the package files - what do I have to do to install them? AFAIK neither apt-get nor Synaptic allow a change of path.
Jim "JR"

Some see things as they are, and ask "Why?"
I dream things that never were, and ask "Why Not".

Robert F. Kennedy

“Impossible” is only found in the dictionary of a fool.
Old Chinese Proverb

User avatar
austin.texas
Level 20
Level 20
Posts: 12054
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: Download and *save* a package instead of installing it?

Post by austin.texas »

When you install a program, the .deb files needed are downloaded into the /var/cache/apt/archives/ folder.
You can copy those .deb files to a different Mint with no problem - I do it with every new installation. Simply back them up to a flash drive and place them in the new /var/cache/apt/archives/ folder in the other OS. At that point the download part of the installation process is done. You simply install the program in the normal way:

Code: Select all

sudo apt-get install program
Before you copy the .deb files, run the command

Code: Select all

sudo apt-get autoclean
That cleans out the old .deb files that you no longer need.

If you want to download the .deb files on one computer, for installation on a different computer, without installing the program on the computer which is downloading the files, there are 2 commands you can use:

Code: Select all

sudo apt-get  --download-only install packagename
That command downloads all the .deb files for that package into /var/cache/apt/archives/

There is another command which downloads to the current directory (not /var/cache/apt/archives/) - but only downloads the package you named, not the dependencies.

Code: Select all

apt-get download packagename
With either of those methods, you can download KDE packages on a Cinnamon system, and vice-versa. The problem you will run into using the first one is that you will be downloading a lot of KDE library files that are not present on the Cinnamon system - but might be already present on the KDE system. So you are downloading files that you already have.

Here is a different method - these instructions originally posted by bt101 :arrow: viewtopic.php?t=214461#p1121381
On the slow machine, you can generate a list of deb files to download with the following command:

Code: Select all

apt-get -qq --print-uris install packagename | awk -F\' '{ print $2}'
So for example, if you want to generate the list of deb files for the package 'devede' and you want to save that list to 'files.txt':

Code: Select all

apt-get -qq --print-uris install devede | awk -F\' '{ print $2}' > files.txt
You can then take the file 'files.txt' to the fast computer and use it to download the deb files.
The best way to do that is to use the wget command (for Windows you'll need to get a Windows version of wget and there are free ones out there).
Tell wget to use 'files.txt' as a list of files to download:

Code: Select all

wget -i files.txt
Then take your downloaded deb files and put them on /var/cache/apt/archives on the slow machine.
On the new machine, after installing the programs, check for any missing dependencies with:

Code: Select all

sudo apt-get check
Last edited by austin.texas on Tue Jan 31, 2017 10:15 am, edited 1 time in total.
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018

jharris1993
Level 3
Level 3
Posts: 128
Joined: Mon Nov 05, 2012 9:43 pm
Location: Woprcester Ma. (USA) when I'm not in Moscow Russia
Contact:

Re: Download and *save* a package instead of installing it?

Post by jharris1993 »

austin.texas wrote:When you install a program, the .deb files needed are downloaded into the /var/cache/apt/archives/ folder.
You can copy those .deb files to a different Mint with no problem - I do it with every new installation. Simply back them up to a flash drive and place them in the new /var/cache/apt/archives/ folder in the other OS. At that point the download part of the installation process is done. You simply install the program in the normal way:

Code: Select all

sudo apt-get install program
Before you copy the .deb files, run the command

Code: Select all

sudo apt-get autoclean
That cleans out the old .deb files that you no longer need.
Let me see if I have this right - combining your comments with the suggestion that I let Synaptic create installer download scripts:

1. Run the script in whatever directory I want to accumulate the files needed.
2. Copy them to someplace safe

As root, I then:
3. Move them to the /var/cache/apt/archives folder on the target machine after I have run "autoclean" to clear out the cruft
4. Run apt-get install [downloaded program(s)]
5. Run apt-get check (just in case. . . .)

Repeat steps 3-5 on each target machine.

Since there is no such thing as a "slow" or "fast" machine in this context - the limiting factor is the download speed which as I have said is abysmal to the point of being horrid. What this should allow me to do is to capture the download on one machine - enduring the time-expense only once - and then move the package of files to each target machine in sequence and install there.

if there were a "standard install package" of programs that I always install on every machine I create, I could do this once, create a folder with everything I need in it, transport it to every machine I need it on, and let the fur fly!

Obviously, I might want to consider re-creating the collection of installation files for each new version of Mint I install (13, 14, 15, . . . ,18, etc.)

Thanks!

Jim (JR)
Jim "JR"

Some see things as they are, and ask "Why?"
I dream things that never were, and ask "Why Not".

Robert F. Kennedy

“Impossible” is only found in the dictionary of a fool.
Old Chinese Proverb

User avatar
austin.texas
Level 20
Level 20
Posts: 12054
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: Download and *save* a package instead of installing it?

Post by austin.texas »

I have never tried the Synaptic script - so I can't comment on that. But the rest of your observations are perfectly accurate.
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018

Cosmo.
Level 23
Level 23
Posts: 17827
Joined: Sat Dec 06, 2014 7:34 am

Re: Download and *save* a package instead of installing it?

Post by Cosmo. »

jharris1993 wrote:Having done that - creating the script and downloading all the package files - what do I have to do to install them?
Go back to synaptic and select tin the file menu the following command to add the downloaded packages; in the following dialog select the folder with them.

Personal remark: A fine example which demonstrates, that any idea to drop synaptic in favor for mintinstall would be a regression. Not the only one.

User avatar
austin.texas
Level 20
Level 20
Posts: 12054
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: Download and *save* a package instead of installing it?

Post by austin.texas »

Cosmo. wrote:Go back to synaptic and select tin the file menu the following command to add the downloaded packages; in the following dialog select the folder with them.
Please explain. I don't understand.
Cosmo. wrote:
jharris1993 wrote:Personal remark: A fine example which demonstrates, that any idea to drop synaptic in favor for mintinstall would be a regression. Not the only one.
I certainly agree.
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018

Cosmo.
Level 23
Level 23
Posts: 17827
Joined: Sat Dec 06, 2014 7:34 am

Re: Download and *save* a package instead of installing it?

Post by Cosmo. »

If you select the command to add the downloaded packages from the file menu of synaptic, a dialog opens, where you have to select the folder, where you have stored the script and the downloaded package files. Synaptic does the rest. The wording of the menu command might be a little bit different, but is easy to find, as it is the next command to the command to create the script.

jharris1993
Level 3
Level 3
Posts: 128
Joined: Mon Nov 05, 2012 9:43 pm
Location: Woprcester Ma. (USA) when I'm not in Moscow Russia
Contact:

Re: Download and *save* a package instead of installing it?

Post by jharris1993 »

austin.texas wrote:
Cosmo. wrote:Personal remark: A fine example which demonstrates, that any idea to drop synaptic in favor for mintinstall would be a regression. Not the only one.
I certainly agree.
Austin,

Though I entirely agree with Cosmo's comments, I really can't take credit for them! The corrected quote is noted above.

With regard to abandoning Synaptic, I think that - on a "are you outta your effing mind?!!" scale of 1 through 10, it would rate a 10 - thousand!

The only two package tools I use are Synaptic and, (within a root terminal), apt-get.

Jim (JR)
Jim "JR"

Some see things as they are, and ask "Why?"
I dream things that never were, and ask "Why Not".

Robert F. Kennedy

“Impossible” is only found in the dictionary of a fool.
Old Chinese Proverb

User avatar
austin.texas
Level 20
Level 20
Posts: 12054
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: Download and *save* a package instead of installing it?

Post by austin.texas »

You are right - I accidentally got an extra [quote="jharris1993"] in there that did not belong. :oops:

@Cosmo
Now I understand. Thank you. Sometimes I am a little slow until my 4th cup of coffee.
Mint 18.2 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Linux Linx 2018

jharris1993
Level 3
Level 3
Posts: 128
Joined: Mon Nov 05, 2012 9:43 pm
Location: Woprcester Ma. (USA) when I'm not in Moscow Russia
Contact:

Re: Download and *save* a package instead of installing it?

Post by jharris1993 »

austin.texas wrote:You are right - I accidentally got an extra <quote="jharris1993"> in there that did not belong. :oops:
No problemo, dude! This should be the worst mistake you ever make in your life. . . . .

Jim (JR)
Jim "JR"

Some see things as they are, and ask "Why?"
I dream things that never were, and ask "Why Not".

Robert F. Kennedy

“Impossible” is only found in the dictionary of a fool.
Old Chinese Proverb

Cosmo.
Level 23
Level 23
Posts: 17827
Joined: Sat Dec 06, 2014 7:34 am

Re: Download and *save* a package instead of installing it?

Post by Cosmo. »

austin.texas wrote:@Cosmo
Now I understand. Thank you. Sometimes I am a little slow until my 4th cup of coffee.
We are in Europe always several cups in front of you. :wink:

jharris1993
Level 3
Level 3
Posts: 128
Joined: Mon Nov 05, 2012 9:43 pm
Location: Woprcester Ma. (USA) when I'm not in Moscow Russia
Contact:

Re: Download and *save* a package instead of installing it?

Post by jharris1993 »

Cosmo. wrote:
austin.texas wrote:@Cosmo
Now I understand. Thank you. Sometimes I am a little slow until my 4th cup of coffee.
We are in Europe always several cups in front of you. :wink:
And in Moscow Russia, the recipe for coffee is this:

1. Make sure the residue from last nights party has been removed.
2. Check freezer for bottle of vodka
If exist
{
Fill cup
Float coffee bean on top
Drink
Repeat as needed
}
Else
{
go buy more vodka
return "ARGGGG!!!"
}
endif
return Ahhhh!
end
Jim "JR"

Some see things as they are, and ask "Why?"
I dream things that never were, and ask "Why Not".

Robert F. Kennedy

“Impossible” is only found in the dictionary of a fool.
Old Chinese Proverb

Post Reply

Return to “Installation & Boot”