Koozali.org: home of the SME Server

Installing Contribs in sme without internet access

Offline TerryF

  • grumpy old man
  • *
  • 1,826
  • +6/-0
Re: Installing Contribs in sme without internet access
« Reply #30 on: July 11, 2013, 01:32:25 AM »
A cursory look, the expression stands out a dogs ba@#s comes to mind..review how you changed the repos and the commands you used.

eg If I wanted to a repo to a particular URL it would be:

db yum_repositories set smeaddons repository \
Name 'SME Server - addons' \
BaseURL 'http://mirror.contribs.org/smeserver/releases/8/smeaddons/$basearch' \
GPGCheck yes \
Visible yes \
status enabled

signal-event yum-modify
yum clean all

or as per DAG wiki

/sbin/e-smith/db yum_repositories set dag repository \
Name 'Dag - EL5' \
BaseURL 'http://apt.sw.be/redhat/el5/en/$basearch/dag' \
EnableGroups no \
GPGCheck yes \
GPGKey http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt \
Visible no \
Exclude freetype,htop,iptraf,rsync,syslinux \
status disabled

Not sure about mixing a "BaseURL" and a "MirrorList"
--
qui scribit bis legit

Offline mealogav

  • *
  • 27
  • +0/-0
Re: Installing Contribs in sme without internet access
« Reply #31 on: July 11, 2013, 03:03:36 AM »
Yes - it's all becoming clearer now - messy but clearer ...!

You're right you can't mix the MirrorList and BaseURL.  As the MirrorList is not accessible you get the Error 4 I/O Error.

When I performed the update there was only the BaseURL present.  BUT when I said
Quote
and I don't think the update has changed it back to the defaults - but this is yet to be checked properly

I was a bit premature!!  During the post install process the repos db seems to get rebuilt.  The mechanism is at

/etc/e-smith/db/yum_repositories/

The template scripts are in the "migrate" directory and the default setting for each repos are in the "defaults" directory.  I guess on a server that is never going to have internet access I could just delete the MirrorList files in each repos default directory?

On the plus side I have now taken a fresh installed test system (that has never had any internet access) and updated it from my local repos which is in a repos/html ibay on another sme server (that obviously has internet access and a cron rsync job that runs every night to keep it up to date).
I have also installed the phpmyadmin contrib and the php mcrypt library on the system from the same local repository. :-) :-)

I don't think it's a totally complete update as I think I need to include both the base and addons repositories.
This is mentioned in how to http://wiki.contribs.org/Yum_offline_updating.  (Which describes the other possibility of just copying the repos rpmsto a directory on the machine).

But hey - it's a massive leap forward from a few hours ago.

Thanks for all your help ....

Offline janet

  • ****
  • 4,812
  • +0/-0
Re: Installing Contribs in sme without internet access
« Reply #32 on: July 11, 2013, 04:34:40 AM »
mealogav

Quote
db yum_repositories show  now outputs this ....  (and I don't think the update has changed it back to the defaults - but this is yet to be checked properly).

Doing a package upgrade should not change the repos default values, only a major version upgrade (ie 7 to 8 ) or a manual reset of the yum_repositories database will do that.
AFAIK the MirrorList setting overrides the BaseURL setting, but I suppose if one was not available then the system searched the other, as you say you had success.
Ah I see your newer post that says you only had the BaseURL entry, so that would explain why you had success.

Once you set the db values, they should stay unchanged except under the conditions mentioned above.
Was this a "local" upgrade from sme7.6 to 8 ?
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline TerryF

  • grumpy old man
  • *
  • 1,826
  • +6/-0
Re: Installing Contribs in sme without internet access
« Reply #33 on: July 11, 2013, 06:20:58 AM »
mealogav

It would be a really good thing for you to have a think and write down what you have now done to accomplish your aim.

Put it in a form that can be placed in the wiki as a How To, I am sure, absolutely sure, that somone else in the short future will benefit from your experiences..

If you want to get involved in "our thing" :-) writing stuff for the docs is an easy way to get into it. Just login to the wiki and add your contribution to the discussion page, somone with the necessary permissions will review and add as appropriate to the docs.  If you really want to get involved then keep at it, look at bug processing and all that goes with that, your name will then live forever on the SME server wall of fame hahahaha

Seriously if you have a will, there is more than enough for all to do..jump in the waters fine..

 
--
qui scribit bis legit

Offline mealogav

  • *
  • 27
  • +0/-0
