Mittwoch, 4. März 2009

Update-Script für debian

smxi is a general utility script that handles the standard system upkeep for Debian Sid (and Sid based, distros like sidux), Debian Testing, and Debian Stable - kernel installs, dist-upgrade/upgrade, package installs, cleanup, and graphics install. Has full logging, and will create logs on error of key parts. For non sidux systems, like Debian, you can select whether to use aptitude or apt-get, as well as dist-upgrade or upgrade, as smxi defaults when you first start the script.

http://techpatterns.com/forums/about736.html

http://smxi.org/


Installing smxi / sgfxi / svmi
----------------------------------------------------------------------------

There are several ways to install smxi and related scripts sgfxi and svmi:
----------------------------------------------------------------------------
Installing with smxi.zip

I'll start with the easiest. Download and extract the smxi.zip package. This requires the unzip utility. So first let's check if you have it:
# type this command:
which unzip

# if it gives you an answer, you have it.
# If nothing happens when you do that, just do this:
apt-get update && apt-get install unzip

# or, if you prefer aptitude, do:
aptitude update && aptitude install unzip

Ok, so now we're ready to get the file, which contains smxi, svmi, and sgfxi.
# as root, run the following command
cd /usr/local/bin && wget -Nc smxi.org/smxi.zip && unzip smxi.zip && smxi

smxi -h
==================================================================
OPTION HELP MENU: smxi
==================================================================
Options: together: -deghiklmrstuwx or separated: -giktw -f -x
You can run this script with any combination of these options.
You can put them together, like this: -ik, or separate, like this: -w -x
Each option, or group of options, must begin with a -
Example: smxi -ikw skips the system info, kernel install, and warning.
------------------------------------------------------------------
The following allow you skip parts of the du script:
-d Skips dist-upgrade if you also select the w option.
-e Skips some of the 'Please hit enter to continue' questions.
-g Skips the graphics install question.
-i Skips the system information section.
-k Skips the kernel install question.
-R Skips check for latest, restart, and downloading latest script version.
This skips the Restart of the script, that is. Not recommended for most users except
when they are rebooting from a fresh kernel install and running the script again.
-s Skips some parts of script that require an internet connection.
Avoid using this since it disables almost all script functionality.
-S Skips the internet connection test. Use this if script fails connection test
but you know your connection is fine.
-t Skips the Post dist-uprade/upgrade options section.
-w Skips the du warnings section. Starts the pre-upgrade fixes and
dist-upgrade sections automatically if used without -d. Be careful!

The following are advanced script options:
-j Alternate text/output script colors. Requires this syntax: -j 0 (sets to monochrome )
-j 1 (script default); -j 2 (alternate color scheme); -j 3 (nice earthy scheme)
-m Runs the option to change debian mirrors in /etc/apt/sources.list
-M Runs the option to change default sidux-apt/kernel Mirrors
-N Runs the option to change kerNel metapackage status prior to dist-upgrade.
-p Runs apt-get update without using pdiffs. Good for fast connections.
-P Run script with Proxy settings for connection, requires this syntax:
-P http://[<:password>@]<:port> Argument is required.
-U Forces an Update of script before it runs again.
-x Runs extra script features that are not core to central functionality.
-X Download and run a custom user script. Syntax: -X userscript-name#userscript-url
Example: -X my-cleanup-script#somewebsite.com/my-cleanup-script
The script will show as an additional option in the Post upgrade section.
-! 20 - Triggers update of ALL smxi components, including sgfxi, svmi, and inxi.
-! 21 - Downloads and installs rbxi package to /usr/local/bin.

The following can be run in X/kde:
-h Prints this help menu.
-v Prints version and system information, including distro version,
current kernel, apt update and dist-upgrade last used, and last use of smxi.
-W Requires argument: c (print current configs) OR w (print warnings) OR
wc (prints first warnings, then configs). Like this: smxi -W wc
Note: if you want to get the live, current configs/warnings, and not the ones left from
your last smxi use, you must be root in terminal/console.

------------------------------------------------------------------
Remember: to scroll up or down in terminal window, use: shift+pageup/pagedown
------------------------------------------------------------------


smxi -u

