Author Topic: Downloading Packages and Then Installing Locally  (Read 2317 times)

Offline shevek

  • Jr. Member
  • **
  • Posts: 44
Downloading Packages and Then Installing Locally
« on: July 27, 2009, 11:36:55 AM »
I started a different thread about synchronizing a local repository but this question is just different enough that I prefer to have a separate thread.

What is the correct way with Synaptic to only download packages and then later install from a "local" repository?

I see the "Download package files only" option when I select the Synaptic Apply button. To where are the packages downloaded? I want to move those downloaded packages to a DVD.

Thereafter, how do I install all of those packages from my separate DVD?

Background: I intend to perform some repeated installation and configuration exercises with PCLOS to better learn the system. I cannot afford to repeatedly consume ISP bandwidth to install packages each time.

Thus I need local availability. I want to download packages once, which seems straightforward with Synaptic, and then move the packages to a DVD. Then every time I perform a fresh installation I won't be using ISP bandwidth.

I realize that eventually even with my own "local" DVD repository that some packages might need to be updated. Yet that affects a final installation and does not affect my desire to perform repeated installations for learning purposes. :) Even with a handful of updates, I will have significantly reduced overall bandwidth consumption by using a local DVD repository.

Also, I'm no stranger to the command line. Rather than use Synaptic to install packages from my local DVD repository, I prefer to write a small shell script to install the packages. I presume I need to use apt-get for that. Perhaps I don't even need a shell script, just the correct apt-get syntax.

I appreciate any guidance. I'm not new to Linux based systems, but I am a newbie with Synaptic and apt-get. If a handful of links will provide the best answer then that is fine.

Thanks again.

Offline cyrwyn

  • Hero Member
  • *****
  • Posts: 832
Re: Downloading Packages and Then Installing Locally
« Reply #1 on: July 27, 2009, 11:50:46 AM »
Look in /var/cache/apt/archives after you have selected in Synaptic to Download Package Files Only. You must be root to do this. You can then write them to a DVD. To make Synaptic see the local repository on your DVD you must add the path to the repository list in Synaptic, select only that repository, click reload and you should see your local files. Or you can use apt-get, but it also needs the repository list to direct it to where the files are. There's many posts on this in the forum, just search.
Using Linux for over 18 years and still counting.

Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
Re: Downloading Packages and Then Installing Locally
« Reply #2 on: July 27, 2009, 02:23:49 PM »
I have my apt cache on a seperate data partition that is auto-mounted at boot (via /etc/fstab)..  I use a symbolic link to redirect /var/cache/apt/archives to my local cache on the data partition.

mbmalone

  • Guest
Re: Downloading Packages and Then Installing Locally
« Reply #3 on: July 28, 2009, 12:13:16 AM »
We need a big sticky on how to do this?
People could share ultimate package lists, too so that they automatically download or install from the repository.

Start with a base ISO release, then add huge list of custom packages and get recreate someone's awesome Custom Ultimate PCLinuxOS.
Without having to choose them yourself, you know.

Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
Re: Downloading Packages and Then Installing Locally
« Reply #4 on: July 28, 2009, 09:01:01 AM »
Probably the ideal way to accomplish a "distributable" automated install would be to create a metapackage rpm that requires install of all additional custom packages to a standard base MiniMe iso...  As an example of this, I think MythTVOS has gone to this type of model.

Believe it or not this is a pretty easy thing to do.. (assuming all packages are in standard repositories) ..the hardest part is probably compiling the list of additional packages, and even that should be pretty easy using either the rpm command or synaptic's history.  If you wanted to include a customized default desktop, then it becomes slightly more involved; you would probably modify the metapackage to include  / install the requisite user desktop config files, wallpaper, etc. to /etc/skel.

Browse over to mypclinuxos.com and do a search for 'metapackage' or 'metapackaging'..  If I recall correctly, there are one or two how-to threads on metapackaging in the old santa's helper archives.  The other option is to just jump in and install pkgutils, and download any task-xxx...src.rpm from one of the standard repos as a metapackage model to work from.

In the case of the original poster, having all the requisite packages in a central location with the apt cache linked in should prevent apt / synaptic from downloading the packages; it should just use the cached ones if they are up to date.  The administrator could then just point the apt-get install to their metapackage file (or maybe use the list method described below), and all packages would be installed.  

If the admin doesn't want to use symlinks to a central apt cache, there are already a few how-to's for creating local repositories on the forums..  one of them is stickied in the packaging section of the forum.  If you are using packages from outside the standard repositories this is your best solution.

