Giter VIP home page Giter VIP logo

Comments (4)

mpoindexter avatar mpoindexter commented on June 9, 2024

Looks like your repo URL is slightly wrong (missing a "repository" path component). If you go to the repository list page in nexus admin, and use the "Copy" button in the "URL" column that will show you the right URL to use.

from nexus-repository-apt.

mckenziec avatar mckenziec commented on June 9, 2024

Ok!!! I've made progress. Thanks for the tip mpoindexter, but the situation is more complicated than just that. To some what I'm about to detail may seem obvious. Well its not if you haven't spent days trying to understand the Ubuntu repo url scheme and what apt does under the hood. I suggest you include at least a paragraph in the project's doc on the client setup.

After following the project README (https://github.com/sonatype-nexus-community/nexus-repository-apt) and successfully starting Nexus with the APT plug in, here's what I did to make a 100% proxy repo work:

  1. Login to Nexus as admin and create a new APT repo.
  2. Set the remote storage to a URL from your initial target client's /etc/apt/sources.list. e.g. http://us.archive.ubuntu.com/ubuntu/
  3. Set the distribution to your target ubuntu version. Hint you can check which versions accessible by just browsing to the remote storage URL under dists (e.g. http://us.archive.ubuntu.com/ubuntu/dists/). Note that I'm not sure if this is necessary or what it does, but I did it. e.g. xenial or trusty, etc...
  4. Get your new Nexus APT repo URL from the "COPY" button in the Nexus admin repo list. e.g. http://192.168.56.101:8081/repository/apt-ubuntu16.04/
  5. On the target Ubuntu client, complete the following:
    sudo cp /etc/apt/sources.list /etc/apt/sources.list.bk
    sudo vi /etc/apt/sources.list

Add the following (swap your repo URL links in there):

deb http://192.168.56.101:8081/repository/apt-ubuntu16.04 xenial main
deb http://192.168.56.101:8081/repository/apt-ubuntu16.04 xenial restricted
deb http://192.168.56.101:8081/repository/apt-ubuntu16.04 xenial universe
deb http://192.168.56.101:8081/repository/apt-ubuntu16.04 xenial multiverse
deb http://192.168.56.101:8081/repository/apt-ubuntu16.04 xenial-updates main
deb http://192.168.56.101:8081/repository/apt-ubuntu16.04 xenial-updates restricted
deb http://192.168.56.101:8081/repository/apt-ubuntu16.04 xenial-updates universe
deb http://192.168.56.101:8081/repository/apt-ubuntu16.04 xenial-updates multiverse

Note that you need the -updates variants otherwise you'll have broken dependencies when you try to install a newer package. Hint, everything is newer after the 1st Ubuntu distro release.

sudo apt-get update
Hit:1 http://192.168.56.101:8081/repository/apt-ubuntu16.04 xenial InRelease
Get:2 http://192.168.56.101:8081/repository/apt-ubuntu16.04 xenial-updates InRelease [102 kB]
...
Fetched 2,392 kB in 2s (1,123 kB/s)
Reading package lists... Done

  1. Test it:

sudo apt-get install vim
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
vim-runtime
Suggested packages:
ctags vim-doc vim-scripts vim-gnome-py2 | vim-gtk-py2 | vim-gtk3-py2 | vim-athena-py2 | vim-nox-py2
The following NEW packages will be installed:
vim vim-runtime
0 upgraded, 2 newly installed, 0 to remove and 23 not upgraded.
Need to get 6,199 kB of archives.
After this operation, 30.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://192.168.56.101:8081/repository/apt-ubuntu16.04 xenial-updates/main amd64 vim-runtime all 2:7.4.1689-3ubuntu1.2 [5,164 kB]
Get:2 http://192.168.56.101:8081/repository/apt-ubuntu16.04 xenial-updates/main amd64 vim amd64 2:7.4.1689-3ubuntu1.2 [1,036 kB]
Fetched 6,199 kB in 4s (1,523 kB/s)
Selecting previously unselected package vim-runtime.
(Reading database ... 160628 files and directories currently installed.)
Preparing to unpack .../vim-runtime_2%3a7.4.1689-3ubuntu1.2_all.deb ...
Adding 'diversion of /usr/share/vim/vim74/doc/help.txt to /usr/share/vim/vim74/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim74/doc/tags to /usr/share/vim/vim74/doc/tags.vim-tiny by vim-runtime'
Unpacking vim-runtime (2:7.4.1689-3ubuntu1.2) ...
Selecting previously unselected package vim.
Preparing to unpack .../vim_2%3a7.4.1689-3ubuntu1.2_amd64.deb ...
Unpacking vim (2:7.4.1689-3ubuntu1.2) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up vim-runtime (2:7.4.1689-3ubuntu1.2) ...
Setting up vim (2:7.4.1689-3ubuntu1.2) ...
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode

I have an outstanding question. Do I have to have a separate APT repo in Nexus for each Ubuntu version? e.g. xenial, trusty, etc...? The remote storage URL is not distro specific, and apt knows its distro. I don't think its necessary and means we have to create separate reports for each version, unlike the YUM repo in Nexus which you can just create once. Maybe there's some technical detail that makes this impossible.

from nexus-repository-apt.

mpoindexter avatar mpoindexter commented on June 9, 2024

@mckenziec - You do currently have to have a separate repo per Ubuntu version.

There's an open ticket to change it (#22), but no one has done it yet. That ticket discusses some of the reasons why, but the short of it is that when I initially wrote this I limited it to one repo per version for no good reason other than it made a couple of things in the code simpler and I had no use cases to do otherwise :)

from nexus-repository-apt.

mpoindexter avatar mpoindexter commented on June 9, 2024

Closing this out as it appears to be resolved.

from nexus-repository-apt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.