Calculating latest sidux kernel version...
==================================================================
smxi :: Version: 8.18.09 :: Last Updated: March 01 2009
------------------------------------------------------------------
Special thanks to the people who have helped with this script, in one way or another...
and to the warning crew: crust drb hubi latino piper zulu9
...and of course, to RazberrieTart, the official sidux fan girl!
------------------------------------------------------------------
Your installed version of Debian Sid is: sidux 2008-03 ÎÏÏέα - xfce - (200809221832)
Operating system: 32 bit
Your CPU is: AMD Athlon(tm) 64 Processor 3200+
File System Information:
/ - Type: ext3 Size: 8.7G Used: 2.7G ( 33% ) Free: 5.6G
/home - Type: ext3 Size: 9.0G Used: 795M ( 10% ) Free: 7.8G
------------------------------------------------------------------
Your current kernel version is: 2.6.28-7.slh.1-sidux-686
The latest kernel for your system is: 2.6.28-7.slh.2-sidux-686
------------------------------------------------------------------
nVidia driver support status:
Kernel 2.6.28: Works with current stable drivers 180.xx and 96.xx, and with Legacy
nVidia drivers 173.xx/71.xx. The Betas work fine for most people. Select the install
beta driver option in smxi and the proper driver will be installed.

Kernel 2.6.29: should work with current nVidia stable drivers: 180.xx, 96.43.11
and with beta legacy 173.xx, 71.xx drivers in smxi, or via sgfxi -cB
------------------------------------------------------------------
Last apt-get package database update: 2009-03-04-08:54
Last apt-get package install or upgrade: 2009-03-04-08:54
Last use of smxi: 2009-03-04-08:44
Last dist-upgrade using smxi: 2009-03-04-08:54
------------------------------------------------------------------
If something scrolls by in the script before you can read it, you can move up or down
in your terminal window by hitting Shift + Page Up or Page Down.
------------------------------------------------------------------
Please hit enter to continue

==================================================================
KERNEL QUESTION :: Module Version: 2.5.22 :: Last Updated: February 25 2009
------------------------------------------------------------------
If you are using wifi, you may need to reinstall your wifi drivers to the new kernel.
------------------------------------------------------------------
If you restart the script after you reboot and no network connection is found,
the script will offer you choices of wifi modules to reinstall automatically.
------------------------------------------------------------------
If you use Nvidia or Fglrx video drivers, you must reinstall them after your kernel install.
Graphics drivers can now be reinstalled without a reboot, right to the new kernel.

If you are going to use this script for the dist-upgrade, just install the kernel,
then, when kernel install is finished, select the continue option, and
you can install your nvidia or fglrx drivers without rebooting.
------------------------------------------------------------------
Please note, if you install a kernel, a backup copy of your grub configuration file
menu.lst, will be created here: /boot/grub/menu.lst-bu-09-03-04.
------------------------------------------------------------------
Your current kernel version is: 2.6.28-7.slh.1-sidux-686
------------------------------------------------------------------
1 - Installs latest sidux apt kernel: 2.6.28-7.slh.2-sidux-686

2 - Install kernel modules. Offers list of modules, install one by one (if currently available in apt).
3 - Remove installed kernel modules. Offers list of modules, remove one by one.
4 - Advanced Kernel Install. The advanced options allow you do the following:
* Install archived kernels. Sometimes older kernels work and newer ones don't for some users.
* Any supported current apt kernel install(s) for your sidux system, with module installer automated.
* kernel meta-package Remove kernel meta-packages; install them; install apt kernels.

5 - Continue to dist-upgrade without installing a new kernel.
------------------------------------------------------------------
Please type the appropriate number and hit enter
------------------------------------------------------------------
1) install-apt-kernel 4) advanced-kernel-options
2) install-kernel-modules 5) continue
3) remove-kernel-modules
#?

Alerts Last Modified: 26 February 2009 17:26 (gmt)
------------------------------------------------------------------
1. Debian Lenny has now gone stable (Feb 14). Please watch your upgrade data VERY CLOSELY
to make sure nothing is breaking or failing. Make sure to read these alerts/warnings!!.

Smxi holds have been improved, and upgrades are fairly smooth so far for us. But if you
don't need to do an upgrade now, I'd still recommend waiting a week or two.

Sid is getting a lot of new packages, and tests so far have been quite good, with of
course bumps. All my test systems are upgrading well with smxi so far.

