apt-get update for SINGLE source?

Asked by danmb

I have an extremely slow net connection. apt-get update tries to update all the sources in /etc/apt/sources.list.*. Yet I only need to update because my PPA has finished building a new package.

Is there a way to restrict apt-get update (or its equivalents) to a SINGLE source?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu update-manager Edit question
Assignee:
No assignee Edit question
Solved by:
Eliah Kagan
Solved:
Last query:
Last reply:
Revision history for this message
Sam_ (and-sam) said :
#1

You could for example uncheck multiverse or universe repo.
https://help.ubuntu.com/community/Repositories/Ubuntu#Ubuntu%20Software%20Tab

Or uncheck third party, such as ppa.
https://help.ubuntu.com/community/Repositories/Ubuntu#Third-Party%20Software%20Tab

System administration -> software sources

Revision history for this message
danmb (danmbox) said :
#2

I want to update the dpkg info for my own PPA (which has built a new package).

If I disable various sources and the apt-get update, I lose all info for packages from those sources, including possible dependencies for the newly built package in my PPA.

So this is far from usable. I need to refresh dpkg's idea of what's available in my PPA, without having it forget about universe / multiverse / other PPA's.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

If the version number is later, your repo will be used as there is a new version of the app in your listed sources

Revision history for this message
mycae (mycae) said :
#4

Dan:

You could trick aptitude by specifying a localhost URL for the main/universe sources, and set up a local site with a fixed release gz file.

It would be a little bit of effort (not a *lot*, but some), if you did not know how to set up a working repo

Revision history for this message
Best Eliah Kagan (degeneracypressure) said :
#5

If you're willing to go to that kind of effort, you might prefer to instead use netfilter to block access to all sites providing repository information except the site (i.e. Launchpad) providing package information about your PPA. Then when you run "apt-get update" it will only be able to update the packages that you want updated. That would probably be easier than setting up a local repository.

Of course, if you're willing to go to great lengths, then you might consider researching the matter a bit more to see if there is an elegant solution, and if not, writing and submitting a patch to apt, so that it gets this functionality.

Revision history for this message
danmb (danmbox) said :
#6

Eliah Kagan's answer seems to be the simplest. but it has a problem. While apt doesn't forget the package information for the blocked sources, it does lose their authentication. So after un-blocking, if I try to install a package from the formerly blocked sources, I get

Install these packages without verification [y/N]?

I suppose I could live with that... Perhaps there's even a way to save the authenticated / unauthenticated state of packages (or sources, I'm not sure how it works) and then restore that.

Revision history for this message
danmb (danmbox) said :
#7

Thanks Eliah Kagan, that solved my question.

Revision history for this message
danmb (danmbox) said :
#8

Thanks to those who proposed other solutions as well. It seems to me that, if you set up a local repository, you might as well save and then restore all files related to the "unwanted" sources (I'm not quite sure how apt works, but I see files corresponding to sources.list entries in /var/lib/apt)

Revision history for this message
Sam_ (and-sam) said :
#9

> my own PPA

Ok, this makes a difference of course.
Maybe this helps regarding verification. (Overview guide is on the bottom of this page.)
https://help.launchpad.net/Packaging/UploadErrors
https://help.launchpad.net/Packaging/PPA