Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 16 not supporting nlohmann/json? #2184

Closed
1 of 3 tasks
Tsuyo99 opened this issue Jun 11, 2020 · 9 comments
Closed
1 of 3 tasks

Ubuntu 16 not supporting nlohmann/json? #2184

Tsuyo99 opened this issue Jun 11, 2020 · 9 comments
Labels
kind: question solution: invalid the issue is not related to the library solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@Tsuyo99
Copy link

Tsuyo99 commented Jun 11, 2020

What do you want to achieve?

I would like to install nlohmann-json on ubuntu 16.04 vps server.

My ubuntu info: https://imgur.com/a/uq2kNZG

What have you tried?

Tried almost every nlohmann installation command (from what I could find online) to install it from the terminal but nothing wont work.

Can you provide a small code example?

https://imgur.com/a/G4sF7d5

Which compiler and operating system are you using?

My ubuntu info: https://imgur.com/a/uq2kNZG

I use vpsag.com for a vps server and vnc viewer to view my os.

Which version of the library did you use?

  • latest release version 3.7.3
  • other release - please state the version: ___
  • the develop branch

I'm quite sure I used the dev package command.

P.S: I'm quite new to the whole nlohmann/json thing so I hope I provided you with enough information. I'm here for whatever else you may need!

Thanks in advance,
Thanos

@nlohmann
Copy link
Owner

I am not maintaining that Ubuntu package nor do I know who does and how to update it.

@nlohmann nlohmann added the state: help needed the issue needs help to proceed label Jun 11, 2020
@nlohmann
Copy link
Owner

From https://packages.ubuntu.com/bionic/nlohmann-json-dev I see that @murinicanor could help here.

@murinicanor
Copy link
Contributor

From https://packages.ubuntu.com/bionic/nlohmann-json-dev I see that @murinicanor could help here.

I am the one who created the package for Debian, but that package was superseded by nlohmann-json3-dev (https://tracker.debian.org/pkg/nlohmann-json3). I don't have any knowledge about Ubuntu or how packages get there from the Debian repositories...
@Tsuyo99 maybe you have to enable the universe repository? Maybe that helps: https://askubuntu.com/questions/148638/how-do-i-enable-the-universe-repository

@Tsuyo99
Copy link
Author

Tsuyo99 commented Jun 13, 2020

Thank you all for your help! I will check it out tonight and let you know!

@nlohmann
Copy link
Owner

Any news on this?

@Tsuyo99
Copy link
Author

Tsuyo99 commented Jun 17, 2020

Sadly nothing worked. I installed Ubuntu 20.04 today and tommorow I'll try the casual installation commands for nlohmann (if it's not already preinstalled or sth).

@Tsuyo99
Copy link
Author

Tsuyo99 commented Jun 17, 2020

Not a direct solution to the problem, but I installed Ubuntu 20.04 on my laptop and I successfully installed nlohmann3 so I guess that's something. I'll try to dig deeper onto the ubuntu 16 case tho.

@lillygeiger
Copy link

lillygeiger commented Jun 20, 2020

There may be a way to accomplish the goal by installing the package that is used by 18.04 bionic, either through pinning or an alternative. For installation options on past Ubuntu releases, see https://help.ubuntu.com/community/PinningHowto

Please note that there isn't an Ubuntu Backport available at the time of writing to provide support on 16.04 xenial for nlohmann/json. Like Tsuyo99, I'm also experimenting with the potential solutions and will update with what I find.

@lillygeiger
Copy link

lillygeiger commented Jun 21, 2020

Given the package for 18.04 bionic wasn't tested on 16.04 xenial, it is probably advisable to heed the warnings on the PinningHowto page. Regardless, I was able to successfully install the 18.04 bionic package onto 16.04 xenial by setting up pinning and installing with apt-get install nlohmann-json-dev. Afterward I verified the installation by compiling a C++ program that includes json.hpp and deserializes a JSON input.

Steps:

  1. Set the default release (used by pinning) as xenial in /etc/apt/apt.conf (file didn't already exist for me).
    Example: echo 'APT::Default-Release "xenial";' | sudo tee /etc/apt/apt.conf
  2. Add the necessary bionic repository reference in /etc/apt/sources.list
    deb http://archive.ubuntu.com/ubuntu bionic main restricted universe multiverse
  3. Pin packages in /etc/apt/preferences (file didn't already exist for me).

Package: *
Pin: release n=bionic
Pin-Priority: -10

Package: nlohmann-json-dev
Pin: release n=bionic
Pin-Priority: 1001

  1. Suggestion: check the policy.
    sudo apt-cache policy
  2. Suggestion: read man page before first-time usage of pinning (provides pin-priority ranges, and usage - along with explanations - for example pins).
    man apt_preferences
  3. Refresh apt-get's repositories:
    sudo apt-get update
  4. Install nlohmann-json-dev:
    sudo apt-get install nlohmann-json-dev

Good luck, reader.

@nlohmann nlohmann added solution: invalid the issue is not related to the library solution: proposed fix a fix for the issue has been proposed and waits for confirmation and removed state: help needed the issue needs help to proceed labels Jul 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: question solution: invalid the issue is not related to the library solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

No branches or pull requests

4 participants