EDIT:
Instead of creating a metapackage, it might also be possible to just use a plain text package list file and pipe it to apt-get install (again, assuming all packages are in the standard repos):
Code: [Select]
cat /path/to/package-list.txt | apt-get install
## ---OR--- ###
apt-get install `cat /path/to/package-list.txt`
« Last Edit: July 28, 2009, 09:24:59 AM by travisn000 »

mbmalone

  • Guest
Re: Downloading Packages and Then Installing Locally
« Reply #5 on: July 28, 2009, 09:45:44 AM »
They need to update all their repositories, as well ... so that it works.
Add testing kde4 and such.

I would love to have a massive package list of the good stuff.

Offline shevek

  • Jr. Member
  • **
  • Posts: 44
Re: Downloading Packages and Then Installing Locally
« Reply #6 on: July 31, 2009, 12:27:05 PM »
Quote
Look in /var/cache/apt/archives after you have selected in Synaptic to Download Package Files Only.
Thanks.

Quote
To make Synaptic see the local repository on your DVD you must add the path to the repository list in Synaptic, select only that repository, click reload and you should see your local files.
Thanks again. :)

Quote
I would love to have a massive package list of the good stuff.
I think this would help. For example, I'd like to see a package for creating a developer's machine. One package selection in Synaptic would automatically select all developer packages, kernel sources, headers and include packages, etc.

Another example might be a HTPC package, which could automatically select all such related packages.

Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
Re: Downloading Packages and Then Installing Locally
« Reply #7 on: July 31, 2009, 12:44:05 PM »
Quote
Look in /var/cache/apt/archives after you have selected in Synaptic to Download Package Files Only.

Thanks.

Quote
To make Synaptic see the local repository on your DVD you must add the path to the repository list in Synaptic, select only that repository, click reload and you should see your local files.

Thanks again. :)

..I am pretty sure you would need to generate a package list for synaptic to use for the files on the DVD.  

The easiest way to do this would be to use pkgutils mkrepo script to create the local repo in your home directory, copy the cached rpms to the repo, and then use pkgutils gbd script to generate the package lists..  When done, burn the entire /home/<username>/src directory to the dvd and then you can set it up as a repo in synaptic..  

There is quite a bit more info on this process in the following thread from the packaging section:

How to Set Up a Repository in Your Home Directory



Another example might be a HTPC package, which could automatically select all such related packages.

There is a meta package for mythTV to install and configure it automatically..  the packager is actually looking for more testers for the next version right now: http://www.pclinuxos.com/index.php?option=com_smf&Itemid=26&topic=60438.0
« Last Edit: July 31, 2009, 12:49:03 PM by travisn000 »

Offline shevek

  • Jr. Member
  • **
  • Posts: 44
Re: Downloading Packages and Then Installing Locally
« Reply #8 on: August 08, 2009, 11:22:47 AM »
Quote
The easiest way to do this would be to use pkgutils mkrepo script to create the local repo....
I decided to try this today.

I downloaded a bunch of packages using an online repository. The packages are from all of the various rpm subdirectories/categories.

I copied the packages to a DVD for safekeeping so I won't have to download again.

Next I installed the pkgutils package.

Then I ran the mkrepo script.  Seems to have succeeded.

Now I want to copy all of the packages from the DVD to the new repo directory. Which subdirectory do I copy the packages?

I ask because when I browse an online repository I notice the subdirectories are ordered by category. Yet all the packages on the DVD are in one big directory.

Do I need to modify my sources.list file to not reference the usual categories of nonfree, kde, gnome, etc., but create my own category? Say, for example, category "local"?

Do I copy the packages based upon the file name suffix from the DVD to the respective rpm/RPMS/i586 and rpm/RPMS/noarch directories?

Then do I run gbd? Do I need to be in the root directory of the new repository before running gbd?

I need a bullet list of what to do next. I've browsed the forum and found some information about local repositories but I'm missing the big picture somewhere.

Thanks again.
« Last Edit: August 08, 2009, 11:28:28 AM by shevek »

mbmalone

  • Guest
Re: Downloading Packages and Then Installing Locally
« Reply #9 on: August 08, 2009, 01:42:27 PM »
I had that problem, too.
I did not have the packages in the correct folders and didn't know which they had to be in  ???

I wanted to just dump all of them in a single folder, but didn't want to screw anything up.
Copying them to apt cache worked, however. I haven't done it lately, so I can't tell you what I did.
« Last Edit: August 08, 2009, 01:44:01 PM by mbmalone »

Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
Re: Downloading Packages and Then Installing Locally
« Reply #10 on: August 09, 2009, 02:14:12 AM »
Quote
The easiest way to do this would be to use pkgutils mkrepo script to create the local repo....
I decided to try this today.

