In order to use my local .deb packages, I have to alter the file "/etc/apt/sources.list" as follows:

deb file:/home/mary mydebs/

The line above means that the repository is my local directory /home/mary/mydebs in which include all my .deb packages.

But I cannot do this operation and execute "apt-get update" command because I cannot get root right. Now I want to create my own sources.list under any suitable directory such as /home/mary/ and make it work like what /etc/apt/source.list does. Is there any method?

Thanks a lot!

  • what do you mean by "I cannot get root right"? You should be the root and you can't gain it back or the root it someone else? – shellholic Nov 22 '10 at 16:21
  • If you are following a HOWTO or something to build your local repository can you give us the link, and tell us where you are having problems? – Zoredache Nov 22 '10 at 17:32

What tools are you using to build your local repository, or are you using any tools yet?

A list of tools and some documentation can be found in the Debian wiki. There is also the old repository HOWTO which is worth reading to get an idea of some of the concepts. The most basic tool is dpkg-scanpackages, which is a tool that looks through a tree of Debian binary packages and creates the required Packages file.


Even if you had your own sources.list, apt-get or aptitude still needed to access files in /var/lib/dpkg/ which are only accessible for the superuser.

If it's your system, use sudo or su to gain superuser privileges. If it's not your system it's probably better if you don't.

  • I am 90% sure that Mary isn't talking about privileges, rather the difficulty is formatting the sources.list line correctly to point at a local repository, or perhaps properly structuring the repository. – Zoredache Nov 22 '10 at 17:33
  • Yes, I am not talking about privileges. I cannot change the fact that I am not the root and I even cannot use sudo to gain superuser privileges. Because this is the limitation my company provide. I mainly refer to the manual in the website: debian.org/doc/manuals/apt-howto/index.en.html#contents. – user60542 Nov 23 '10 at 5:39
  • I generate my own .deb package by consulting chapter 4 of this manual. Then create my own repository and edit sources.list as the steps introduced in chapter 2.2 of this manual. It indeed adpot the tool dpkg-scanpackages. But I cannot edit /etc/apt/sources.list because privilege problem. – user60542 Nov 23 '10 at 5:39
  • So I have the question if there is method to create my own sourses.list file in other directory and it has the same effect with the original sourses.list in directory /etc/apt. Then I will have the write privileges to this file. – user60542 Nov 23 '10 at 5:48
  • No, there isn't. As I already said: You don't have the necessary privileges as a normal user. You need superuser privileges for that kind of action. – joschi Nov 27 '10 at 6:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy