5

On my Ubuntu server 16.04 I have following entries in /etc/apt/sources.list

deb [arch=amd64 trusted=yes] file:/home/discoprodigy /debbin main  

For good measure, I have also tried restricted, universe and multiverse. There are no other entries in this file. And /etc/apt/sources.list.d is empty.

In /home/discoprodigy/debbin

152 miscellaneous .deb files
Packages.gz
Packages (plain text file)

Just for fun, I also have in /home/discoprodigy/debbin/main/binary-amd64

Packages.gz
Packages (plain text file)

Then I execute:

sudo apt-get update

And this is the result

Get:1 file:/home/discoprodigy /debbin InRelease
Ign:1 file:/home/discoprodigy /debbin InRelease
Get:2 file:/home/discoprodigy /debbin Release
Ign:2 file:/home/discoprodigy /debbin Release
Get:3 file:/home/discoprodigy /debbin/main amd64 Packages
Ign:3 file:/home/discoprodigy /debbin/main amd64 Packages
Get:4 file:/home/discoprodigy /debbin/main all Packages
Ign:4 file:/home/discoprodigy /debbin/main all Packages
  |
etc. etc.
  |
Get:3 file:/home/discoprodigy /debbin/main amd64 Packages
Err:3 file:/home/discoprodigy /debbin/main amd64 Packages
  File not found - /home/discoprodigy/dists//debbin/main/binary-amd64/Packages (2: No such file or directory)
Get:4 file:/home/discoprodigy /debbin/main all Packages
Ign:4 file:/home/discoprodigy /debbin/main all Packages
Reading package lists... Done
N: Ignoring file '20auto-upgrades.ucf-dist' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
E: Failed to fetch file:/home/discoprodigy/dists//debbin/main/binary-amd64/Packages  File not found - /home/discoprodigy/dists//debbin/main/binary-amd64/Packages (2: No such file or directory)
E: Some index files failed to download. They have been ignored, or old ones used instead.

I have also tried what is suggested here Ubuntu 16.04 apt-get update doesn't work with local repository but to no avail.

Update: Following user.dz's suggestion, apt-get update is "successful", but now when I try apt-get install openssh-server I get:

Err:1 file:/home/discoprodigy debbin/ ncurses-term 6.0+20160213-1ubuntu1 File not found - /home/discoprodigy/debbin/ncurses-term_6.0+20160213-1ubuntu1‌​_all.deb (2: No such file or directory) 

But the file is there.

$ ls -l /home/discoprodigy/debbin/ncurses-term_6.0+20160213-1ubuntu1_all.deb
-rw-rw-r-- 1 discoprodigy discoprodigy 249166 Nov 24 15:08 /home/discoprodigy/debbin/ncurses-term_6.0+20160213-1ubuntu1_all.deb

Update: I cleared the files status and available in /var/lib/dpkg and ran apt-get update and then apt-get install openssh-server

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 openssh-server : Depends: libaudit1 (>= 1:2.2.1) but it is not installable
                  Depends: libc6 (>= 2.17) but it is not going to be installed
                         | 
                      etc. etc. 
                         | 
                  Recommends: ncurses-term but it is not going to be installed
                  Recommends: ssh-import-id but it is not going to be installed
N: Ignoring file '20auto-upgrades.ucf-dist' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
E: Unable to correct problems, you have held broken packages.

dpkg --get-selections | grep hold did however not report any held packages.

Update: As per user.dz's request:

stat -c "%A %G %U %n" /home/ /home/discoprodigy/ /home/discoprodigy/debbin/
drwxrwxr-x discoprodigy discoprodigy /home/
drwxrwxr-x discoprodigy discoprodigy /home/discoprodigy/
drwxrwxr-x discoprodigy discoprodigy /home/discoprodigy/debbin/

1 Answers1

4
  • As I remember, when I have setup my trivial local repository. I used this form

    ##LOCAL
    deb file:///path-to-parent-of-packages-folder packages-folder/
    
    ##LAN using HTTP server
    deb http://ip-address packages-folder/
    
    ##LAN using HTTP server & mDNS (Avahi)
    deb http://machine-name.local packages-folder/
    
  • Hence your setup should be with this line:

    deb [arch=amd64 trusted=yes] file:///home/discoprodigy debbin/
    

    or

    deb [arch=amd64 trusted=yes] file:///home/discoprodigy/debbin ./
    

