[SLUG] apt questions - apt-cacher and /var/cache/apt/archives

2006-08-15 Thread david
Do the packages in /var/cache/apt/archives represent all the installed
packages on a standard Ubuntu system?

Can I use this as input to apt-cacher for the purposes of subsequently
updating another box? Eg, breezy to dapper.

thanks...


David.




-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] apt questions - apt-cacher and /var/cache/apt/archives

2006-08-15 Thread Peter Hardy
On Tue, 2006-08-15 at 23:03 +1000, david wrote:
 Do the packages in /var/cache/apt/archives represent all the installed
 packages on a standard Ubuntu system?

Unless you've removed packages, the contents of /var/cache/apt/archives
represent every single package ever installed on that system, regardless
of whether a package was subsequently removed, or replaced by an updated
version.

apt-get has a couple of commands for managing the package cache. apt-get
clean will clear out the cache completely. autoclean is a little more
intelligent. Check the apt-get man page for details.

 Can I use this as input to apt-cacher for the purposes of subsequently
 updating another box? Eg, breezy to dapper.

I guess you could seed apt-cacher with the contents of one machine's
package cache, yeah. But I've never used apt-cacher. :-)

-- 
Pete

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] apt questions - apt-cacher and /var/cache/apt/archives

2006-08-15 Thread david
On Tue, 2006-08-15 at 23:27 +1000, Peter Hardy wrote:
 On Tue, 2006-08-15 at 23:03 +1000, david wrote:
  Do the packages in /var/cache/apt/archives represent all the installed
  packages on a standard Ubuntu system?
 
 Unless you've removed packages, the contents of /var/cache/apt/archives
 represent every single package ever installed on that system, regardless
 of whether a package was subsequently removed, or replaced by an updated
 version.
 
 apt-get has a couple of commands for managing the package cache. apt-get
 clean will clear out the cache completely. autoclean is a little more
 intelligent. Check the apt-get man page for details.
 

Thanks for that. From the man page:

autoclean
 snip
 APT::Clean-Installed will prevent installed packages from being erased
if it is set to off.

How do I set APT::Clean-Installed? Google hasn't helped :(
Is this what I'm looking for?


  Can I use this as input to apt-cacher for the purposes of subsequently
  updating another box? Eg, breezy to dapper.
 
 I guess you could seed apt-cacher with the contents of one machine's
 package cache, yeah. But I've never used apt-cacher. :-)
 
 -- 
 Pete
 

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] apt questions - apt-cacher and /var/cache/apt/archives

2006-08-15 Thread Martin Barry
$quoted_author = david ;
 
 Do the packages in /var/cache/apt/archives represent all the installed
 packages on a standard Ubuntu system?
 
 Can I use this as input to apt-cacher for the purposes of subsequently
 updating another box? Eg, breezy to dapper.

try `aptitude autoclean` or `apt-get autoclean`

if you don't have any network level apt caching then i would rsync
/var/cache/apt/archives from the upgraded box to the to-be-upgraded box

if you are trying to sync installed packages, use `dpkg --get-selections` on
both and diff them.

cheers
marty

-- 
xterm The problem with America is stupidity. I'm not saying there should be a
capital punishment for stupidity, but why don't we just take the safety
labels off of everything and let the problem solve itself?

http://www.bash.org/?4753
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] apt questions - apt-cacher and /var/cache/apt/archives

2006-08-15 Thread Peter Hardy
On Wed, 2006-08-16 at 07:52 +1000, david wrote:
 On Tue, 2006-08-15 at 23:27 +1000, Peter Hardy wrote:
  On Tue, 2006-08-15 at 23:03 +1000, david wrote:
   Do the packages in /var/cache/apt/archives represent all the installed
   packages on a standard Ubuntu system?
  
  Unless you've removed packages, the contents of /var/cache/apt/archives
  represent every single package ever installed on that system, regardless
  of whether a package was subsequently removed, or replaced by an updated
  version.
  
  apt-get has a couple of commands for managing the package cache. apt-get
  clean will clear out the cache completely. autoclean is a little more
  intelligent. Check the apt-get man page for details.
  
 
 Thanks for that. From the man page:
 
 autoclean
  snip
  APT::Clean-Installed will prevent installed packages from being erased
 if it is set to off.
 
 How do I set APT::Clean-Installed? Google hasn't helped :(
 Is this what I'm looking for?

I'm not sure. What are you looking for? :-)

That needs to be in apt's config file, /etc/apt/apt.conf . You'd want to
add
APT::Clean-Installed false;

From the apt.conf manpage:
Clean-Installed
   Defaults to on. When turned on the autoclean feature will remove
   any packages which can no longer be downloaded from  the  cache.
   If  turned off then packages that are locally installed are also
   excluded from cleaning - but note that APT  provides  no  direct
   means to reinstall them.

It looks like turning it off will leave you with a cache that slightly
more accurately represents the packages that are installed on a machine
after doing an autoclean.

But if you're looking to mirror the installed package list on the box
you're upgrading, you'd want to do something like:

- On the first machine, run dpkg --get-selections  packagelist to get
the status of all installed (and removed) packages.
- Transfer packagelist to the second machine and run dpkg
--set-selections  packagelist to set the desired status of all of those
packages.
- Run apt-get dselect-upgrade , which will then go about
installing/removing things to change desired status to actual status.

Cheers,
-- 
Pete

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] apt questions - apt-cacher and /var/cache/apt/archives

2006-08-15 Thread david
Top posting because I'm re-explaining the problem, and btw, I've
searched debian.org and google  and can't seem to find the answers to
any of these questions:

I've found a thing called apt-cacher which looks like a nice simple way
to locally cache packages for upgrading other boxes. I've installed it
on my main desktop box, which had already been updated to Dapper. 

I want to seed apt-cacher so that I can use it as a source.list for
other upgrades. I think that means that I need to seed it with all the
currently installed Dapper packages, but presumably NOT any old
packages.

so... I'm thinking I should do:
 
#apt-get autoclean -o APT::Clean-Installed=off
#cp /var/cache/apt/archives/* /var/cache/apt-cacher/import/
#/usr/share/apt-cacher/apt-cacher-import.pl

then change my other boxes sources lists to point to apt-cacher on this
box - voila!

It sounds easy, but it also looks like a great way to screw up a
perfectly good install, so I'm looking for some advice/confirmation :)

many thanks...

David

PS: I notice that apt.conf is now apt.conf.d/ but I can't find any
description of how the various files work, or if there is a precedence
etc etc. Is there a howto or whatever?


On Wed, 2006-08-16 at 10:18 +1000, Peter Hardy wrote:
 On Wed, 2006-08-16 at 07:52 +1000, david wrote:
  On Tue, 2006-08-15 at 23:27 +1000, Peter Hardy 
  wrote:/usr/share/apt-cacher/apt-cacher-import.pl
   On Tue, 2006-08-15 at 23:03 +1000, david wrote:
Do the packages in /var/cache/apt/archives represent all the installed
packages on a standard Ubuntu system?
   
   Unless you've removed packages, the contents of /var/cache/apt/archives
   represent every single package ever installed on that system, regardless
   of whether a package was subsequently removed, or replaced by an updated
   version.
   
   apt-get has a couple of commands for managing the package cache. apt-get
   clean will clear out the cache completely. autoclean is a little more
   intelligent. Check the apt-get man page for details.
   
  
  Thanks for that. From the man page:
  
  autoclean
   snip
   APT::Clean-Installed will prevent installed packages from being erased
  if it is set to off.
  
  How do I set APT::Clean-Installed? Google hasn't helped :(
  Is this what I'm looking for?
 
 I'm not sure. What are you looking for? :-)
 /usr/share/apt-cacher/apt-cacher-import.pl
 That needs to be in apt's config file, /etc/apt/apt.conf . You'd want to
 add
 APT::Clean-Installed false;
 
 From the apt.conf manpage:
 Clean-Installed
Defaults to on. When turned on the autoclean feature will remove
any packages which can no longer be downloaded from  the  cache.
If  turned off then packages that are locally installed are also
excluded from cleaning - but note that APT  provides  no  direct
means to reinstall them.
 
 It looks like turning it off will leave you with a cache that slightly
 more accurately represents the packages that are installed on a machine
 after doing an autoclean.
 
 But if you're looking to mirror the installed package list on the box
 you're upgrading, you'd want to do something like:
 
 - On the first machine, run dpkg --get-selections  packagelist to get
 the status of all installed (and removed) packages.
 - Transfer packagelist to the second machine and run dpkg
 --set-selections  packagelist to set the desired status of all of those
 packages.
 - Run apt-get dselect-upgrade , which will then go about
 installing/removing things to change desired status to actual status.
 
 Cheers,
 -- 
 Pete
 

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html