Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When we run apt-get update ubuntu read URLS from /etc/apt/sources.list and package information save in /var/lib/apt/lists.

Can i customize this directories? Without harm /var/apt/lists and /etc/apt/sources.list. When I want to install a package using apt-get it will read package information from a specific directory (/custom/apt/lists) instead of /var/lib/apt/lists and update from /custom/apt/sources.list instead of /etc/apt/sources.list.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Yes, you can, the two things you are looking for are:

  • The equivalent to /etc/apt/sources.list.d/* is Dir::Etc::SourceParts.
  • The /etc/apt/sources.list equivalent is Dir::Etc::SourceList
  • The /var/lib/apt/lists/ equivalent is Dir::State::Lists

There are a bunch of them in the apt-get man page. An example using all of them:

apt-get update -o Dir::Etc::SourceParts "/some/path/with/lists/" -o Dir::Etc::SourceList "some.list" -o Dir::State::Lists "/custom/apt/lists"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.