Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Ubuntu This forum is for the discussion of Ubuntu Linux.


  Search this Thread
Old 09-04-2005, 12:55 PM   #1
Registered: Apr 2004
Location: India
Distribution: Ubuntu
Posts: 364

Rep: Reputation: 30
Question how do I add a local folder as a repository?

Is there any way I can add a location on my disk such as "/home/akudewan/debs/" as an apt repository? I searched a lot, but didn't find anything.
Old 09-04-2005, 05:39 PM   #2
Registered: Jun 2004
Location: Denton
Distribution: debian, freebsd
Posts: 121

Rep: Reputation: 15
to manually install .deb files that you have downloaded, it is best to simply use dpkg.

dpkg i my_deb_package.deb
Old 09-05-2005, 02:35 AM   #3
Registered: Apr 2004
Location: India
Distribution: Ubuntu
Posts: 364

Original Poster
Rep: Reputation: 30
Talking Hurray, I got it working :)

Thanks fenderman11111. But I managed to get the repository working

This is how I did it. First off, I created a local directory, where I store nothing but .deb packages. For me, this was /home/akudewan/repository/debs/

Next, I created a "Packages" file, that holds info to all packages in the repository. To do this, I used the command:
dpkg-scanpackages /home/akudewan/repository/debs/ /dev/null > /home/akudewan/repository/debs/Packages
Now, I created a backup of my apt sources, just incase.
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
Next, edit the /etc/apt/sources.list file and add the line:
deb file:///home/akudewan/repository/debs ./
Then I was getting an error when using apt, so I had to do this:
sudo ln -s /home/akudewan/repository/debs/Packages /var/lib/apt/lists/_home_akudewan_repository_debs_._Packages
(Note: Just use underscores(_) instead of / and link your Packages file)

When I ran synaptic after this, everything was working file. But I noticed that the "Packages" file has to be updated whenever you add new packages. So I made a shellscript to do this
sudo gedit /usr/local/bin/deblocalupdt
Put in the line:
dpkg-scanpackages /home/akudewan/repository/debs/ /dev/null > /home/akudewan/repository/debs/Packages
Make the file executable:
sudo chmod a+x /usr/local/bin/deblocalupdt
Now every time I add new packages in the repository, I just have to run "deblocalupdt"



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
want to set up local yum repository linmix Linux - Software 4 04-23-2013 04:42 AM
How do I add a local directory as an YaST repository. simjii SUSE / openSUSE 4 04-03-2006 11:07 AM
how to create a local apt repository bakwas_internet Fedora 3 01-19-2004 03:14 AM
How do I build a local repository using apt (RH 9) ? hadding Linux - Newbie 3 10-27-2003 01:38 AM
How to build a local repository with apt (RH 9) ? hadding Red Hat 3 10-27-2003 01:36 AM

All times are GMT -5. The time now is 05:42 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration