LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 06-28-2017, 01:03 PM   #1
pedros
Member
 
Registered: May 2017
Posts: 85

Rep: Reputation: Disabled
How to create local repository with debian 9?


I copy the dvd set into /mnt. My method works with debian 8.5, but here are some messages when I run aptitude update in debian 9:
Get: 1 file:/mnt/01 stretch InRelease
Ign file:/mnt/01 stretch InRelease
Get: 42 file:/mnt/14 stretch Release [7,548 B]
Get: 43 file:/mnt/01 stretch Release.gpg
Ign file:/mnt/01 stretch Release.gpg
E: The repository 'file:/mnt/01 stretch Release' is not signed.

As a temporary fix, I used synaptic package manager to add each dvd to /etc/apt/sources.list.
I must now insert dvd to install a package. That is a lot of work, and clutters my space with extra hardware.
 
Old 06-29-2017, 07:06 AM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,627

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
Quote:
Originally Posted by pedros View Post
I copy the dvd set into /mnt. My method works with debian 8.5, but here are some messages when I run aptitude update in debian 9:
Get: 1 file:/mnt/01 stretch InRelease
Ign file:/mnt/01 stretch InRelease
Get: 42 file:/mnt/14 stretch Release [7,548 B]
Get: 43 file:/mnt/01 stretch Release.gpg
Ign file:/mnt/01 stretch Release.gpg
E: The repository 'file:/mnt/01 stretch Release' is not signed.

As a temporary fix, I used synaptic package manager to add each dvd to /etc/apt/sources.list.
I must now insert dvd to install a package. That is a lot of work, and clutters my space with extra hardware.
I am not entirely sure of your goals, but you might check these pages:
https://www.howtoforge.com/local_debian_ubuntu_mirror
https://www.debian.org/mirror/ftpmirror
 
Old 06-29-2017, 02:14 PM   #3
pedros
Member
 
Registered: May 2017
Posts: 85

Original Poster
Rep: Reputation: Disabled
Sorry for not being clear. Local means all inside my computer, No dvd, No internet. I re-phrase my question. How can I set up debian 9, so it will access the repository I copied onto my system, rather than ask for dvd or try to connect to internet?
 
Old 06-29-2017, 04:09 PM   #4
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
I've never done your method (it's not clear to me the details of your method), but my experience with the outside source http://www.deb-multimedia.org is that "is not signed" gives me a warning rather than an error. It continues to function just fine:

Code:
[...]
W: GPG error: http://www.deb-multimedia.org stretch InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5C808C2B65558117
W: The repository 'http://www.deb-multimedia.org stretch InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
What does your /etc/apt/sources.list look like? I don't know if this info will help troubleshoot your issue, but it might.

Anyway, not knowing what you're doing, my guess for a solution is to create virtual DVD drives with something like this:

Code:
dd if=/dev/cdrom of=/myimages/deb01.iso
mount -o loop -t iso9660 /myimages/deb01.iso /mnt/deb01
Hopefully, all of the names of the discs are already in your /etc/apt/sources.list, but maybe if not you'll have to tweak /etc/apt/sources.list also.

https://wiki.debian.org/DiskImage

I have never tried this sort of thing, though, so I have no idea whether it'll work...
 
Old 06-29-2017, 04:52 PM   #5
pedros
Member
 
Registered: May 2017
Posts: 85

Original Poster
Rep: Reputation: Disabled
deb cdrom:[Debian GNU/Linux 9.0.0 _Stretch_ - Official amd64 DVD Binary-6 20170617-13:08]/ stretch contrib main
deb cdrom:[Debian GNU/Linux 9.0.0 _Stretch_ - Official amd64 DVD Binary-14 20170617-13:08]/ stretch main
deb cdrom:[Debian GNU/Linux 9.0.0 _Stretch_ - Official amd64 DVD Binary-13 20170617-13:08]/ stretch contrib main
deb cdrom:[Debian GNU/Linux 9.0.0 _Stretch_ - Official amd64 DVD Binary-12 20170617-13:08]/ stretch contrib main
deb cdrom:[Debian GNU/Linux 9.0.0 _Stretch_ - Official amd64 DVD Binary-11 20170617-13:08]/ stretch contrib main
deb cdrom:[Debian GNU/Linux 9.0.0 _Stretch_ - Official amd64 DVD Binary-10 20170617-13:08]/ stretch contrib main
deb cdrom:[Debian GNU/Linux 9.0.0 _Stretch_ - Official amd64 DVD Binary-9 20170617-13:08]/ stretch contrib main
deb cdrom:[Debian GNU/Linux 9.0.0 _Stretch_ - Official amd64 DVD Binary-8 20170617-13:08]/ stretch contrib main
deb cdrom:[Debian GNU/Linux 9.0.0 _Stretch_ - Official amd64 DVD Binary-7 20170617-13:08]/ stretch contrib main
deb cdrom:[Debian GNU/Linux 9.0.0 _Stretch_ - Official amd64 DVD Binary-5 20170617-13:08]/ stretch contrib main
deb cdrom:[Debian GNU/Linux 9.0.0 _Stretch_ - Official amd64 DVD Binary-4 20170617-13:08]/ stretch contrib main
deb cdrom:[Debian GNU/Linux 9.0.0 _Stretch_ - Official amd64 DVD Binary-3 20170617-13:08]/ stretch contrib main
deb cdrom:[Debian GNU/Linux 9.0.0 _Stretch_ - Official amd64 DVD Binary-2 20170617-13:08]/ stretch contrib main
deb cdrom:[Debian GNU/Linux 9.0.0 _Stretch_ - Official amd64 DVD Binary-1 20170617-13:08]/ stretch main
deb file:/mnt/01/ stretch main contrib
deb file:/mnt/02/ stretch main contrib
deb file:/mnt/03/ stretch main contrib
deb file:/mnt/04/ stretch main contrib
deb file:/mnt/05/ stretch main contrib
deb file:/mnt/06/ stretch main contrib
deb file:/mnt/07/ stretch main contrib
deb file:/mnt/08/ stretch main contrib
deb file:/mnt/09/ stretch main contrib
deb file:/mnt/10/ stretch main contrib
deb file:/mnt/11/ stretch main contrib
deb file:/mnt/12/ stretch main contrib
deb file:/mnt/13/ stretch main contrib
deb file:/mnt/14/ stretch main contrib
 
Old 06-29-2017, 05:20 PM   #6
pedros
Member
 
Registered: May 2017
Posts: 85

Original Poster
Rep: Reputation: Disabled
The post above is my current /etc/apt/sources.list. When I get things working, I will delete the cdrom lines. I have tried the method of using dvd iso image for repository. And I think I saved my notes somewhere. As I recall, it did work, but it needed to extract every time I used it. So I figure it is better to have a repository with the files and folders copied from dvd onto the system. Here are my notes for Debian 8.5 setup. It worked for debian 8.5, but not for 9.

add to favoriets= terminal.

1. prepare location /mnt/ to copy and store repository.
su; chmod a+rwx /mnt/;
mkdir /mnt/01/ /mnt/02/ /mnt/03/ /mnt/04/ /mnt/05/ /mnt/06/ /mnt/07/ /mnt/08/ /mnt/09/ /mnt/10/ /mnt/11/ /mnt/12/ /mnt/13/;

2. copy repository from dvd to /mnt/.
Use gui eject command to eject cd. Do not push physical eject button. Do not use bash eject command.
cp -r -T /media/cdrom0/ /mnt/01/;
cp -r -T /media/cdrom0/ /mnt/02/;
cp -r -T /media/cdrom0/ /mnt/03/;
cp -r -T /media/cdrom0/ /mnt/04/;
cp -r -T /media/cdrom0/ /mnt/05/;
cp -r -T /media/cdrom0/ /mnt/06/;
cp -r -T /media/cdrom0/ /mnt/07/;
cp -r -T /media/cdrom0/ /mnt/08/;
cp -r -T /media/cdrom0/ /mnt/09/;
cp -r -T /media/cdrom0/ /mnt/10/;
cp -r -T /media/cdrom0/ /mnt/11/;
cp -r -T /media/cdrom0/ /mnt/12/;
cp -r -T /media/cdrom0/ /mnt/13/;

3. Tell system where repository is.
su; chmod a+rwx /etc/apt/sources.list;
copy and paste this data.
deb file:/mnt/01/ jessie main contrib
deb file:/mnt/02/ jessie main contrib
deb file:/mnt/03/ jessie main contrib
deb file:/mnt/04/ jessie main contrib
deb file:/mnt/05/ jessie main contrib
deb file:/mnt/06/ jessie main contrib
deb file:/mnt/07/ jessie main contrib
deb file:/mnt/08/ jessie main contrib
deb file:/mnt/09/ jessie main contrib
deb file:/mnt/10/ jessie main contrib
deb file:/mnt/11/ jessie main contrib
deb file:/mnt/12/ jessie main contrib
deb file:/mnt/13/ jessie main contrib
su; aptitude update;

4. copy gutenberg to location /mnt/.
mkdir /mnt/pgdvd042010/;
cp -r -T /media/r/seagate/a/document/gutenberg/pgdvd042010/ /mnt/pgdvd042010/;

5. copy /mnt/ from this system to another system.
su; chmod a+rwx /media/r/dbb9214e-3161-4596-8225-1ac0d60d9f93/mnt/;
cp -r /mnt/ /media/r/dbb9214e-3161-4596-8225-1ac0d60d9f93/;
 
Old 07-01-2017, 04:34 AM   #7
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
I'll admit that this is outside of my familiarity. I do think that maybe my suggested solution might work, though. Basically, the way I suggest mounting the image files should hopefully make them look like optical drive devices to apt.

In other words, the sources.list would have only the original "deb cdrom" lines, and the method of mounting the image files will make the system think of them as a bunch of cdrom drives with the desired discs loaded.
 
Old 07-03-2017, 12:11 AM   #8
pedros
Member
 
Registered: May 2017
Posts: 85

Original Poster
Rep: Reputation: Disabled
It works. Here are some final questions.

Thanks to IsaacKuo, Senior Member, who gave me this idea. It works. See the bottom of this post for final questions and notes. Later, I plan to tag this as solved. How to create a local repository in debian 9.0.0:

1. Create target directory structure.
Code:
su; chmod a+rwx /mnt/;
mkdir -p /mnt/iso/ /mnt/extract/01/ /mnt/extract/02/ /mnt/extract/03/ /mnt/extract/04/ /mnt/extract/05/ /mnt/extract/06/ /mnt/extract/07/ /mnt/extract/08/ /mnt/extract/09/ /mnt/extract/10/ /mnt/extract/11/ /mnt/extract/12/ /mnt/extract/13/ /mnt/extract/14/;
2. Get repository in iso format. I use brasero to copy dvd. Brasero is on dvd1 and is installed by default.