The package cups-driver-gutenprint replaces cupsys-driver-gutenprint, which will be removed.
------------------------------------------------------------------
2. If you use amsn or gretl: problem with tcl8.5/tk8.5 8.5.6-2 that breaks them.
If you need amsn or gretl, just wait to upgrade.
------------------------------------------------------------------
3. Newly arrived and working: Gimp 2.6; OpenOffice 3;
Not yet here: Xorg new, KDE 4; hpoj
------------------------------------------------------------------
4. * Replaced by libbind9-40: libdns42 libisc41 libisccc40 libisccfg40
* liblame0 replaced by libmp3lame0
* sun-jre-1.x is replaced by new gcj-4.3 packages
-----------------------------------------------------------------
5. Ignore any messages about lilo or running it, it's not needed, you can
purge it safely, this is a legacy thing, not used in most cases: apt-get purge lilo
------------------------------------------------------------------
1 - Continue with dist-upgrade. Proceed with caution. Watch for fixes noted above.
2 - Continue without doing the dist-upgrade.
This will let you do graphics install and various other smaller functions.

3 - Quit the script now.
------------------------------------------------------------------
Please type the appropriate number and hit enter
------------------------------------------------------------------
1) continue 3) quit
2) continue-no-dist-upgrade
#?

------------------------------------------------------------------
Running assorted tasks to prepare for the system dist-upgrade...
------------------------------------------------------------------
Checking package groups for version mismatches.................
Check of package group version mismatch completed.
------------------------------------------------------------------
Running Amarok package version mismatch tests now...
No version mismatches detected in Amarok. Continuing...
------------------------------------------------------------------
Running Evolution package version mismatch tests now...
No version mismatches detected in Evolution. Continuing...
------------------------------------------------------------------
Running Gimp package version mismatch tests now...
No version mismatches detected in Gimp. Continuing...
------------------------------------------------------------------
Running Gnome Group 1 package version mismatch tests now...
No version mismatches detected in Gnome Group 1. Continuing...
------------------------------------------------------------------
Running Gnome Group 2 package version mismatch tests now...
The package libgnomeui-0 has a mismatched version number from libgnome2-common
Version numbers: 2.20.1.1 2.24.1
The package libgnomeui-common has a mismatched version number from libgnomeui-0
Version numbers: 2.24.0 2.20.1.1
The package libgnomeui32 has a mismatched version number from libgnomeui-common
Version numbers: 1.4.2 2.24.0

Package version mismatches were detected in Gnome Group 2
Adding Gnome Group 2 package group to hold/install list...
------------------------------------------------------------------
Running Gnome Group 3 package version mismatch tests now...
No version mismatches detected in Gnome Group 3. Continuing...
------------------------------------------------------------------
Running Gnome VFS package version mismatch tests now...
No version mismatches detected in Gnome VFS. Continuing...
------------------------------------------------------------------
Running hplip package version mismatch tests now...
You do not appear to have hplip installed. Continuing...
------------------------------------------------------------------
Running OpenOffice.org package version mismatch tests now...
You do not appear to have OpenOffice.org installed. Continuing...
------------------------------------------------------------------
Running Transmission package version mismatch tests now...
No version mismatches detected in Transmission. Continuing...
------------------------------------------------------------------
Running Vegastrike package version mismatch tests now...
You do not appear to have Vegastrike installed. Continuing...
------------------------------------------------------------------
Running Wesnoth package version mismatch tests now...
You do not appear to have Wesnoth installed. Continuing...
------------------------------------------------------------------
Running Xpdf package version mismatch tests now...
You do not appear to have Xpdf installed. Continuing...
------------------------------------------------------------------
Testing hold/install list package status...
Changing module-init-tools package status in dpkg to: hold
Changing libgnome2-0 package status in dpkg to: hold
Changing libgnome2-common package status in dpkg to: hold
Changing libgnomeui-0 package status in dpkg to: hold
Changing libgnomeui-common package status in dpkg to: hold
Changing libgnomeui32 package status in dpkg to: hold
------------------------------------------------------------------
Finished with the pre-upgrade tasks.
==================================================================
MAIN DIST-UPGRADE HANDLER
------------------------------------------------------------------
Answer y instead of the standard n if you are asked to
replace the following config files during dist-upgrade:
Configs Last Modified: 20 October 2008 02:08 (gmt)
------------------------------------------------------------------
/etc/X11/Xresources/X11-common
/etc/init.d/rc.local
/etc/skel/.kde/share/config/kdesktoprc
/etc/defaults/distro
/etc/init.d/xdm
/etc/locale.alias
/etc/init.d/gpm
/etc/init.d/acpid
/etc/acpi/powerbtn.sh
/etc/skel/bashrc
/etc/bash/bashrc
/etc/init.d/procps
### IMPORTANT ### for udev, make sure to say 'y' to use new config file!!!!
### Failure to do this may make your system unbootable!!!
/etc/init.d/udev

