How to quickly create a local apt repository for random packages using a Debian based linux distribution?
Clash Royale CLAN TAG#URR8PPP
up vote
18
down vote
favorite
Some situations call for manually installing a local package using dpkg -i <packagename>
. Sometimes it may be further useful to leverage the functionality of apt
with that package so the question is:
How do you quickly create a local repository for random packages using a Debian based linux distribution - like Xubuntu 13.04/Ubuntu?
debian package-management apt
 |Â
show 3 more comments
up vote
18
down vote
favorite
Some situations call for manually installing a local package using dpkg -i <packagename>
. Sometimes it may be further useful to leverage the functionality of apt
with that package so the question is:
How do you quickly create a local repository for random packages using a Debian based linux distribution - like Xubuntu 13.04/Ubuntu?
debian package-management apt
Just FYI. The usual thing is to followdpkg -i <packagename>
withapt-get -f install
to pull in required packages. Also, the usual thing to create an apt repos for Debian is reprepro.
â Faheem Mitha
Aug 17 '13 at 17:38
I've found reprepro helpful
â Gilles
Aug 17 '13 at 21:11
Thank you for your comments. @Faheem Mitha: can you please briefly expand on why runningapt
with--fix-broken
would be required after installing a local package withdpkg -i
? Wouldn't dpkg take care of that? I read it may be required the first time apt is run? @FM&Gilles: About reprepro. Seems useful if I could get it to work (not sure about dir struct, contents of 3 files or params at runtime). Will try again and update or post full question.
â jus cogens prime
Aug 18 '13 at 3:49
1
@illuminà :dpkg
does not resolve dependencies, butapt
does.dpkg
will warn of broken dependencies, but is low level, so will not attempt to fix them. Thedpkg -i *.deb
followed byapt-get -f install
is standard procedure. There is a wishlist bug to haveapt
itself handle the case of local package installation, and there is even a patch, I think, but it has not yet been implemented. See apt-get install could install local package files, too, originally filed in 1999.
â Faheem Mitha
Aug 18 '13 at 8:39
@illuminà Expressing interest in this feature will not hurt. I think the more people who (politely) express interest, the more likely it is that it will be implemented. Note also that gdebi is an alternative, as noted in the bug report. That is part of the reason it has not been implemented, I think. Though having such core functionality part of apt would be better than having this functionality as part of another package.
â Faheem Mitha
Aug 18 '13 at 8:42
 |Â
show 3 more comments
up vote
18
down vote
favorite
up vote
18
down vote
favorite
Some situations call for manually installing a local package using dpkg -i <packagename>
. Sometimes it may be further useful to leverage the functionality of apt
with that package so the question is:
How do you quickly create a local repository for random packages using a Debian based linux distribution - like Xubuntu 13.04/Ubuntu?
debian package-management apt
Some situations call for manually installing a local package using dpkg -i <packagename>
. Sometimes it may be further useful to leverage the functionality of apt
with that package so the question is:
How do you quickly create a local repository for random packages using a Debian based linux distribution - like Xubuntu 13.04/Ubuntu?
debian package-management apt
debian package-management apt
edited Aug 17 '13 at 9:09
asked Aug 17 '13 at 6:03
jus cogens prime
2,90182965
2,90182965
Just FYI. The usual thing is to followdpkg -i <packagename>
withapt-get -f install
to pull in required packages. Also, the usual thing to create an apt repos for Debian is reprepro.
â Faheem Mitha
Aug 17 '13 at 17:38
I've found reprepro helpful
â Gilles
Aug 17 '13 at 21:11
Thank you for your comments. @Faheem Mitha: can you please briefly expand on why runningapt
with--fix-broken
would be required after installing a local package withdpkg -i
? Wouldn't dpkg take care of that? I read it may be required the first time apt is run? @FM&Gilles: About reprepro. Seems useful if I could get it to work (not sure about dir struct, contents of 3 files or params at runtime). Will try again and update or post full question.
â jus cogens prime
Aug 18 '13 at 3:49
1
@illuminà :dpkg
does not resolve dependencies, butapt
does.dpkg
will warn of broken dependencies, but is low level, so will not attempt to fix them. Thedpkg -i *.deb
followed byapt-get -f install
is standard procedure. There is a wishlist bug to haveapt
itself handle the case of local package installation, and there is even a patch, I think, but it has not yet been implemented. See apt-get install could install local package files, too, originally filed in 1999.
â Faheem Mitha
Aug 18 '13 at 8:39
@illuminà Expressing interest in this feature will not hurt. I think the more people who (politely) express interest, the more likely it is that it will be implemented. Note also that gdebi is an alternative, as noted in the bug report. That is part of the reason it has not been implemented, I think. Though having such core functionality part of apt would be better than having this functionality as part of another package.
â Faheem Mitha
Aug 18 '13 at 8:42
 |Â
