Public bug reported:

Today I made the decision that, since I have three machines that run
Kubuntu, I should create local repositories of all of my recently-
installed Edgy and Dapper packages, in order to save the Ubuntu team a
little bit of bandwidth.  In the process, I discovered that Edgy seems
to be unwilling to use my local repository, while the Dapper box is
content with the idea.

In /etc/apt/sources.list, one can find the following line, which would
normally be uncommented, enabling the Universe repository:

deb http://us.archive.ubuntu.com/ubuntu edgy universe

If I enable this line (and do an 'apt-get update'), apt-get then refuses
to use my local repository.  However, if I disable that line and update
again, apt-get is quite happy to use my local repository.

Both the Edgy and Dapper repositories were created, by root, as follows:

1. Make a directory someplace to store the .deb files.  I chose
/data/Software/Edgy and  /data/Software/Dapper, which sit on an NFS
share on my fileserver.  Permissions are 755 for the directories and
their parent, and root owns them all.

2. Using the Edgy machine, move all .deb files from
/var/cache/apt/archives over to the new Edgy repository directory.  Do
the same on the Dapper machine, to populate it's repository.
Permissions are 644 on all files, and root owns everything.

3. On both machines, add the following line to the beginning of your
usual /etc/apt/sources.list :

deb file:///data/Software/Edgy ./

4. Do an 'apt-get update' on both machines to make the changes take
effect.

5. Run the following script (without the horizontal lines of course) to
create Edgy's Packages.gz file:

------------------------
#!/bin/bash

pushd .
cd /data/Software/Edgy
rm /data/Software/Edgy/Packages.gz
cp /var/cache/apt/archives/*.deb /data/Software/Edgy 
rm /var/cache/apt/archives/*.deb
dpkg-scanpackages ./ /dev/null |gzip -9c > /data/Software/Edgy/Packages.gz
apt-get update
popd
-----------------------

The script for the Dapper machine is constructed the same way, and can
be found at the end of this message.

You'll notice that, aside from the odd way I chose to 'move' the files
to my repository, the last 'real' command performs another 'apt-get
update', to put the newly-created Packages.gz file into use.

To test whether or not my local repository was being used, I did the
following simple test on both machines:

1. apt-get remove xine-ui  (could be any other package with few or no
programs that require it)

2. Verify that /var/cache/apt/archives does not contain a xine-ui
package of any sort.

3. Verify that /data/Software/Edgy contains the exact package also
present on the Ubuntu server.

4. apt-get install xine-ui

I also checked using this command:

apt-get install --print-uris xine-ui

The above procedure agrees with the result of this last apt-get command
- disabling the aforementioned line in sources.list allows my local
repository to be used on the Edgy box, while the Dapper box seems to
work fine with that line enabled.

It almost seems like the Ubuntu server in question is sending something
down the line telling apt-get to, essentially, override and ignore the
local repository for the Edgy machine.

After some fairly thorough searching and comparing both machines'
configurations, I found only two differences in the way apt is
configured:

1.  The Edgy box has a file named /etc/apt/apt.conf.d/01ubuntu which is
not present on the Dapper box at all, and which contains the following
(minus the horizontal lines):

-----------------------------
APT
{
  NeverAutoRemove  
  { 
        "^linux-image.*";  
        "^linux-restricted-modules.*";
  };

  Install-Recommends-Section "metapackages";
};
-----------------------------

2.  The Dapper box has an /etc/apt/apt.conf , which is not present at
all on the Edgy box, containing a single line:

Acquire::http::Proxy "false";

Out of fear of breaking my system, I have explicitly avoided altering
the contents of any apt configuration file other than
/etc/apt/sources.list.

Otherwise, the two machines' apt configurations appear to be identical,
save for necessary differences in the two machines'
/etc/apt/sources.list files.  Here's the Edgy box:

-----------------------------
# Pull from the local Edgy repos on Stork
deb file:///data/Software/Edgy ./

## Uncomment the following two lines to fetch updated software from the network
deb http://us.archive.ubuntu.com/ubuntu edgy main restricted
deb-src http://us.archive.ubuntu.com/ubuntu edgy main restricted

## Uncomment the following two lines to fetch major bug fix updates produced
## after the final release of the distribution.
deb http://us.archive.ubuntu.com/ubuntu edgy-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu edgy-updates main restricted

## Uncomment the following two lines to add software from the 'universe'
## repository.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.

deb http://us.archive.ubuntu.com/ubuntu edgy universe
deb-src http://us.archive.ubuntu.com/ubuntu edgy universe

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu edgy-backports main restricted universe 
multiverse
deb-src http://us.archive.ubuntu.com/ubuntu edgy-backports main restricted 
universe multiverse

deb http://security.ubuntu.com/ubuntu edgy-security main restricted
deb-src http://security.ubuntu.com/ubuntu edgy-security main restricted

deb http://security.ubuntu.com/ubuntu edgy-security universe
deb-src http://security.ubuntu.com/ubuntu edgy-security universe
---------------------------------

And here is the Dapper box:

--------------------------------
# Pull from local Dapper repos on Stork
deb file:///data/Software/Dapper ./

## Uncomment the following two lines to fetch updated software from the
network

deb http://us.archive.ubuntu.com/ubuntu/ dapper main restricted 
deb-src http://us.archive.ubuntu.com/ubuntu/ dapper main restricted 

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ dapper-updates main restricted 
deb-src http://us.archive.ubuntu.com/ubuntu/ dapper-updates main restricted 

## Uncomment the following two lines to add software from the 'universe'
## repository.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://us.archive.ubuntu.com/ubuntu/ dapper universe 
deb-src http://us.archive.ubuntu.com/ubuntu/ dapper universe 

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ dapper-backports main restricted 
universe multiverse 
deb-src http://us.archive.ubuntu.com/ubuntu/ dapper-backports main restricted 
universe multiverse 

deb http://security.ubuntu.com/ubuntu dapper-security main restricted 
deb-src http://security.ubuntu.com/ubuntu dapper-security main restricted 

deb http://security.ubuntu.com/ubuntu dapper-security universe 
deb-src http://security.ubuntu.com/ubuntu dapper-security universe 

# KDE 3.5.4
deb http://kubuntu.org/packages/kde-354 dapper main
----------------------------------

Just to make sure I didn't leave anything out, here's a complete copy of
the script on the Dapper box that generates Packages.gz:

---------------------------------
#!/bin/bash

pushd .
cd /data/Software/Dapper
rm /data/Software/Dapper/Packages.gz
cp /var/cache/apt/archives/*.deb /data/Software/Dapper
rm /var/cache/apt/archives/*.deb
dpkg-scanpackages ./ /dev/null |gzip -9c > /data/Software/Dapper/Packages.gz
apt-get update
popd
---------------------------------

** Affects: Ubuntu
     Importance: Undecided
         Status: Unconfirmed

-- 
Edgy web repository overrides local repository
https://launchpad.net/bugs/66203

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to