[Spacewalk-list] Upgrading to 2.7 with existing UbuntuRepositories

Paul-Andre Panon paul-andre.panon at avigilon.com
Thu Sep 28 17:41:06 UTC 2017


On Thu, 28 Sep 2017 01:07:05,  Michael Ward <Michael.Ward at melbourneit.com.au> wrote:
>Hi,
>
>Apologies if I've missed this information, but from what I've pieced together from the mailing list, in order for Ubuntu repositories to work correctly after upgrading to Spacewalk 2.7, all packages for Ubuntu need to be removed, and then the channels re-sync'd ?
>
>Can you please confirm:
>
>
>a)       That this information is correct,
>
>b)      If so, Is there a documented process on the correct way to perform this, and
>
>c)       Should this be added to the 2.7 Upgrade notes ?
>
>Regards,
>Michael Ward.


I wound up using David Hrbáč's technique from http://www.hrbac.cz/2017/06/proper-way-to-delete-channelrepositorypackages-in-spacewalk/, repeating the first two lines for each channel and repo.

spacecmd softwarechannel_delete [channel_name]
spacecmd repo_delete [reponame_name]
spacecmd package_removeorphans
spacewalk-data-fsck -r -S -C -O

This process takes quite a while. I didn't see any symbolic links that would have been found by David's last line
find /srv/satellite/rpms/ -xtype l -delete

When I told Robert Paschedag that I still had some versioning issues with Ubuntu 14.04 packages after the upgrade to 2.7, he asked what technique I used to clean up packages. I pointed to the above and he indicated it was correct.


To rebuild my channels I used the following commands. Change the repo URLS to be a mirror close to you. Also change the sync schedule and frequency as you see fit, but I think it's a good idea to stagger them so they don't run all at once.
spacecmd softwarechannel_create ' -n "Ubuntu 14.04 (x86_64)" -l "trusty" -a amd64-deb -c sha256 -p "" '
spacecmd softwarechannel_create ' -n "trusty-backports" -l "trusty-backports" -a amd64-deb -c sha256 -p "trusty" '
spacecmd softwarechannel_create ' -n "trusty-security" -l "trusty-security" -a amd64-deb -c sha256 -p "trusty" '
spacecmd softwarechannel_create ' -n "trusty-security-universe" -l "trusty-security-universe" -a amd64-deb -c sha256 -p "trusty" '
spacecmd softwarechannel_create ' -n "trusty-spacewalk-client" -l "trusty-spacewalk-client" -a amd64-deb -c sha256 -p "trusty" '
spacecmd softwarechannel_create ' -n "trusty-updates" -l "trusty-updates" -a amd64-deb -c sha256 -p "trusty" '
spacecmd softwarechannel_create ' -n "trusty-updates-universe" -l "trusty-updates-universe" -a amd64-deb -c sha256 -p "trusty" '
spacecmd softwarechannel_create ' -n "Ubuntu 16.04 (x86_64)" -l "xenial" -a amd64-deb -c sha256 -p "" '
spacecmd softwarechannel_create ' -n "xenial-backports" -l "xenial-backports" -a amd64-deb -c sha256 -p "xenial"'
spacecmd softwarechannel_create ' -n "xenial-security" -l "xenial-security" -a amd64-deb -c sha256 -p "xenial"'
spacecmd softwarechannel_create ' -n "xenial-security-universe" -l "xenial-security-universe" -a amd64-deb -c sha256 -p "xenial"'
spacecmd softwarechannel_create ' -n "xenial-updates" -l "xenial-updates" -a amd64-deb -c sha256 -p "xenial" '
spacecmd softwarechannel_create ' -n "xenial-updates-universe" -l "xenial-updates-universe" -a amd64-deb -c sha256 -p "xenial" '
spacecmd repo_create ' -n "External - Ubuntu 14.04 backports x86_64" -u "http://ca.archive.ubuntu.com/ubuntu/dists/trusty-backports/main/binary-amd64/" -t deb'
spacecmd repo_create ' -n "External - Ubuntu 14.04 security x86_64" -u "http://ca.archive.ubuntu.com/ubuntu/dists/trusty-security/main/binary-amd64/" -t deb'
spacecmd repo_create ' -n "External - Ubuntu 14.04 universe security x86_64" -u "http://ca.archive.ubuntu.com/ubuntu/dists/trusty-security/universe/binary-amd64/" -t deb'
spacecmd repo_create ' -n "External - Ubuntu 14.04 updates x86_64" -u "http://ca.archive.ubuntu.com/ubuntu/dists/trusty-updates/main/binary-amd64/" -t deb'
spacecmd repo_create ' -n "External - Ubuntu 14.04 universe updates x86_64" -u "http://ca.archive.ubuntu.com/ubuntu/dists/trusty-updates/universe/binary-amd64/" -t deb'
spacecmd repo_create ' -n "External - Ubuntu 14.04 x86_64" -u "http://ca.archive.ubuntu.com/ubuntu/dists/trusty/main/binary-amd64/" -t deb'
spacecmd repo_create ' -n "External - Ubuntu 16.04 backports x86_64" -u "http://ca.archive.ubuntu.com/ubuntu/dists/xenial-backports/main/binary-amd64/" -t deb'
spacecmd repo_create ' -n "External - Ubuntu 16.04 security x86_64" -u "http://ca.archive.ubuntu.com/ubuntu/dists/xenial-security/main/binary-amd64/" -t deb'
spacecmd repo_create ' -n "External - Ubuntu 16.04 universe security x86_64" -u "http://ca.archive.ubuntu.com/ubuntu/dists/xenial-security/universe/binary-amd64/" -t deb'
spacecmd repo_create ' -n "External - Ubuntu 16.04 updates x86_64" -u "http://ca.archive.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-amd64/" -t deb'
spacecmd repo_create ' -n "External - Ubuntu 16.04 universe updates x86_64" -u "http://ca.archive.ubuntu.com/ubuntu/dists/xenial-updates/universe/binary-amd64/" -t deb'
spacecmd repo_create ' -n "External - Ubuntu 16.04 x86_64" -u "http://ca.archive.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/" -t deb'
spacecmd softwarechannel_addrepo '"trusty" "External - Ubuntu 14.04 x86_64"'
spacecmd softwarechannel_addrepo '"trusty-backports" "External - Ubuntu 14.04 backports x86_64"'
spacecmd softwarechannel_addrepo '"trusty-security" "External - Ubuntu 14.04 security x86_64"'
spacecmd softwarechannel_addrepo '"trusty-security-universe" "External - Ubuntu 14.04 universe security x86_64"'
spacecmd softwarechannel_addrepo '"trusty-updates" "External - Ubuntu 14.04 updates x86_64"'
spacecmd softwarechannel_addrepo '"trusty-updates-universe" "External - Ubuntu 14.04 universe updates x86_64"'
spacecmd softwarechannel_addrepo '"xenial" "External - Ubuntu 16.04 x86_64"'
spacecmd softwarechannel_addrepo '"xenial-backports" "External - Ubuntu 16.04 backports x86_64"'
spacecmd softwarechannel_addrepo '"xenial-security" "External - Ubuntu 16.04 security x86_64"'
spacecmd softwarechannel_addrepo '"xenial-security-universe" "External - Ubuntu 16.04 universe security x86_64"'
spacecmd softwarechannel_addrepo '"xenial-updates" "External - Ubuntu 16.04 updates x86_64"'
spacecmd softwarechannel_addrepo '"xenial-updates-universe" "External - Ubuntu 16.04 universe updates x86_64"'
spacecmd softwarechannel_setsyncschedule '"trusty" 0 5 1 8 * ?'
spacecmd softwarechannel_setsyncschedule '"trusty-backports" 0 15 1 8 * ?'
spacecmd softwarechannel_setsyncschedule '"trusty-security" 0 10 1 8 * ?'
spacecmd softwarechannel_setsyncschedule '"trusty-security-universe" 0 16 1 8 * ?'
spacecmd softwarechannel_setsyncschedule '"trusty-updates" 0 20 1 8 * ?'
spacecmd softwarechannel_setsyncschedule '"trusty-updates-universe" 0 24 1 8 * ?'
spacecmd softwarechannel_setsyncschedule '"xenial" 0 30 1 8 * ?'
spacecmd softwarechannel_setsyncschedule '"xenial-backports" 0 40 1 8 * ?'
spacecmd softwarechannel_setsyncschedule '"xenial-security" 0 35 1 8 * ?'
spacecmd softwarechannel_setsyncschedule '"xenial-security-universe" 0 41 1 8 * ?'
spacecmd softwarechannel_setsyncschedule '"xenial-updates" 0 50 1 8 * ?'
spacecmd softwarechannel_setsyncschedule '"xenial-updates-universe" 0 55 1 8 * ?'