show 3 more comments
Just FYI. The usual thing is to followdpkg -i <packagename>
withapt-get -f install
to pull in required packages. Also, the usual thing to create an apt repos for Debian is reprepro.
â Faheem Mitha
Aug 17 '13 at 17:38
I've found reprepro helpful
â Gilles
Aug 17 '13 at 21:11
Thank you for your comments. @Faheem Mitha: can you please briefly expand on why runningapt
with--fix-broken
would be required after installing a local package withdpkg -i
? Wouldn't dpkg take care of that? I read it may be required the first time apt is run? @FM&Gilles: About reprepro. Seems useful if I could get it to work (not sure about dir struct, contents of 3 files or params at runtime). Will try again and update or post full question.
â jus cogens prime
Aug 18 '13 at 3:49
1
@illuminà :dpkg
does not resolve dependencies, butapt
does.dpkg
will warn of broken dependencies, but is low level, so will not attempt to fix them. Thedpkg -i *.deb
followed byapt-get -f install
is standard procedure. There is a wishlist bug to haveapt
itself handle the case of local package installation, and there is even a patch, I think, but it has not yet been implemented. See apt-get install could install local package files, too, originally filed in 1999.
â Faheem Mitha
Aug 18 '13 at 8:39
@illuminà Expressing interest in this feature will not hurt. I think the more people who (politely) express interest, the more likely it is that it will be implemented. Note also that gdebi is an alternative, as noted in the bug report. That is part of the reason it has not been implemented, I think. Though having such core functionality part of apt would be better than having this functionality as part of another package.
â Faheem Mitha
Aug 18 '13 at 8:42
Just FYI. The usual thing is to follow
dpkg -i <packagename>
with apt-get -f install
to pull in required packages. Also, the usual thing to create an apt repos for Debian is reprepro.â Faheem Mitha
Aug 17 '13 at 17:38
Just FYI. The usual thing is to follow
dpkg -i <packagename>
with apt-get -f install
to pull in required packages. Also, the usual thing to create an apt repos for Debian is reprepro.â Faheem Mitha
Aug 17 '13 at 17:38
I've found reprepro helpful
â Gilles
Aug 17 '13 at 21:11
I've found reprepro helpful
â Gilles
Aug 17 '13 at 21:11
Thank you for your comments. @Faheem Mitha: can you please briefly expand on why running
apt
with --fix-broken
would be required after installing a local package with dpkg -i
? Wouldn't dpkg take care of that? I read it may be required the first time apt is run? @FM&Gilles: About reprepro. Seems useful if I could get it to work (not sure about dir struct, contents of 3 files or params at runtime). Will try again and update or post full question.â jus cogens prime
Aug 18 '13 at 3:49
Thank you for your comments. @Faheem Mitha: can you please briefly expand on why running
apt
with --fix-broken
would be required after installing a local package with dpkg -i
? Wouldn't dpkg take care of that? I read it may be required the first time apt is run? @FM&Gilles: About reprepro. Seems useful if I could get it to work (not sure about dir struct, contents of 3 files or params at runtime). Will try again and update or post full question.â jus cogens prime
Aug 18 '13 at 3:49
1
1
@illuminà :
dpkg
does not resolve dependencies, but apt
does. dpkg
will warn of broken dependencies, but is low level, so will not attempt to fix them. The dpkg -i *.deb
followed by apt-get -f install
is standard procedure. There is a wishlist bug to have apt
itself handle the case of local package installation, and there is even a patch, I think, but it has not yet been implemented. See apt-get install could install local package files, too, originally filed in 1999.â Faheem Mitha
Aug 18 '13 at 8:39
@illuminà :
dpkg
does not resolve dependencies, but apt
does. dpkg
will warn of broken dependencies, but is low level, so will not attempt to fix them. The dpkg -i *.deb
followed by apt-get -f install
is standard procedure. There is a wishlist bug to have apt
itself handle the case of local package installation, and there is even a patch, I think, but it has not yet been implemented. See apt-get install could install local package files, too, originally filed in 1999.â Faheem Mitha
Aug 18 '13 at 8:39
@illuminà Expressing interest in this feature will not hurt. I think the more people who (politely) express interest, the more likely it is that it will be implemented. Note also that gdebi is an alternative, as noted in the bug report. That is part of the reason it has not been implemented, I think. Though having such core functionality part of apt would be better than having this functionality as part of another package.
â Faheem Mitha
Aug 18 '13 at 8:42
@illuminà Expressing interest in this feature will not hurt. I think the more people who (politely) express interest, the more likely it is that it will be implemented. Note also that gdebi is an alternative, as noted in the bug report. That is part of the reason it has not been implemented, I think. Though having such core functionality part of apt would be better than having this functionality as part of another package.
â Faheem Mitha
Aug 18 '13 at 8:42
 |Â
