If you are new to the zypper-upgraderepo plugin, give a look to the previous article to better understand the mission and the basic usage.
The first important change is inherent the way to check a valid repository:
Most of the times we want to check the whole repository’s list at once, but sometimes we want to check few of them to see whether or not they are finally available or ready to be upgraded without looping through the whole list again and again. That’s where the –only-repo switch followed by a list of comma-separated numbers comes in help.
The disabled repositories now are shown by default and a new column highlights which of them are enabled or not, keeping their number in sync with the zypper lr
output. To see only the enabled ones just use the switch –only-enabled.
Beside the table view, the switch –report introduce a new pleasant view using just two columns and spanning the right cell to more rows in order to improve the number of info and the reading quality.
The procedure which tries to discover an alternative URL now dives back and forth the directory list in order to explore the whole tree of folders wherever the access is allowed by the server itself. The side effect is a general improvement also in repo downgrade.
The output in upgrade mode is now verbose and shows a table similar to the checking one, giving details about the changed URLs in the details column.
The server timeout error is now handled through the switch –timeout which allows tweaking the time before to consider an error any late answer from the server itself.
This plugin is practically completed, achieving all the goals needed for its main purpose no other relevant changes are scheduled, so I started thinking of other projects to work in my spare time.
Among them, there is one I am interested in: bring the power of openSUSE software search page to the command line.
However, there are some problems:
I have already got some ideas to solve them and did lay down several lines of code, so let’s see what happens!
]]>This tool started as a personal project when a day I was in the need to upgrade my distro quicker than using a traditional ISO image, Zypper was the right tool but I got a little stuck when I had to handle repositories: some of them were not yet upgraded, others changed slightly in the URL path.
Who knows how to Bash the problem is not exactly a nightmare, and so I did until I needed to make a step further.
The result is zypper-upgraderepo Ruby gem which can be integrated as a zypper plugin just installing the zypper-upgraderepo-plugin package.
Installing zypper-upgraderepo-plugin is as easy as:
sudo zypper ar https://download.opensuse.org/repositories/home:/FabioMux/openSUSE_Leap_42.3/home:FabioMux.repo
sudo zypper in zypper-upgraderepo-plugin
Sometime we want to know the status of current repositories, the command zypper ref does a similar job but it is primarily intended to update the repository’s data and that slow down a bit the whole process.
Instead we can type:
$ zypper upgraderepo --check-current
To know whether or not all the available repositories are upgrade-ready:
$ zypper upgraderepo --check-next
As you can see from the example above all the enabled repositories are ready to upgrade except for the OSS repo which has a slightly different URL.
# The URL used in the openSUSE Leap 42.3
http://download.opensuse.org/distribution/leap/42.3/repo/oss/suse/
# The suggested one for openSUSE Leap 15.0
http://download.opensuse.org/distribution/leap/15.0/repo/oss/
Let’s try again overriding the URL without make any real change:
$ zypper upgraderepo --check-next \
--override-url 8,http://download.opensuse.org/distribution/leap/15.0/repo/oss/
Once everything is ok, and after performed a backup including all the repositories, it’s time to upgrade all the repository at once:
$ sudo zypper upgraderepo --upgrade \
--override-url 8,http://download.opensuse.org/distribution/leap/15.0/repo/oss/
That’s all with the basic commands, more information is available in the wiki page of zypper-upgraderepo gem where all the commands are intended with the only use of the gem, but installing the plugin they are also available as zypper subcommands like shown above, also a man page is available as
$ zypper help upgraderepo
wxRuby is an old but working library based on wxWidgets toolkit, till some day ago the dependency from SWIG 1.3.38 and some small errors raised during the manual compilation, made the use of this library the worst nightmare for beginners who was looking for a fast approach to GUI based programming in Ruby.
After some day spent to investigate about a possible upgrade of the SWIG dependency to the current 2.0 version, i produced some patches to fix this and the other annoying compiling errors, and finally, thanks to the Buildservice infrastructure, a wxRuby RPM compiled from sources with the relative patches are now availables for all openSUSE users!
As far i googled this should be the first distro to have a precompiled and working wxruby gem among its repositories (being compiled from sources the gem is generated for 32 and 64 bits architecture from Buildservice itself), so Rubyists take a look on software.opensuse.org, select the package coming from my home project account and enjoy!
]]>Usually need install the wxGTK libraries and the gem wxruby (or wxruby-ruby19 if using ruby 1.9) and start creating your own scripts.
$ sudo zypper in wxGTK wxGTK-gl
$ sudo gem install wxruby
But sometimes we could find an Error for a wrong compatibilty between the installed version of the wxGTK libraries and the wrapper library included in the gem.
/usr/lib/ruby/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so:
symbol _ZN13wxAuiNotebook14ShowWindowMenuEv, version WXU_2.8.5 not defined in file libwx_gtk2u_aui-2.8.so.0 with link time reference -
/usr/lib/ruby/gems/1.8/gems/wxruby-2.0.1-x86-linux/lib/wxruby2.so
When an error like this appear, the unique solution is recompile the gem.
What we need:
Added the repository which contains the Ruby extensions (warning to the portion of the address that refers the version of openSUSE), we can proceed with the installation confirming the request of the dependent packages:
$ sudo zypper ar http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions/openSUSE_11.3/ RubyExtensions
$ sudo zypper ref
$ sudo zypper install rubygems rubygem-rake gcc-c++ wxGTK-devel rubygem-ffi-swig-generator make
It’s time to download the sources of SWIG version 1.3.38 from sourceforge, then uncompress and install it:
tar -xvf swig-1.3.38.tar.gz
cd swig-1.3.38
./configure && make
sudo make install
All the packages are ready, we have to set some environment variables before continue:
export SWIG_CMD=/usr/local/bin/swig
export WXRUBY_EXCLUDED=GLCanvas
export WXRUBY_VERSION=2.0.1
The second instruction is important for ignore all the references to the openGL library, which are not availables in unicode version.
The next step is download the wxRuby’s source from Rubyforge and start to compile
tar -xvf wxruby-2.0.1.tar.gz
cd wxruby-2.0.1
rake
After this procedure end you can remove the old gem and build & install the new:
rake gem
sudo gem install wxruby-2.0.1-x86-linux.gem
Personally, I needed recompile wxRuby in openSUSE 11.2; with the new version (11.3) standard packages work fine, anyway i wished share my experience for someone could meet the same trouble in the future :))
]]>(This article is also available for italian users)
That’s all for now, hope it help to enjoy a bit more this fantastic Desktop Environment, any new hint is welcome, just leave a comment below