Reference: Debian Wiki: How to setup a trivial archive

user.dz
  • 48,105
  • 1
    Thank you. You are the best, I was staring myself blind on this. And on ubuntu "///" vs "/" seems to make no difference. – G.Flemming Nov 26 '16 at 07:33
  • After trying to apt-get install openssh-server i now get:

    Err:1 file:/home/discoprodigy debbin/ ncurses-term 6.0+20160213-1ubuntu1 File not found - /home/discoprodigy/debbin/ncurses-term_6.0+20160213-1ubuntu1_all.deb (2: No such file or directory)

    But the file is there.

    – G.Flemming Nov 26 '16 at 08:29
  • Could you [edit] the question and add updates there, that's more cleaner then using comment, and coming reader can follow easily. Also add the output of ls -l /home/discoprodigy/debbin/ncurses-term_6.0+20160213-1ubuntu1‌​_all.deb . BTW, for /// I just like the canonical form file:// protocol + / root folder. If it was helpful, no need to thank comment, just vote it up :), see why https://askubuntu.com/help/why-vote – user.dz Nov 26 '16 at 11:27
  • I have edited as per your suggestion. It was helpful in the sense that apt-get update retorted "success", but I don't believe it since it can't find the dependency files. I would like to vote you up, but I'm told by the system I'm still a low-life and therefore not allowed to vote :-( – G.Flemming Nov 26 '16 at 13:01
  • @G.Flemming , :) no problem i forget the threshold for voting is 15, never mind. Could you add this output to check parent folders permissions. stat -c "%A %G %U %n" /home/ /home/discoprodigy/ /home/discoprodigy/debbin/ – user.dz Nov 26 '16 at 13:26
  • as per your request, kindly see above update – G.Flemming Nov 26 '16 at 13:45
  • :/ seems fine, just a note about /home it should be owned by root. Anyway could post output of this command in this link to http://paste.ubuntu.com – user.dz Nov 26 '16 at 13:55
  • please find the output here. Regarding root ownership, I know, but I'm working on a custom preseed for the server, and since it doesn't install openssh-server it's a pain to work with. So I'm working off my Desktop, the problems are the same, but it's easier to copy/paste etc. – G.Flemming Nov 26 '16 at 14:30
  • @G.Flemming Why you have cleared /var/lib/dpkg/status? Now, your system does not which packages are already installed and which are not. To dpkg now, it has nothing installed – user.dz Nov 26 '16 at 15:06
  • i cleared exactly for that reason, but obviously I have the original file which will be reinstated when this works i.e. installing openssh-server. I don't understand what you mean by "To dpkg now, it has nothing installed" ? – G.Flemming Nov 26 '16 at 15:15
  • @G.Flemming, I mean that's why you get those errors for unmet dependencies. After removing /var/lib/dpkg/status, apt/dpkg has nothing installed in the list, so apt will try to download not just additional dependencies of openssh-server but all dependencies (even the ones installed previously when you install ubuntu). However, those are not in your local repo (and of course, official repo's are disabled) – user.dz Nov 26 '16 at 15:24
  • 1
    it works now, the key was when u said "but all dependencies" i.e. dependencies of dependencies of...etc.. which is a new concept to me coming from a MS world. To show my appreciation, ping me anytime if you need help with preseeding, I have done it a couple of hundred times by now :) And when I get my merit badge here, I will vote you up. – G.Flemming Nov 26 '16 at 16:40
  • @G.Flemming, thank you. I encourage you too to help others in that by following that tag , many question were passed unanswered . https://askubuntu.com/questions/tagged/preseed?sort=newest&pageSize=50 . Also you may create self-answered question for the issues you have solved yourself. They will help many users that don't even try to ask, help raise you rep, and your questions get importance. Have nice time. – user.dz Nov 26 '16 at 17:13