show 3 more comments
2 Answers
2
active
oldest
votes
up vote
26
down vote
accepted
This should be distinguished from the situation where you're trying to replicate a full package tree from an official repository and fine tuning sources priority. Random packages mean virtual packages, packages which are compiled locally or copied in a piecemeal fashion for testing purposes. Here's a simple setup based on now obsolete documentation.
First, make a directory to host the packages:
mkdir <packagedir>
Then move your .deb package files there. Execute this command from the directory above the one we just created (make sure permissions allow this!):
dpkg-scanpackages packagedir | gzip > packagedir/Packages.gz
Now create a file with extension .list
in /etc/apt/sources.list.d/
with the contents:
deb [trusted=yes] file:///path_to_dir_above_packagedir packagedir/
and update the apt database:
apt-get update
At this point the packages in our local repository can be installed like any other package using apt-get install <packagename>
. When new packages are added to the local repository, the prescribed dpkg-scanpackages
command must be issued again to update the Packages.gz file and apt
must be updated before the new packages are made available. Hopefully this can be useful for testing purposes.
6
With the new apt 1.1, one needs[trusted=yes]
betweendeb
and thefile:///
URI (see thesources.list(5)
man page), otherwiseapt-get update
fails because of the lack of signature.
â vinc17
Nov 27 '15 at 2:31
@vinc17 Thanks for the edit!
â jus cogens prime
Sep 11 at 3:14
add a comment |Â
up vote
3
down vote
If you want to create a repo with the full structure that you need for tools like debootstrap, the simplest way I've found is:
Create a repository directory.
# mkdir -p /opt/debian
Create a conf subdirectory.
# mkdir /opt/debian/conf
Create an /opt/debian/conf/distributions file with contents like this (adjust as appropriate for the distribution you're using):
Label: Local APT repository
Codename: jessie
Architectures: amd64
Components: main
Description: Local APT repository for debootstrapImport your package with reprepro.
# reprepro -b /opt/debian includedeb jessie /path/to/package.db
Import a bunch of packages with a shell for-loop, e.g. everything from your APT cache:
# cd /var/cache/apt/archives
# for DEB in *.deb; do reprepro -b /opt/debian includedeb jessie $DEB; done
This will create an unsigned archive. It can be used with debootstrap with the --no-check-gpg option.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
26
down vote
accepted
This should be distinguished from the situation where you're trying to replicate a full package tree from an official repository and fine tuning sources priority. Random packages mean virtual packages, packages which are compiled locally or copied in a piecemeal fashion for testing purposes. Here's a simple setup based on now obsolete documentation.
First, make a directory to host the packages:
mkdir <packagedir>
Then move your .deb package files there. Execute this command from the directory above the one we just created (make sure permissions allow this!):
dpkg-scanpackages packagedir | gzip > packagedir/Packages.gz
Now create a file with extension .list
in /etc/apt/sources.list.d/
with the contents:
deb [trusted=yes] file:///path_to_dir_above_packagedir packagedir/
and update the apt database:
apt-get update
At this point the packages in our local repository can be installed like any other package using apt-get install <packagename>
. When new packages are added to the local repository, the prescribed dpkg-scanpackages
command must be issued again to update the Packages.gz file and apt
must be updated before the new packages are made available. Hopefully this can be useful for testing purposes.
6
With the new apt 1.1, one needs[trusted=yes]
betweendeb
and thefile:///
URI (see thesources.list(5)
man page), otherwiseapt-get update
fails because of the lack of signature.
â vinc17
Nov 27 '15 at 2:31
@vinc17 Thanks for the edit!
â jus cogens prime
Sep 11 at 3:14
add a comment |Â
up vote
26
down vote
accepted
This should be distinguished from the situation where you're trying to replicate a full package tree from an official repository and fine tuning sources priority. Random packages mean virtual packages, packages which are compiled locally or copied in a piecemeal fashion for testing purposes. Here's a simple setup based on now obsolete documentation.
First, make a directory to host the packages:
mkdir <packagedir>
Then move your .deb package files there. Execute this command from the directory above the one we just created (make sure permissions allow this!):
dpkg-scanpackages packagedir | gzip > packagedir/Packages.gz
Now create a file with extension .list
in /etc/apt/sources.list.d/
with the contents:
deb [trusted=yes] file:///path_to_dir_above_packagedir packagedir/
and update the apt database:
apt-get update
At this point the packages in our local repository can be installed like any other package using apt-get install <packagename>
. When new packages are added to the local repository, the prescribed dpkg-scanpackages
command must be issued again to update the Packages.gz file and apt
must be updated before the new packages are made available. Hopefully this can be useful for testing purposes.
6
With the new apt 1.1, one needs[trusted=yes]
betweendeb
and thefile:///
URI (see thesources.list(5)
man page), otherwiseapt-get update
fails because of the lack of signature.
â vinc17
Nov 27 '15 at 2:31
@vinc17 Thanks for the edit!
â jus cogens prime
Sep 11 at 3:14
add a comment |Â
up vote
26
down vote
accepted
up vote
26
down vote
accepted
This should be distinguished from the situation where you're trying to replicate a full package tree from an official repository and fine tuning sources priority. Random packages mean virtual packages, packages which are compiled locally or copied in a piecemeal fashion for testing purposes. Here's a simple setup based on now obsolete documentation.
First, make a directory to host the packages:
mkdir <packagedir>
Then move your .deb package files there. Execute this command from the directory above the one we just created (make sure permissions allow this!):
dpkg-scanpackages packagedir | gzip > packagedir/Packages.gz
Now create a file with extension .list
in /etc/apt/sources.list.d/
with the contents:
deb [trusted=yes] file:///path_to_dir_above_packagedir packagedir/
and update the apt database:
apt-get update
At this point the packages in our local repository can be installed like any other package using apt-get install <packagename>
. When new packages are added to the local repository, the prescribed dpkg-scanpackages
command must be issued again to update the Packages.gz file and apt
must be updated before the new packages are made available. Hopefully this can be useful for testing purposes.
This should be distinguished from the situation where you're trying to replicate a full package tree from an official repository and fine tuning sources priority. Random packages mean virtual packages, packages which are compiled locally or copied in a piecemeal fashion for testing purposes. Here's a simple setup based on now obsolete documentation.
First, make a directory to host the packages:
mkdir <packagedir>
Then move your .deb package files there. Execute this command from the directory above the one we just created (make sure permissions allow this!):
dpkg-scanpackages packagedir | gzip > packagedir/Packages.gz
Now create a file with extension .list
in /etc/apt/sources.list.d/
with the contents:
deb [trusted=yes] file:///path_to_dir_above_packagedir packagedir/
and update the apt database:
apt-get update
At this point the packages in our local repository can be installed like any other package using apt-get install <packagename>
. When new packages are added to the local repository, the prescribed dpkg-scanpackages
command must be issued again to update the Packages.gz file and apt
must be updated before the new packages are made available. Hopefully this can be useful for testing purposes.
edited Sep 7 at 22:02
community wiki
7 revs, 2 users 92%
jus cogens prime
6
With the new apt 1.1, one needs[trusted=yes]
betweendeb
and thefile:///
URI (see thesources.list(5)
man page), otherwiseapt-get update
fails because of the lack of signature.
â vinc17
Nov 27 '15 at 2:31
@vinc17 Thanks for the edit!
â jus cogens prime
Sep 11 at 3:14
add a comment |Â
6
With the new apt 1.1, one needs[trusted=yes]
betweendeb
and thefile:///
URI (see thesources.list(5)
man page), otherwiseapt-get update
fails because of the lack of signature.
â vinc17
Nov 27 '15 at 2:31
@vinc17 Thanks for the edit!
â jus cogens prime
Sep 11 at 3:14
6
6
With the new apt 1.1, one needs
[trusted=yes]
between deb
and the file:///
URI (see the sources.list(5)
man page), otherwise apt-get update
fails because of the lack of signature.â vinc17
Nov 27 '15 at 2:31
With the new apt 1.1, one needs
[trusted=yes]
between deb
and the file:///
URI (see the sources.list(5)
man page), otherwise apt-get update
fails because of the lack of signature.â vinc17
Nov 27 '15 at 2:31
@vinc17 Thanks for the edit!
â jus cogens prime
Sep 11 at 3:14
@vinc17 Thanks for the edit!
â jus cogens prime
Sep 11 at 3:14
add a comment |Â
up vote
3
down vote
If you want to create a repo with the full structure that you need for tools like debootstrap, the simplest way I've found is:
Create a repository directory.
# mkdir -p /opt/debian
Create a conf subdirectory.
# mkdir /opt/debian/conf
Create an /opt/debian/conf/distributions file with contents like this (adjust as appropriate for the distribution you're using):
Label: Local APT repository
Codename: jessie
Architectures: amd64
Components: main
Description: Local APT repository for debootstrapImport your package with reprepro.
# reprepro -b /opt/debian includedeb jessie /path/to/package.db
Import a bunch of packages with a shell for-loop, e.g. everything from your APT cache:
# cd /var/cache/apt/archives
# for DEB in *.deb; do reprepro -b /opt/debian includedeb jessie $DEB; done
This will create an unsigned archive. It can be used with debootstrap with the --no-check-gpg option.
add a comment |Â
up vote
3
down vote
If you want to create a repo with the full structure that you need for tools like debootstrap, the simplest way I've found is:
Create a repository directory.
# mkdir -p /opt/debian
Create a conf subdirectory.
# mkdir /opt/debian/conf
Create an /opt/debian/conf/distributions file with contents like this (adjust as appropriate for the distribution you're using):
Label: Local APT repository
Codename: jessie
Architectures: amd64
Components: main
Description: Local APT repository for debootstrapImport your package with reprepro.
# reprepro -b /opt/debian includedeb jessie /path/to/package.db
Import a bunch of packages with a shell for-loop, e.g. everything from your APT cache:
# cd /var/cache/apt/archives
# for DEB in *.deb; do reprepro -b /opt/debian includedeb jessie $DEB; done
This will create an unsigned archive. It can be used with debootstrap with the --no-check-gpg option.
add a comment |Â
up vote
3
down vote
up vote
3
down vote
If you want to create a repo with the full structure that you need for tools like debootstrap, the simplest way I've found is:
Create a repository directory.
# mkdir -p /opt/debian
Create a conf subdirectory.
# mkdir /opt/debian/conf
Create an /opt/debian/conf/distributions file with contents like this (adjust as appropriate for the distribution you're using):
Label: Local APT repository
Codename: jessie
Architectures: amd64
Components: main
Description: Local APT repository for debootstrapImport your package with reprepro.
# reprepro -b /opt/debian includedeb jessie /path/to/package.db
Import a bunch of packages with a shell for-loop, e.g. everything from your APT cache:
# cd /var/cache/apt/archives
# for DEB in *.deb; do reprepro -b /opt/debian includedeb jessie $DEB; done
This will create an unsigned archive. It can be used with debootstrap with the --no-check-gpg option.
If you want to create a repo with the full structure that you need for tools like debootstrap, the simplest way I've found is:
Create a repository directory.
# mkdir -p /opt/debian
Create a conf subdirectory.
# mkdir /opt/debian/conf
Create an /opt/debian/conf/distributions file with contents like this (adjust as appropriate for the distribution you're using):
Label: Local APT repository
Codename: jessie
Architectures: amd64
Components: main
Description: Local APT repository for debootstrapImport your package with reprepro.
# reprepro -b /opt/debian includedeb jessie /path/to/package.db
Import a bunch of packages with a shell for-loop, e.g. everything from your APT cache:
# cd /var/cache/apt/archives
# for DEB in *.deb; do reprepro -b /opt/debian includedeb jessie $DEB; done
This will create an unsigned archive. It can be used with debootstrap with the --no-check-gpg option.
answered Aug 22 '16 at 19:03
Andrew Klaassen
311
311
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f87130%2fhow-to-quickly-create-a-local-apt-repository-for-random-packages-using-a-debian%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Just FYI. The usual thing is to follow
dpkg -i <packagename>
withapt-get -f install
to pull in required packages. Also, the usual thing to create an apt repos for Debian is reprepro.â Faheem Mitha
Aug 17 '13 at 17:38
I've found reprepro helpful
â Gilles
Aug 17 '13 at 21:11
Thank you for your comments. @Faheem Mitha: can you please briefly expand on why running
apt
with--fix-broken
would be required after installing a local package withdpkg -i
? Wouldn't dpkg take care of that? I read it may be required the first time apt is run? @FM&Gilles: About reprepro. Seems useful if I could get it to work (not sure about dir struct, contents of 3 files or params at runtime). Will try again and update or post full question.â jus cogens prime
Aug 18 '13 at 3:49
1
@illuminà :
dpkg
does not resolve dependencies, butapt
does.dpkg
will warn of broken dependencies, but is low level, so will not attempt to fix them. Thedpkg -i *.deb
followed byapt-get -f install
is standard procedure. There is a wishlist bug to haveapt
itself handle the case of local package installation, and there is even a patch, I think, but it has not yet been implemented. See apt-get install could install local package files, too, originally filed in 1999.â Faheem Mitha
Aug 18 '13 at 8:39
@illuminà Expressing interest in this feature will not hurt. I think the more people who (politely) express interest, the more likely it is that it will be implemented. Note also that gdebi is an alternative, as noted in the bug report. That is part of the reason it has not been implemented, I think. Though having such core functionality part of apt would be better than having this functionality as part of another package.
â Faheem Mitha
Aug 18 '13 at 8:42