For ALL powersaved configs, please answer Y

Answer 'n' to these questions:
kde passwrd/login config file question ( if you see it)
/etc/kde3/kdm/kdmrc
------------------------------------------------------------------
Checking apt-get dist-upgrade for packages to be removed...
No packages will be removed in your dist-upgrade today. Continuing...
------------------------------------------------------------------
You are now ready to begin your dist-upgrade. Make sure that it goes all the
through without errors, and of course, always check for packages to be removed.
------------------------------------------------------------------
Please hit enter to continue

==================================================================
MAIN DIST-UPGRADE HANDLER
------------------------------------------------------------------
Answer y instead of the standard n if you are asked to
replace the following config files during dist-upgrade:
Configs Last Modified: 20 October 2008 02:08 (gmt)
------------------------------------------------------------------
/etc/X11/Xresources/X11-common
/etc/init.d/rc.local
/etc/skel/.kde/share/config/kdesktoprc
/etc/defaults/distro
/etc/init.d/xdm
/etc/locale.alias
/etc/init.d/gpm
/etc/init.d/acpid
/etc/acpi/powerbtn.sh
/etc/skel/bashrc
/etc/bash/bashrc
/etc/init.d/procps
### IMPORTANT ### for udev, make sure to say 'y' to use new config file!!!!
### Failure to do this may make your system unbootable!!!
/etc/init.d/udev

For ALL powersaved configs, please answer Y

Answer 'n' to these questions:
kde passwrd/login config file question ( if you see it)
/etc/kde3/kdm/kdmrc
------------------------------------------------------------------
Checking apt-get dist-upgrade for packages to be removed...
No packages will be removed in your dist-upgrade today. Continuing...
------------------------------------------------------------------
You are now ready to begin your dist-upgrade. Make sure that it goes all the
through without errors, and of course, always check for packages to be removed.
------------------------------------------------------------------
Please hit enter to continue
------------------------------------------------------------------


Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
libgnome2-0 libgnome2-common libgnomeui-common module-init-tools
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
------------------------------------------------------------------
Your dist-upgrade appears to have completed with no errors.
You can continue on safely to do the rest of the script now.

It does not hurt to run dist-upgrade-again [option 2] once after a
successful dist-upgrade just to make sure things are fine though.
------------------------------------------------------------------
1 - use-install-f Use this to try to resolve error in dist-upgrade.
2 - dist-upgrade-again Run this after correcting an error with 1.

3 - check-services Runs rcconf to let you turn back off any services that might
have been turned on during the dist-upgrade (more options in the future).

4 - continue Continue on with script, do this when dist-upgrade is successful.
5 - quit If you need to fix error, you can exit here. In general, please
do not exit unless you need to. The script often runs post dist-upgrade fixes
when you use continue, and if you exit here, they will not run.
------------------------------------------------------------------
Please type the appropriate number and hit enter
------------------------------------------------------------------
1) use-install-f 3) check-services 5) exit
2) dist-upgrade-again 4) continue
#?

#? 4
Ok, you are ready to go on now.
------------------------------------------------------------------
Changing module-init-tools package status in dpkg to: install
Changing libgnome2-0 package status in dpkg to: install
Changing libgnome2-common package status in dpkg to: install
Changing libgnomeui-0 package status in dpkg to: install
Changing libgnomeui-common package status in dpkg to: install
Changing libgnomeui32 package status in dpkg to: install
==================================================================
POST DIST-UPGRADE FIXES
------------------------------------------------------------------
This is a list of various things you can do at this point to
handle some loose ends after doing a dist-upgrade.
------------------------------------------------------------------
1 - package-install are options of packages to install.
Has for main categories - 1: office suites: openoffice.org, + language pack selections; gnu office
2: non-free: flash, msttcorefonts, opera, google earth; 3: Utilities: swiftfox, other good stuff
4: display-managers: Desktop/window managers; 5: servers: Samba NFS Apache2 (+Mysql,PHP5)
2 - package-removal is a way to totally remove packages/programs you don't want.
Check it out to see if any of the packages listed are things you don't need.
One option is to remove all the german language packages from your system.
3 - clean-up-stuff This feature has a variety of clean up options:
1: apt-get clean; 2: apt-get autoclean, clean up only non-current deb files;
3: kernel removal options, remove all non-current kernels; 4: kernel module remover;
5: backup file cleanup; 6: clean kanotix conversion packages; 7: clean unused xorg modules
4 - miscellaneous-tweaks Current options are: mozilla-tweaks,
which gets rid of gtk filehandlers and other annoyances in Mozilla products;
sidux-artwork - add sidux graphics - kmenu, icon, grub; and misc system config tweaks.
A legacy tweaks section has older, deprecated tweaks like alsaconf and some cleanup stuff.
New! openoffice.org hold/install/update feature. Lets you hold or remove hold easily.
5 - virtual-machine-installer Installs vbox (OSE or non-ose), vbox modules, sets up users.
Also has any-any script install, and basic vmware install.
6 - kernel-options Install kernels. Install latest, and older, kernels.
NEW: metapackage options; NEW: kernel-module-remover