Re: Installing Contribs in sme without internet access
« Reply #34 on: July 11, 2013, 11:04:44 AM »
Hi Terry / Janet - thanks a lot for your help.  I was about to give up, but your messages over the last few days prompted me to dig deeper and persist with it - so thanks a lot.  And yes Terry I do fully intend to write this down (I'll need to as I have to repeat it on the "production" server that's locked down in an environment with no internet access and by the time I can get to it I'll have forgotten most of what I've done!!
It really helped to manage to pickup a test server on ebay which arrived 2 days ago and which I used to test this out on (bargain twin xeon 3GHz dual core, 4GB RAm and 2 73GB SCSI Dell server for £57!).

Janet in answer to your question, this was a fresh sme8 install from the current iso burned to a CD.  The update was then to apply all the updates which is necessary to be able to install contribs without having lots of package dependancy problems.  There's other forum posts warning thaat the current iso download (dated May 2012) is now very out of date.  Once installed there are 250 to 340 MB of package updates to apply.

Also
Quote
Doing a package upgrade should not change the repos default values, only a major version upgrade
Sadly this is not what I'm finding.  To make it work I make a yum db repos entry that has a BaseURL (to my local repos), with no MirrList entry.  However as soon as you perform an update, during the "signal-event post-upgrade" process the default MirrorList is added back (the BaseURL remains but there is also the default MirrorList entry).  This causes problems with the next update unless you remember to remove the MirrorList entries.
Take a look in "/etc/e-smith/db/yum_repositories/"
Like I said in my last post
Quote
The template scripts are in the "migrate" directory and the default setting for each repos are in the "defaults" directory.  I guess on a server that is never going to have internet access I could just delete the MirrorList files in each repos default directory?
If the server never has internet access it will never need the Mirror sites anyway.  I'm not sure what level update would restore them - I guess a major sme8 to 9 update probably would??  But this server is never likely to see that.

Remember the whole point of my quest was simply to be able to install phpmyadmin and mcrypt to a server without internet access.

I will keep working away at it - As I've said I think there is still some repositories that technically should be included in my local repos to get a full update - it looks to me like the article at http://wiki.contribs.org/Yum_local_repository is great as far as it goes - but just the smeupdates repos is not enough for a full update.  Perhaps I should add some notes to the "Discussion" tab of that How To?
Maybe this is because the current iso is so out of date?

So thanks again - watch this space (Terry I have applied and been accepted into the wiki group!)

PS - Getting the Raid discs of the Dell server working with sme8 gave me enough material for another How To!  It is sufficiently old to have a Raid controller that other posts say is no longer supported by the megaraid driver now in Centos.  But I got it working (with the i386 distro, won't work with the x86_64 distro - you wouldn't think there should be a difference would you?)
Gavin

Offline mealogav

  • *
  • 27
  • +0/-0
Re: Installing Contribs in sme without internet access
« Reply #35 on: July 11, 2013, 11:31:42 AM »
Quote
As I've said I think there is still some repositories that technically should be included in my local repos to get a full update

I deduce this because I have done a fresh install of sme8 from the current i386 iso burnt to CD on a server with internet access.  It then needed 340MB of updates.
Also I have done a fresh install of sme8 from the same CD on a server with NO internet access.  Then modified yum to update from my local repos with local rsync'd copies of the following repositories iso (don't think iso is necessary), smeaddons, smecontribs, smeextras, smeos, smeupdates.  It updated only 250MB of updates.

According to the how to http://wiki.contribs.org/Yum_offline_updating  I might need to add both the base and addons repositories.  Anyone know for sure?

Offline mmccarn

  • *
  • 2,627
  • +10/-0
Re: Installing Contribs in sme without internet access
« Reply #36 on: July 11, 2013, 02:35:50 PM »
If I do this:
cd /etc/e-smith/db/yum_repositories/defaults
grep -ril enabled *


I get these results, which I think definitively indicates which repos are enabled by default:
base/status
smeaddons/status
smeextras/status
smeos/status
smeupdates/status
updates/status


There are in my experience lots of updates in base and updates to components used in the SME server that are not re-hosted in the smeos and smeaddons repos.

Quote
The how to at   http://wiki.contribs.org/Yum_local_repository sets a new repos called "smeupdates-local".  I'm just wondering now how can this possibly change the behaviour of the "normal" updating operation?
If you create duplicate "-local" versions for your local repos with status=enabled, then set "status=disabled" on all of the originals, you should get normal updates using the -local repos and avoid the problems with the automatically reappearing MirrorList entries.

Offline mealogav

  • *
  • 27
  • +0/-0
Re: Installing Contribs in sme without internet access
« Reply #37 on: July 11, 2013, 05:54:44 PM »
Thanks.  I was just basing my thoughts on the How To at http://wiki.contribs.org/Yum_offline_updating , that suggests the base and addons repos as well as the smeos, smeaddons and smeupdates repos.

Yeah - I see now how the db of repositories work - I initially was assuming that yum would only use the repos names originally configured, but in fact I now understand that it uses whatever repositories are defined (and enabled) in the db.
So creating "-local" named ones sounds like the best idea and then you can switch between them by enabling / disabling as you suggest.

Just one thing though, won't the "signal-event post-upgrade" process re-enable the disabled MirrorList sites as per the default settings?  I'll check this out myself tonight.
Update
The code in "/etc/e-smith/db/yum_repositories/migrate" used to rebuild the repos db entries doesn't change the enabled / disabled status.  So this is obviously the right way to setup local yum repositories and be able to easily switch between local repos and remote repos (from MirrorLists) updating.



Thanks mmccarn.
Gavin
« Last Edit: July 11, 2013, 11:24:56 PM by mealogav »