Then you can run your initial sync to download packages

spacecmd softwarechannel_syncrepos '"trusty"'
spacecmd softwarechannel_syncrepos '"trusty-backports"'
spacecmd softwarechannel_syncrepos '"trusty-security"'
spacecmd softwarechannel_syncrepos '"trusty-security-universe"'
spacecmd softwarechannel_syncrepos '"trusty-updates"'
spacecmd softwarechannel_syncrepos '"trusty-updates-universe"'
spacecmd softwarechannel_syncrepos '"xenial"'
spacecmd softwarechannel_syncrepos '"xenial-backports"'
spacecmd softwarechannel_syncrepos '"xenial-security"'
spacecmd softwarechannel_syncrepos '"xenial-security-universe"'
spacecmd softwarechannel_syncrepos '"xenial-updates"'
spacecmd softwarechannel_syncrepos '"xenial-updates-universe"'


I also was populating Ubuntu errata using a variation on Philipp Schuler's blog (http://www.devops-blog.net/spacewalk/configuring-errata-for-ubuntu-with-spacewalk). You can skip this paragraph if you don't. The errata will not get cleaned up by the first [David's] set of spacecmd commands, and trying to reload them after rebuilding your channels and repos won't work because, while they aren't linked to the new packages, they are still in the database. So I just connected to the spacewalk db with psql  and deleted the errata entries starting with USN (delete * from rhnerrata where advisory_name like 'USN%'). Then I was able to re-enter the historical errata. See my Sept. 12 mail in this list for more details.

If anybody wants to take the above and massage it into an Ubuntu specific addenda/page linked off the 2.7 upgrade page, I have no objections.

Cheers,

Paul-Andre Panon
Senior systems administrator
 
Office: 604.629.5182 ext 2341 Mobile: 604.679.1617






More information about the Spacewalk-list mailing list