7 - Continue to graphics driver installation.
8 - Restart desktop/X (skip graphics (re)install).
9 - Exits the script.
------------------------------------------------------------------
Please type the appropriate number and hit enter
------------------------------------------------------------------
1) package-install 6) kernel-options
2) package-removal 7) continue-to-graphics
3) clean-up-stuff 8) start-desktop
4) miscellaneous-tweaks 9) quit
5) virtual-machine-installer
#?

=================================================================
PACKAGE INSTALL :: Module Version: 3.1.12 :: Last Updated: February 22 2009
------------------------------------------------------------------
The following sections will be expanded over time, but these are your
current Package Install options (apt sources updated where needed):
------------------------------------------------------------------
1 - office Features OpenOffice.org installer. Language pack selector.
Now also offers OpenOffice hold/install/update option as well.

2 - non-free Flash plugin, Java plugin, msttcorefonts, Opera, Skype, Google Earth.

3 - utilities tools: console browsers, networking (ceni), swiftfox, inxi, rbxi, and more.

4 - display-managers Install Xorg, Kde, Xfce, fVwm Crystal.

5 - servers Install Samba, NFS, and Apache2 (+MySql,PHP) server components.

6 - select-system-type Set client/server system type flag. This will remove
or add a few items from package groups depending on your selection. Most people
can skip this, but if you're setting up a server, you might want to set this flag.

7 - back-to-main-menu
------------------------------------------------------------------
Please type the appropriate number and hit enter
------------------------------------------------------------------
1) office 4) display-manager 7) back-to-main-menu
2) non-free 5) servers
3) utilities 6) select-system-type
#?

Continuing to graphics driver install...
==================================================================
GRAPHICS QUESTION :: Module Version: 2.4.1 :: Last Updated: January 23 2009
------------------------------------------------------------------
Your currently Installed Nvidia Driver is: 173.14.17
------------------------------------------------------------------
nVidia driver support status:
Kernel 2.6.28: Works with current stable drivers 180.xx and 96.xx, and with Legacy
nVidia drivers 173.xx/71.xx. The Betas work fine for most people. Select the install
beta driver option in smxi and the proper driver will be installed.

Kernel 2.6.29: should work with current nVidia stable drivers: 180.xx, 96.43.11
and with beta legacy 173.xx, 71.xx drivers in smxi, or via sgfxi -cB
------------------------------------------------------------------
You can quit, start X now, or install one of the following drivers.
The xorg driver does not need to be reinstalled with new kernels or xorg updates.
------------------------------------------------------------------
install-xorg-driver - Install native, Free, non binary blob xorg nv drivers. This will
also update your xorg.conf and clean out all currently installed binary drivers.
debian-nvidia - Debian method nVidia driver installation.
This will install the Debian nVidia driver.
oldest-nvidia - Use if you have problems with newer nVidia install.
Recommended for older, legacy nvidia cards, or if you want a lightweight driver.
This will install this nVidia driver: 71.86.06
older-nvidia-c Recommended for midrange cards nVidia driver installed with -c option.
This will install this nVidia driver: 96.43.11
5xxx-nvidia-c - Latest driver for your GeForce FX 5xxx card, with -c option.
This will install this nVidia driver: 173.14.12

nvidia-beta-driver - Installs latest nVidia beta driver (if available) for your card type.
If none is available, the latest stable nVidia driver for your card model is used instead.

start-desktop - No graphics driver install. Quit script, start desktop / X.
quit - No graphics driver install. Quit script, stay in console.
------------------------------------------------------------------
Please type the appropriate number and hit enter
------------------------------------------------------------------
1) install-xorg-driver 4) older-nvidia-c 7) start-desktop
2) debian-nvidia 5) 5xxx-nvidia-c 8) quit
3) oldest-nvidia 6) nvidia-beta-driver
#?