Do I need to modify my sources.list file to not reference the usual categories of nonfree, kde, gnome, etc., but create my own category? Say, for example, category "local"?

Do I copy the packages based upon the file name suffix from the DVD to the respective rpm/RPMS/i586 and rpm/RPMS/noarch directories?

Then do I run gbd? Do I need to be in the root directory of the new repository before running gbd?

I need a bullet list of what to do next. I've browsed the forum and found some information about local repositories but I'm missing the big picture somewhere.

Thanks again.


What I had suggested was to put them in your local repo, run gbd, then burn the $HOME/src/apt directory to dvd, so that you would capture the package list on the DVD..  But, your way will work also..

Here is how to do it:

--Copy all the files into any one of the RPM directories (or sort if you like)..  it really doesn't matter; I usually  use i586.

--run gbd in konsole; this should create package lists in $HOME/src/apt/pclinuxos/2007/base  ..run it as a regular user from any location.

--open synaptic and check your repo  lists (or open your sources.list file) to see if your local repo was added automatically by mkrepo (It should have been).  If it is not there, add it manually and activate it:

Code: [Select]
.
URI:   /home/username/src/apt/
Distribution:  pclinuxos/2009
Sections:  i586 noarch athlon

--Once home repo is active, click reload in synaptic and all RPMs should now be available; install as needed.
« Last Edit: August 09, 2009, 02:15:43 AM by travisn000 »

Offline shevek

  • Jr. Member
  • **
  • Posts: 44
Re: Downloading Packages and Then Installing Locally
« Reply #11 on: August 09, 2009, 02:33:38 PM »
I got this to succeed. :)

Basically I performed the following (but not all in the same day):

1. Started Synaptic.
2. Selected a bunch of packages I wanted (took about 20 minutes to find and mark the packages).
3. Selected the "Download package files only" option.
4. Downloaded the files, which by default are stored in /var/cache/apt/archives.
5. Copied all packages from /var/cache/apt/archives to a DVD-RW.
6. Downloaded and installed pkgutils.
7. Opened Konsole.
8. cd to /var/cache (seemed like a good place to create a local repository).
9. Ran the mkrepo script.
10. Copied all *i586* packages from the DVD to /var/cache/src/rpm/RPMS/i586.
11. Copied all *noarch* packages from the DVD to /var/cache/src/rpm/RPMS/noarch.
12. In Konsole, cd to /var/cache/src/apt/pclinux/2009/base (created by mkrepo).
13. Ran the gbd script.
14. Closed Konsole.
15. Started Synaptic.
16. Selected only the local repository.
17. Created a new filter called Not Installed.
18. Selected all packages and marked for installation.
19. Installed all the packages (very fast when performed locally).
20. Copy/mirror /var/cache/src (local repository) to a DVD to provide a backup.

At this point I now can install a 2009.2 Live CD and then update the system to my preferences without consuming any additional bandwidth. That is pretty much the intent of remastering a new Live CD/DVD, but I needed a method to allow me to repeat multiple installations for learning purposes.

The process is not perfected. I need to add some packages to my local repository that I downloaded and installed, such as pkgutils and speaker-test. There probably are a couple of additional packages too.

Perhaps this information will help somebody. Feel free to improve the process for the wiki and update accordingly. :)

Question: Does anybody have a list of packages from a default 2009.2 installation? I want to filter which packages I downloaded and installed after installing 2009.2 but before I updated with my local repository. Should be a short list. I created a list from rpm -qa and diffed that with the list of packages in my local repository. Yet I cannot distinguish which were installed from the original 2009.2 CD and which were installated thereafter. I probably could create a temporary virtual machine, install 2009.2, create a rpm-qa list and then that would serve as a baseline.

mbmalone

  • Guest
Re: Downloading Packages and Then Installing Locally
« Reply #12 on: August 09, 2009, 06:27:09 PM »
I saved a list, but it was MiniMe 2009.1  :-\


Does anybody have a list of packages from a default 2009.2 installation? I want to filter which packages I downloaded and installed after installing 2009.2 but before I updated with my local repository.

« Last Edit: August 09, 2009, 06:29:20 PM by mbmalone »

Offline shevek

  • Jr. Member
  • **
  • Posts: 44
Re: Downloading Packages and Then Installing Locally
« Reply #13 on: August 09, 2009, 08:19:02 PM »
Quote
I saved a list, but it was MiniMe 2009.1
That's okay. :) I'll create a virtual machine and install. The process should run quickly and I'll have a default package list.

taha1983

  • Guest
Re: Downloading Packages and Then Installing Locally
« Reply #14 on: November 16, 2010, 02:22:39 AM »
could you create a learning clip video and put into forum?