Download and install ubuntu packages and dependencies on a server without internet connection
I'm trying to download all packages and needed dependencies on a server with working internet connection and transfer them on server without internet connection and then install them via apt-get.
I have two solutions to download packages:
apt-get --print-uris --yes install pkgspec | grep ^' | cut -d' -f2 > downloads.list
Is useless because it works only for packages and dependencies that are not downloaded and installed already on a server with working internet connection.
aptitude download '?reverse-depends(package)'
It downloads all packages and dependencies also if you don't need them.
Anyone knows a better solution to download a package and dependencies needed to be installed on a fresh install of Ubuntu server 16.04?
I want to create a script that goes trough a list of packages and downloads all packages and dependencies automatically.
Then I need a solution to use this packages on a offline computer with apt-get. Idea is to create a local apt repository that allows you to use your local packages via apt-get.
So I use this command to create Packages.gz that contains info about all packages that were download in first step.
dpkg-scanpackages . /dev/null | gzip > Packages.gz
Then I add a new source to /etc/apt/sources.list.d/ and run apt-get update.
deb [trusted=yes] file:///tmp/dpkgs /
Now I have a problem that I can for example install apache (still some errors). But if I want to install php I got the following error.
root@ubuntu:~# apt-get install php
Reading package lists... Done
Building dependency tree
Reading state information... Done
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:
php : Depends: php7.0 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Anyone has a working solution for this problem?
Thanks.
package-management offline
add a comment |
I'm trying to download all packages and needed dependencies on a server with working internet connection and transfer them on server without internet connection and then install them via apt-get.
I have two solutions to download packages:
apt-get --print-uris --yes install pkgspec | grep ^' | cut -d' -f2 > downloads.list
Is useless because it works only for packages and dependencies that are not downloaded and installed already on a server with working internet connection.
aptitude download '?reverse-depends(package)'
It downloads all packages and dependencies also if you don't need them.
Anyone knows a better solution to download a package and dependencies needed to be installed on a fresh install of Ubuntu server 16.04?
I want to create a script that goes trough a list of packages and downloads all packages and dependencies automatically.
Then I need a solution to use this packages on a offline computer with apt-get. Idea is to create a local apt repository that allows you to use your local packages via apt-get.
So I use this command to create Packages.gz that contains info about all packages that were download in first step.
dpkg-scanpackages . /dev/null | gzip > Packages.gz
Then I add a new source to /etc/apt/sources.list.d/ and run apt-get update.
deb [trusted=yes] file:///tmp/dpkgs /
Now I have a problem that I can for example install apache (still some errors). But if I want to install php I got the following error.
root@ubuntu:~# apt-get install php
Reading package lists... Done
Building dependency tree
Reading state information... Done
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:
php : Depends: php7.0 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Anyone has a working solution for this problem?
Thanks.
package-management offline
Did you see this possible duplicate?
– Pablo Bianchi
Jan 25 at 3:22
add a comment |
I'm trying to download all packages and needed dependencies on a server with working internet connection and transfer them on server without internet connection and then install them via apt-get.
I have two solutions to download packages:
apt-get --print-uris --yes install pkgspec | grep ^' | cut -d' -f2 > downloads.list
Is useless because it works only for packages and dependencies that are not downloaded and installed already on a server with working internet connection.
aptitude download '?reverse-depends(package)'
It downloads all packages and dependencies also if you don't need them.
Anyone knows a better solution to download a package and dependencies needed to be installed on a fresh install of Ubuntu server 16.04?
I want to create a script that goes trough a list of packages and downloads all packages and dependencies automatically.
Then I need a solution to use this packages on a offline computer with apt-get. Idea is to create a local apt repository that allows you to use your local packages via apt-get.
So I use this command to create Packages.gz that contains info about all packages that were download in first step.
dpkg-scanpackages . /dev/null | gzip > Packages.gz
Then I add a new source to /etc/apt/sources.list.d/ and run apt-get update.
deb [trusted=yes] file:///tmp/dpkgs /
Now I have a problem that I can for example install apache (still some errors). But if I want to install php I got the following error.
root@ubuntu:~# apt-get install php
Reading package lists... Done
Building dependency tree
Reading state information... Done
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:
php : Depends: php7.0 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Anyone has a working solution for this problem?
Thanks.
package-management offline
I'm trying to download all packages and needed dependencies on a server with working internet connection and transfer them on server without internet connection and then install them via apt-get.
I have two solutions to download packages:
apt-get --print-uris --yes install pkgspec | grep ^' | cut -d' -f2 > downloads.list
Is useless because it works only for packages and dependencies that are not downloaded and installed already on a server with working internet connection.
aptitude download '?reverse-depends(package)'
It downloads all packages and dependencies also if you don't need them.
Anyone knows a better solution to download a package and dependencies needed to be installed on a fresh install of Ubuntu server 16.04?
I want to create a script that goes trough a list of packages and downloads all packages and dependencies automatically.
Then I need a solution to use this packages on a offline computer with apt-get. Idea is to create a local apt repository that allows you to use your local packages via apt-get.
So I use this command to create Packages.gz that contains info about all packages that were download in first step.
dpkg-scanpackages . /dev/null | gzip > Packages.gz
Then I add a new source to /etc/apt/sources.list.d/ and run apt-get update.
deb [trusted=yes] file:///tmp/dpkgs /
Now I have a problem that I can for example install apache (still some errors). But if I want to install php I got the following error.
root@ubuntu:~# apt-get install php
Reading package lists... Done
Building dependency tree
Reading state information... Done
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:
php : Depends: php7.0 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Anyone has a working solution for this problem?
Thanks.
package-management offline
package-management offline
edited Jan 25 at 3:18
Pablo Bianchi
2,4851532
2,4851532
asked Aug 12 '16 at 11:45
AdrijanAdrijan
2412
2412
Did you see this possible duplicate?
– Pablo Bianchi
Jan 25 at 3:22
add a comment |
Did you see this possible duplicate?
– Pablo Bianchi
Jan 25 at 3:22
Did you see this possible duplicate?
– Pablo Bianchi
Jan 25 at 3:22
Did you see this possible duplicate?
– Pablo Bianchi
Jan 25 at 3:22
add a comment |
3 Answers
3
active
oldest
votes
Lan Morrison has made an isorespin.sh
script that will make an image from commands you give and with an added command can have all the updates to that time on the image and install any apt install you want on the install image it makes. I used it and it works real good.
For more details, see: Customizing Ubuntu ISOs: Documentation and examples of how to use isorespin.sh
.
add a comment |
I have never tried this, so YMMV.
Check out this and apt-offline.
They claim to do exactly what you want.
add a comment |
My recommendation is to do ssh tunnels, I supose you are loging to server with an SSH connection from a machine who has internet connection, hence you can try to use reverse tunnels to have access at least to your desired repos... Please follow these steps:
Log in to your server with the following command:
ssh -R 127.0.0.1:9800:yourrepo.address:80 youruser@ServerWithoutInternetConnectionAddress
Once logged in your server add the following line to /etc/hosts:
127.0.0.1 yourrepo.adress
In your repository configuration file in
/etc/apt/sources.list
or in/etc/apt/sources.list.d/repofile.list
modify your repository address by adding used port (I've used 9800, although it can be any port higher than 1023):
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-mirror/ xenial main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-mirror/ xenial-updates main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-java/ xenial main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-production/ xenial multiverse
Now apt-get update
and apt-get install
should be working. Please consider that you can have as many tunnels as repositories, you only need to change your source port.
E.g. consider that you have official ubuntu repository in /etc/apt/sources.list
and other in /etc/apt/sources.list.d/repofile.list
I can use port to 9801 for us.archive.ubuntu.com
and port 9800 for /etc/apt/sources.list.d/repofile.list
as following:
/etc/apt/sources.list
deb http://us.archive.ubuntu.com:9801/ubuntu/ xenial main restricted universe multiverse
deb-src http://us.archive.ubuntu.com:9801/ubuntu/ xenial main restricted multiverse
deb http://us.archive.ubuntu.com:9801/ubuntu/ xenial-security main restricted universe multiverse
deb http://us.archive.ubuntu.com:9801/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://us.archive.ubuntu.com:9801/ubuntu/ xenial-security main restricted multiverse
deb-src http://us.archive.ubuntu.com:9801/ubuntu/ xenial-updates main restricted multiverse
/etc/apt/sources.list
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-mirror/ xenial main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-mirror/ xenial-updates main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-java/ xenial main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-production/ xenial multiverse
By adding this to /etc/hosts
127.0.0.1 yourrepo.adress us.archive.ubuntu.com
And log in from a machine with internet connection as following:
ssh -R 127.0.0.1:9800:yourrepo.address:80 -R 127.0.0.1:9801:us.archive.ubuntu.com:80 youruser@ServerWithoutInternetConnectionAddress
PS: Consider that if your repository needs a key you will need to extract the key (from a machine that has the key apt-key export KEY_ID >> key.asc
) and add it using the following command:
apt-key add key.asc
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f811423%2fdownload-and-install-ubuntu-packages-and-dependencies-on-a-server-without-intern%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Lan Morrison has made an isorespin.sh
script that will make an image from commands you give and with an added command can have all the updates to that time on the image and install any apt install you want on the install image it makes. I used it and it works real good.
For more details, see: Customizing Ubuntu ISOs: Documentation and examples of how to use isorespin.sh
.
add a comment |
Lan Morrison has made an isorespin.sh
script that will make an image from commands you give and with an added command can have all the updates to that time on the image and install any apt install you want on the install image it makes. I used it and it works real good.
For more details, see: Customizing Ubuntu ISOs: Documentation and examples of how to use isorespin.sh
.
add a comment |
Lan Morrison has made an isorespin.sh
script that will make an image from commands you give and with an added command can have all the updates to that time on the image and install any apt install you want on the install image it makes. I used it and it works real good.
For more details, see: Customizing Ubuntu ISOs: Documentation and examples of how to use isorespin.sh
.
Lan Morrison has made an isorespin.sh
script that will make an image from commands you give and with an added command can have all the updates to that time on the image and install any apt install you want on the install image it makes. I used it and it works real good.
For more details, see: Customizing Ubuntu ISOs: Documentation and examples of how to use isorespin.sh
.
edited May 13 '18 at 15:51
kenorb
4,36513953
4,36513953
answered Feb 5 '18 at 12:31
Raymond DayRaymond Day
113
113
add a comment |
add a comment |
I have never tried this, so YMMV.
Check out this and apt-offline.
They claim to do exactly what you want.
add a comment |
I have never tried this, so YMMV.
Check out this and apt-offline.
They claim to do exactly what you want.
add a comment |
I have never tried this, so YMMV.
Check out this and apt-offline.
They claim to do exactly what you want.
I have never tried this, so YMMV.
Check out this and apt-offline.
They claim to do exactly what you want.
answered Aug 19 '16 at 6:27
JoeJoe
1,201821
1,201821
add a comment |
add a comment |
My recommendation is to do ssh tunnels, I supose you are loging to server with an SSH connection from a machine who has internet connection, hence you can try to use reverse tunnels to have access at least to your desired repos... Please follow these steps:
Log in to your server with the following command:
ssh -R 127.0.0.1:9800:yourrepo.address:80 youruser@ServerWithoutInternetConnectionAddress
Once logged in your server add the following line to /etc/hosts:
127.0.0.1 yourrepo.adress
In your repository configuration file in
/etc/apt/sources.list
or in/etc/apt/sources.list.d/repofile.list
modify your repository address by adding used port (I've used 9800, although it can be any port higher than 1023):
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-mirror/ xenial main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-mirror/ xenial-updates main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-java/ xenial main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-production/ xenial multiverse
Now apt-get update
and apt-get install
should be working. Please consider that you can have as many tunnels as repositories, you only need to change your source port.
E.g. consider that you have official ubuntu repository in /etc/apt/sources.list
and other in /etc/apt/sources.list.d/repofile.list
I can use port to 9801 for us.archive.ubuntu.com
and port 9800 for /etc/apt/sources.list.d/repofile.list
as following:
/etc/apt/sources.list
deb http://us.archive.ubuntu.com:9801/ubuntu/ xenial main restricted universe multiverse
deb-src http://us.archive.ubuntu.com:9801/ubuntu/ xenial main restricted multiverse
deb http://us.archive.ubuntu.com:9801/ubuntu/ xenial-security main restricted universe multiverse
deb http://us.archive.ubuntu.com:9801/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://us.archive.ubuntu.com:9801/ubuntu/ xenial-security main restricted multiverse
deb-src http://us.archive.ubuntu.com:9801/ubuntu/ xenial-updates main restricted multiverse
/etc/apt/sources.list
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-mirror/ xenial main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-mirror/ xenial-updates main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-java/ xenial main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-production/ xenial multiverse
By adding this to /etc/hosts
127.0.0.1 yourrepo.adress us.archive.ubuntu.com
And log in from a machine with internet connection as following:
ssh -R 127.0.0.1:9800:yourrepo.address:80 -R 127.0.0.1:9801:us.archive.ubuntu.com:80 youruser@ServerWithoutInternetConnectionAddress
PS: Consider that if your repository needs a key you will need to extract the key (from a machine that has the key apt-key export KEY_ID >> key.asc
) and add it using the following command:
apt-key add key.asc
add a comment |
My recommendation is to do ssh tunnels, I supose you are loging to server with an SSH connection from a machine who has internet connection, hence you can try to use reverse tunnels to have access at least to your desired repos... Please follow these steps:
Log in to your server with the following command:
ssh -R 127.0.0.1:9800:yourrepo.address:80 youruser@ServerWithoutInternetConnectionAddress
Once logged in your server add the following line to /etc/hosts:
127.0.0.1 yourrepo.adress
In your repository configuration file in
/etc/apt/sources.list
or in/etc/apt/sources.list.d/repofile.list
modify your repository address by adding used port (I've used 9800, although it can be any port higher than 1023):
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-mirror/ xenial main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-mirror/ xenial-updates main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-java/ xenial main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-production/ xenial multiverse
Now apt-get update
and apt-get install
should be working. Please consider that you can have as many tunnels as repositories, you only need to change your source port.
E.g. consider that you have official ubuntu repository in /etc/apt/sources.list
and other in /etc/apt/sources.list.d/repofile.list
I can use port to 9801 for us.archive.ubuntu.com
and port 9800 for /etc/apt/sources.list.d/repofile.list
as following:
/etc/apt/sources.list
deb http://us.archive.ubuntu.com:9801/ubuntu/ xenial main restricted universe multiverse
deb-src http://us.archive.ubuntu.com:9801/ubuntu/ xenial main restricted multiverse
deb http://us.archive.ubuntu.com:9801/ubuntu/ xenial-security main restricted universe multiverse
deb http://us.archive.ubuntu.com:9801/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://us.archive.ubuntu.com:9801/ubuntu/ xenial-security main restricted multiverse
deb-src http://us.archive.ubuntu.com:9801/ubuntu/ xenial-updates main restricted multiverse
/etc/apt/sources.list
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-mirror/ xenial main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-mirror/ xenial-updates main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-java/ xenial main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-production/ xenial multiverse
By adding this to /etc/hosts
127.0.0.1 yourrepo.adress us.archive.ubuntu.com
And log in from a machine with internet connection as following:
ssh -R 127.0.0.1:9800:yourrepo.address:80 -R 127.0.0.1:9801:us.archive.ubuntu.com:80 youruser@ServerWithoutInternetConnectionAddress
PS: Consider that if your repository needs a key you will need to extract the key (from a machine that has the key apt-key export KEY_ID >> key.asc
) and add it using the following command:
apt-key add key.asc
add a comment |
My recommendation is to do ssh tunnels, I supose you are loging to server with an SSH connection from a machine who has internet connection, hence you can try to use reverse tunnels to have access at least to your desired repos... Please follow these steps:
Log in to your server with the following command:
ssh -R 127.0.0.1:9800:yourrepo.address:80 youruser@ServerWithoutInternetConnectionAddress
Once logged in your server add the following line to /etc/hosts:
127.0.0.1 yourrepo.adress
In your repository configuration file in
/etc/apt/sources.list
or in/etc/apt/sources.list.d/repofile.list
modify your repository address by adding used port (I've used 9800, although it can be any port higher than 1023):
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-mirror/ xenial main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-mirror/ xenial-updates main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-java/ xenial main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-production/ xenial multiverse
Now apt-get update
and apt-get install
should be working. Please consider that you can have as many tunnels as repositories, you only need to change your source port.
E.g. consider that you have official ubuntu repository in /etc/apt/sources.list
and other in /etc/apt/sources.list.d/repofile.list
I can use port to 9801 for us.archive.ubuntu.com
and port 9800 for /etc/apt/sources.list.d/repofile.list
as following:
/etc/apt/sources.list
deb http://us.archive.ubuntu.com:9801/ubuntu/ xenial main restricted universe multiverse
deb-src http://us.archive.ubuntu.com:9801/ubuntu/ xenial main restricted multiverse
deb http://us.archive.ubuntu.com:9801/ubuntu/ xenial-security main restricted universe multiverse
deb http://us.archive.ubuntu.com:9801/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://us.archive.ubuntu.com:9801/ubuntu/ xenial-security main restricted multiverse
deb-src http://us.archive.ubuntu.com:9801/ubuntu/ xenial-updates main restricted multiverse
/etc/apt/sources.list
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-mirror/ xenial main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-mirror/ xenial-updates main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-java/ xenial main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-production/ xenial multiverse
By adding this to /etc/hosts
127.0.0.1 yourrepo.adress us.archive.ubuntu.com
And log in from a machine with internet connection as following:
ssh -R 127.0.0.1:9800:yourrepo.address:80 -R 127.0.0.1:9801:us.archive.ubuntu.com:80 youruser@ServerWithoutInternetConnectionAddress
PS: Consider that if your repository needs a key you will need to extract the key (from a machine that has the key apt-key export KEY_ID >> key.asc
) and add it using the following command:
apt-key add key.asc
My recommendation is to do ssh tunnels, I supose you are loging to server with an SSH connection from a machine who has internet connection, hence you can try to use reverse tunnels to have access at least to your desired repos... Please follow these steps:
Log in to your server with the following command:
ssh -R 127.0.0.1:9800:yourrepo.address:80 youruser@ServerWithoutInternetConnectionAddress
Once logged in your server add the following line to /etc/hosts:
127.0.0.1 yourrepo.adress
In your repository configuration file in
/etc/apt/sources.list
or in/etc/apt/sources.list.d/repofile.list
modify your repository address by adding used port (I've used 9800, although it can be any port higher than 1023):
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-mirror/ xenial main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-mirror/ xenial-updates main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-java/ xenial main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-production/ xenial multiverse
Now apt-get update
and apt-get install
should be working. Please consider that you can have as many tunnels as repositories, you only need to change your source port.
E.g. consider that you have official ubuntu repository in /etc/apt/sources.list
and other in /etc/apt/sources.list.d/repofile.list
I can use port to 9801 for us.archive.ubuntu.com
and port 9800 for /etc/apt/sources.list.d/repofile.list
as following:
/etc/apt/sources.list
deb http://us.archive.ubuntu.com:9801/ubuntu/ xenial main restricted universe multiverse
deb-src http://us.archive.ubuntu.com:9801/ubuntu/ xenial main restricted multiverse
deb http://us.archive.ubuntu.com:9801/ubuntu/ xenial-security main restricted universe multiverse
deb http://us.archive.ubuntu.com:9801/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://us.archive.ubuntu.com:9801/ubuntu/ xenial-security main restricted multiverse
deb-src http://us.archive.ubuntu.com:9801/ubuntu/ xenial-updates main restricted multiverse
/etc/apt/sources.list
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-mirror/ xenial main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-mirror/ xenial-updates main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-java/ xenial main
deb [arch=amd64] http://yourrepo.address:9800/ubuntu-production/ xenial multiverse
By adding this to /etc/hosts
127.0.0.1 yourrepo.adress us.archive.ubuntu.com
And log in from a machine with internet connection as following:
ssh -R 127.0.0.1:9800:yourrepo.address:80 -R 127.0.0.1:9801:us.archive.ubuntu.com:80 youruser@ServerWithoutInternetConnectionAddress
PS: Consider that if your repository needs a key you will need to extract the key (from a machine that has the key apt-key export KEY_ID >> key.asc
) and add it using the following command:
apt-key add key.asc
edited Jan 25 at 3:21
Pablo Bianchi
2,4851532
2,4851532
answered Feb 5 '18 at 11:52
Alvaro NiñoAlvaro Niño
2487
2487
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f811423%2fdownload-and-install-ubuntu-packages-and-dependencies-on-a-server-without-intern%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Did you see this possible duplicate?
– Pablo Bianchi
Jan 25 at 3:22