Thursday, December 11, 2014

Curl and download error of packages

Most of the time i am behind a NAT router either at work or at home and those error are pretty common on my openSUSE system.

The old school trick i always do is ping those hosts.

 ping download.opensuse.org 

 ping downloadcontent.opensuse.org 

now edit the file /etc/hosts  and add

 RESULT-OF-IP-FROM-PING  download.opensuse.org 

 RESULT-OF-IP-FROM-PING  downloadcontent.opensuse.org 

eg. something like this.

 195.135.221.134  download.opensuse.org 
 195.135.221.157  downloadcontent.opensuse.org 
 

That trick always saves me from choosing a local mirror manually. It works for me and I'm not saying it will work for everyone, just try it and see.

Monday, April 7, 2014

Boot-Installed-System

Some tips howto boot your not so bootable system using the DVD.












































































































Once you are logged in then you can use
 yast2 bootloader 
 fdisk -l  to check for the bootable flag
 grub2-mkconfig /boot/grub2/grub.cfg 
 mkinitrd 

Good Luck folks!

Saturday, March 8, 2014

Disable autorefresh

Disabling auto refresh of your repositories has some benefits. If you are on a limited internet connection or you just do not want to refresh every time you invoke zypper or yast sw_single then this post might be of interest for you.


Disable auto refresh for all remote repositories.
 zypper mr -R -t 

Now if you want to perform an update obviously you need to refresh the repositories. Here is a function that should help you do that. OpenSUSE defaults to bash for the log-in shell so you can just add this to your /etc/bash.bashrc.local  note that  bashrc.local does not exist and needs to be created.



update () {
## Check if user is root, if not exit with an error.    
if (( EUID !=0 )); then
  echo 'Root privileges are required for refreshing system repositories.' 1>&2
  return 1

fi

## Create an array from the enabled repos by parsing zypper lr.    
enabled=()
while IFS="|" read -ra line; do
  [[ ${line[3]} = *Yes* ]] && enabled+=("${line[0]// /}")

done < <(zypper lr) 

## Refresh all enabled repos and update.   
zypper ref "${enabled[@]}" && zypper up
}

After you have save it you can source bashrc.local run:    source /etc/bash.bashrc.local      and then you can just run:    update 


One question might arise if you change you're log-in shell into something more advance. Don't worry you can just create a bash script and name it    update   (or whatever name you like) and modify that function like this.


#!/bin/bash

## Check if user is root, if not exit with an error.
if (( EUID !=0 )); then
  echo 'Root privileges are required for refreshing system repositories.' 1>&2
  exit 1
fi
 

## Create an array from the enabled repos by parsing zypper lr.
enabled=()
while IFS="|" read -ra line; do
  [[ ${line[3]} = *Yes* ]] && enabled+=("${line[0]// /}")

done < <(zypper lr)
 

## Refresh all enabled repos and update.  
zypper ref "${enabled[@]}" && zypper up


Put it in say   /usr/local/bin  or any place that you are comfortable with. Make it executable
  chmod +x update  Then you can just run   update

Happy updating!