3. Copy repository to target directory.
Code:
cp *.iso /mnt/iso/;
4.
Code:
su; chmod a+rwx /etc/fstab;
copy and paste this into /etc/fstab.
Code:
/mnt/iso/01.iso /mnt/extract/01/ udf,iso9660 loop 0 0
/mnt/iso/02.iso /mnt/extract/02/ udf,iso9660 loop 0 0
/mnt/iso/03.iso /mnt/extract/03/ udf,iso9660 loop 0 0
/mnt/iso/04.iso /mnt/extract/04/ udf,iso9660 loop 0 0
/mnt/iso/05.iso /mnt/extract/05/ udf,iso9660 loop 0 0
/mnt/iso/06.iso /mnt/extract/06/ udf,iso9660 loop 0 0
/mnt/iso/07.iso /mnt/extract/07/ udf,iso9660 loop 0 0
/mnt/iso/08.iso /mnt/extract/08/ udf,iso9660 loop 0 0
/mnt/iso/09.iso /mnt/extract/09/ udf,iso9660 loop 0 0
/mnt/iso/10.iso /mnt/extract/10/ udf,iso9660 loop 0 0
/mnt/iso/11.iso /mnt/extract/11/ udf,iso9660 loop 0 0
/mnt/iso/12.iso /mnt/extract/12/ udf,iso9660 loop 0 0
/mnt/iso/13.iso /mnt/extract/13/ udf,iso9660 loop 0 0
/mnt/iso/14.iso /mnt/extract/14/ udf,iso9660 loop 0 0
5.
Code:
su; chmod a+rw /etc/apt/sources.list;
copy and paste this into /etc/apt/sources.list
Code:
deb file:/mnt/extract/01/ stretch main contrib
deb file:/mnt/extract/02/ stretch main contrib
deb file:/mnt/extract/03/ stretch main contrib
deb file:/mnt/extract/04/ stretch main contrib
deb file:/mnt/extract/05/ stretch main contrib
deb file:/mnt/extract/06/ stretch main contrib
deb file:/mnt/extract/07/ stretch main contrib
deb file:/mnt/extract/08/ stretch main contrib
deb file:/mnt/extract/09/ stretch main contrib
deb file:/mnt/extract/10/ stretch main contrib
deb file:/mnt/extract/11/ stretch main contrib
deb file:/mnt/extract/12/ stretch main contrib
deb file:/mnt/extract/13/ stretch main contrib
deb file:/mnt/extract/14/ stretch main contrib
6. Mount all filesystems mentioned in fstab. As directed in /etc/fstab, extract from /mnt/iso/*.iso into /mnt/extract/*/.
Code:
su; mount -a;
# mount: /dev/loop1 is write-protected, mounting read-only

7. Tell system about new repository.
Code:
su; apt-get update;
warning. Some permissions were changed to liberal.

Questions.
It is strange that extract from iso works, but copy from dvd does not. Explain please?
I said that the mount command extracts. Perhaps a better word is link?
why is apt-update not on dvd1? Is it replaced by something else on debian 9?
Why does my origional method work on debian 8, but not 9?
apt-secure(8) manpage says insecure repositories are strongly discouraged. So offline, how do I make it secure? I hear this can not be done.

to try.
apt-secure(8) manpage says Individual repositories can also be allowed to be insecure via the sources.list(5) option allow-insecure=yes.

Origional suggestion from IsaacKuo, Senior Member.
dd if=/dev/cdrom of=/myimages/deb01.iso
mount -o loop -t iso9660 /myimages/deb01.iso /mnt/deb01

note on boot. It seems this procedure is a one-time setup. It keeps its settings.

note from sources.list. Do not list the raw iso file.
deb file:/mnt/iso/01.iso stretch main contrib
File not found - /mnt/iso/01.iso/dists/stretch/main/binary-amd64/Packages (20: Not a directory)

note from apt-get update.
W: The repository 'file:/mnt/extract/01 stretch Release' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
 
1 members found this post helpful.
Old 07-03-2017, 12:56 PM   #9
pedros
Member
 
Registered: May 2017
Posts: 85

Original Poster
Rep: Reputation: Disabled
Another thing. Install apt-get update before step 5. And I think you can still post to this thread even after it is marked as solved.
 
1 members found this post helpful.
Old 07-03-2017, 01:58 PM   #10
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
There is a set of scripts called "ftpsync" to make a debian mirror. I don't think the DVDs will have everything a mirror does. You can't just dump the files together. They have to be in certain directory structure.

The sources.list entry is like this:
Code:
deb file:///mnt/mirror/debian/ stretch main contrib non-free
 
Old 07-04-2017, 01:27 AM   #11
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
Cool, thanks for the how-to! Like I said, this is far outside my familiarity. I'm used to having an internet connection, and not having a full set of install discs. So it just never occurs to me to care about the cdrom lines of /etc/apt/sources.list
 
  


Reply



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
How to create a local repository? hack3rcon Fedora 3 05-08-2016 11:11 PM
How to create a local repository? chipperfield Linux - Newbie 6 04-14-2010 12:04 AM
can i create a local yum repository? Sharaz Linux - General 5 01-21-2008 01:51 PM
Faluire to create local repository JackieBrown Debian 1 08-22-2006 06:39 PM
how to create a local apt repository bakwas_internet Fedora 3 01-19-2004 02:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 08:01 PM.

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