Re: [opensuse] Zypper segmentation fault



Carlos E. R. wrote:


On Wednesday, 2009-03-25 at 01:02 -0500, David C. Rankin wrote:

the list of files you updated from there. For example, use 'zypper lr
-u' to

Remember that his "zypper" segfaults. He can not use zypper for
anything, (nor yast) just raw rpm.

] Subject : Re: [opensuse] Zypper segmentation fault


-- Cheers,
Carlos E. R.


Yes,

The script uses rpm. I guess I should have added that if the OP (I'm not going
to try to spell the name) can't even use zypper lr to find out what
repositories he has, then he will need to just look in /etc/zypp/repos.d to get
the URLs for the offending repos, then the script will take care of the rest.

Zypper didn't have anything to do with the repair beyond having text config
files that will point to the URL of the repository where the conflicting
updates came from. Then it just checks whether any of the files in that repo
are installed via rpm -q and if so, then downgrades the package to the original
..... crud! I knew I missed something.... This will do it:


#!/bin/bash

showem () {
echo -e "\n\tARCH = $ARCH"
echo -e "\tBADREPO = $BADREPO"
echo -e "\tOSSREPO = $OSSREPO"
echo -e "\tRPMURL = $RPMURL"
echo -e "\tRPMFILE = $RPMFILE"
echo -e "\tRPMNAME = $RPMNAME"
echo -e "\tRPM = $RPM"
echo -e "\tOSSURL = $OSSURL\n"
}

getarch() {
case $(arch) in
i[3-6]* ) echo i586;;
*64 ) echo x86_64;;
esac
}

[[ -z $1 ]] && { echo "\n\tUsage: ${0##*/} URL-2-BadRepository\n"; exit 1; }

ARCH=$(getarch)
BADREPO=$(echo $1 | sed -e 's/\/$//')/${ARCH}
OSSREPO=http://download.opensuse.org/distribution/11.0/repo/oss/suse/${ARCH}

# use lynx to get the list, or just save the list to a file and change
# the filename at the end of the while loop

if [[ ! -r "/tmp/repolist" ]]; then
echo -e "Retrieving suspect RPM list from ${BADREPO}\n"
if lynx -dump ${BADREPO} > /tmp/repolist; then
sed -e '/mirrorlist/d' -e '/metalink/d' -e '/\s\[/d' -e 's/^.*http/http/'
/tmp/repolist | grep rpm > /tmp/repofinal
else
echo -e "\n\tUnable to get RPM list from ${BADREPO}, check your URL\n"
exit 1
fi
fi

if [[ ! -r "/tmp/osslist" ]]; then
echo -e "Retrieving OSS RPM list from ${OSSREPO}\n"
if lynx -dump ${OSSREPO} > /tmp/osslist; then
sed -e '/mirrorlist/d' -e '/metalink/d' -e '/\s\[/d' -e 's/^.*http/http/'
/tmp/osslist | grep rpm > /tmp/ossfinal
else
echo -e "\n\tUnable to get OSS RPM list from ${OSSREPO}\n"
exit 1
fi
fi

while IFS=$'\n' read line; do

RPMURL=${line}
RPMFILE=${line##*/}
RPMNAME=${RPMFILE/%.x86_64.rpm/}
RPM=$(echo $RPMNAME | sed -e 's/-[0-9][.][0-9].*$//')
showem
if rpm -q $RPMNAME >/dev/null 2>&1; then
OSSURL=$(grep $RPM /tmp/ossfinal)
if [[ -n $OSSURL ]]; then
echo -e "\tDowngrading: $RPMNAME to ${OSSURL##*/}"
rpm -Uvh --oldpackage ${OSSURL}
else
echo -e "\tPackage: $RPM, not available in ${OSSREPO}"
fi
showem
fi

done < /tmp/repofinal


--
David C. Rankin, J.D.,P.E.
Rankin Law Firm, PLLC
510 Ochiltree Street
Nacogdoches, Texas 75961
Telephone: (936) 715-9333
Facsimile: (936) 715-9339
www.rankinlawfirm.com
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx



Relevant Pages

  • Re: [opensuse] Package manager for command line?
    ... I know there are apt, smart, zypper and maybe even more. ... rpm will not download. ... I want to install packages by script. ...
    (SuSE)
  • Re: [opensuse] Zypper died suddenly!
    ... to the responses to my "Changing zypper command" message of last week. ... It *might* also indicate that 'libzypp' was updated - since that would have ... rpm -q libzypp ... Initially though, just try with zypper-.rpm, run the rpm command, ...
    (SuSE)
  • Re: [opensuse] packman off-line?
    ... Error message: Empty reply from server ... i've used "rpm --rebuilddb" before, when the rpm DB got messed up, usually because of a system crash due to power outage that the UPS didn't catch. ... and i'm still getting the same error when zypper tries to refresh the packman repo. ...
    (SuSE)
  • Re: [opensuse] Zypper Dup Failed : unpacking of archive failed: cpio: Bad magic
    ... zypper in rpm before the zypper dup. ... They have changed the rpm compression format. ... The following NEW package is going to be installed: ... with internet connection) or is there any problem with my installation ...
    (SuSE)
  • Re: [opensuse] Installing Virtual Box on 11.2
    ... This will install the downloaded RPM not the OSE version (as long as ... zypper at the RPM). ...
    (SuSE)