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

Repo Check for Multiverse #26

Closed
wants to merge 4 commits into from
Closed

Repo Check for Multiverse #26

wants to merge 4 commits into from

Conversation

Jarli01
Copy link
Owner

@Jarli01 Jarli01 commented Jul 31, 2018

Works on Ubuntu 18.04.1-live, will test against Debain 9 and an Alternative download (full) from Ubuntu's website.

Testing welcome.

# Check if we were effectively run as root
[ $EUID = 0 ] || { echo "This script needs to be run as root!"; exit 1; }

#Check for 1GB Memory
totalk=$(awk '/^MemTotal:/{print $2}' /proc/meminfo)
if [ "$totalk" -lt "1000000" ]; then echo "XOCE Requires at least 1GB Memory!"; exit 1; fi

# Repository add - confirm required repoistor(ies) are enabled and active, update and upgrade no matter what
multiverse="http://archive.ubuntu.com/multiverse"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line needs revised as grep is failing even if the repo already exists

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will also fail for any Debian install.

Copy link
Owner Author

@Jarli01 Jarli01 Jul 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It worked on the 18.04.1-live Ubuntu I tested earlier, do you have any recommendations? As for Debian, adding the repository shouldn't be, completed, I agree but I'm not sure how to go about checking what distro we're on and then calling the specific function.

I suppose we could check the /etc/*-release file with cat and pull a string from there to then pipe into an if statement.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If by "worked" you mean "added the repo", then yes it worked. However, it will continue to do so each time you run that section of code because the grep command will always fail.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you show me what you mean, as far as I can tell it works (on Ubuntu 18.04.1-live) still haven't progressed to other distro's for testing.

putty_2018-07-31_20-02-53

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There can be multiple lines that need multiverse, from the link you posted and one I found the variable adds it to multiple lines within the sources.list file.

It works, but I kind of think it's a bad work around in general.

Checking for dependencies I think would be the best approach, and stop if not found. On the other hand, single line install has always been a big feature of the installation script. (which really should only need to be run once)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With that said of course. . . Ubuntu going and screwing the pooch on this and using a mini iso for their default download adds this complexity that didn't exist until 18.04.1-live on their website.

The issue doesn't exist on other ISO's from what people were saying. I'd have to do more testing to confirm.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty easy to check which distro, then only add multiverse if it's Ubuntu. I submitted a PR.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be fine, but we also need to check if multiverse is included or not already, we don't want to add something to sources.list that already exists.

And then the issue goes to what was an offline conversation do we simply want to check for minimum requirements and simply abort the install if the requirements aren't met.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't actually add it again. If it already exists it just echoes "'multiverse' distribution component is already enabled for all sources."

@Jarli01
Copy link
Owner Author

Jarli01 commented Aug 3, 2018

Closing as @bnrstnr created a workable option.

@Jarli01 Jarli01 closed this Aug 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants