Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
becki:linux:slack_upgrade [2014-01-09 07:12] becki |
becki:linux:slack_upgrade [2018-09-15 08:33] (aktuell) becki [Keep your system up to date] |
||
---|---|---|---|
Zeile 2: | Zeile 2: | ||
===== Abstract == | ===== Abstract == | ||
- | FIXME | + | This page describes how to keep your Slackware system up to date. |
===== Keep your system up to date == | ===== Keep your system up to date == | ||
- | ''slackpkg'' is a very convenient tool for that job. It can download update packages from the net and install them. In order to use it, you first have to uncomment a Slackware mirror close to your location for your Slackare version in the file ''/etc/slackpkg/mirrors'' | + | Check if updates are necessary at all: |
+ | slackpkg check-updates | ||
- | ( ftp://ftp.gwdg.de/pub/linux/slackware/slackware-current/ works good for Germany ) | + | Make sure you don't have any old ''.new'' files somewhere: |
+ | find /etc -name '*.new' # Output must be empty! | ||
+ | find /usr -name '*.new' # Output must be empty, except titletoc.new & titletoc.new in /usr/share/texmf/... | ||
+ | find /var -name '*.new' # Output must be empty! | ||
- | Slackpkg Usage: | + | Make a (becki)backup of your whole system |
- | <code bash> | + | |
- | rm -r /etc.bak; # Back up /etc to be on the save side | + | |
- | cp -a /etc /etc.bak | + | |
- | slackpkg check-updates # to see if updates are necessary at all | + | |
- | slackpkg update # to update the package list | + | |
- | slackpkg upgrade-all # to finally install the new versions of existing packages | + | |
- | </code> | + | |
- | <note important>If the kernel was updated as well, the symlink ''/etc/rc.d/rc.modules'' must be adjusted manually</note> | + | Make copies of these dirs, to be on the save side: |
+ | rm -r /boot.bak | ||
+ | cp -a /boot /boot.bak | ||
+ | rm -r /etc.bak | ||
+ | cp -a /etc /etc.bak | ||
- | ===== Keeping up with Slackware current or upgrade System to another Slackware version == | + | Check if ''sbMergeEtcConfig'' is up to date |
- | <code bash> | + | Make sure to have a copy of the original version of every file you modified in ''/etc''. Give the original files a uniform extension, eg. ''.sborg'' |
- | rm -r /etc.bak; | + | |
- | cp -a /etc /etc.bak | + | |
- | slackpkg check-updates | + | |
- | slackpkg update | + | |
- | slackpkg install-new | + | |
- | slackpkg upgrade-all | + | |
- | slackpkg clean-system | + | |
- | </code> | + | |
- | <note warning>Take care, ''slackpkg clean-system'' removes unofficial packages as well. You have to put unofficial packages into the blacklist. See comments in ''/etc/slackpkg/blacklist'' and ''man slackpkg''.</note> | + | Especially check if ''group.sborg gshadow.sborg passwd.sborg shadow.sborg'' have been created at initial install or at a former update. If not, the original versions of these files can be found at any mirror in package ''a/etc''. |
- | <note important>''install-new'' would install packages you intentionally skipped (e.g KDEI) as well. To avoid this add those package to the blacklist!</note> | + | If ''/etc/rc.d/rc.inet1.conf'' has been modified, eg via ''netconfig'' make sure, that all regarding config files have their backuped originals as .sborg files. These are: ''etc/rc.d/rc.inet1.conf /etc/HOSTNAME /etc/hosts /etc/networks /etc/resolv.conf'' |
- | Whole package series can be blacklisted as well, eg | + | Check if mirror url in ''/etc/slackpkg/mirrors'' points to the right slackware version |
- | ./slackware64/kdei | + | |
- | blacklists everything from the kdei series (tested). [[https://www.linuxquestions.org/questions/slackware-14/slackpkg-blacklist-entire-branch-4175419214/|See also]] | + | |
+ | Take care, ''slackpkg clean-system'' removes unofficial packages as well. You have to put unofficial packages into the blacklist. Check ''/etc/slackpkg/blacklist''. At least kernel, kernel-modules ans sbo packages should be blacklisted: | ||
+ | kernel-generic | ||
+ | kernel-generic-smp | ||
+ | kernel-huge | ||
+ | kernel-huge-smp | ||
+ | kernel-modules | ||
+ | kernel-modules-smp | ||
+ | [0-9]+_SBo | ||
- | ===== Howto fix Config Files in /etc == | + | If the kernel is to be updated: Manually download the //new// kernel and its modules from ''patches/packages/linux-<new-kernel-version>''. Note that in the 64-bit versions of Slack, SMP is the default, so there are no explicit SMP-packages of kernel or modules. Install with ''installpkg'' (not with ''upgradepkg''!) |
- | <note important>Make sure to have a copy of the original version of every file you modified. Give the original files a uniform extension, eg. ''.sborg''</note> | + | Sync your local mirror for the multilib packages if you use them |
- | <note important>Make sure you don't have any old ''.new'' files somewhere in ''/etc''</note> | + | Check if there is enough empty space in the ''/'' partition for the uptdate. With full KDE and kernel-source, 3 GiB is //not// enough. Without X and kernel-source 2 GiB should work. (Upate 14.1 -> 14.2). |
+ | If you don't have enough space, you might fist deinstall unnecessary packages in kde, kdei series and the kernel-source package (Go to a Slack mirror and sort packages by size). Moreover you can reconfig the slackpg cache dir in ''/etc/slackpkg/slackpkg.conf'' to a dir in another partition. | ||
- | After slackpkg has installed the new packages you will be asked how to treat the new config files. Select the first option, i.e. old config files are preserved and new config files get the extension ''.new''. Now locate all new config files with: | + | Update the package list and upgrade the package manager itself: |
+ | slackpkg update | ||
+ | slackpkg upgrade slackpkg | ||
- | find /etc -name '*.new' | + | Then fix ''/etc/slackpkg/mirrors'' and ''/etc/slackpkg/blacklist'' using ''sbMergeEtcConfig'' and update the package list again: |
- | For everey new config file, it is most convenient to do an automated ''mv'' or ''merge'' with the following script: | + | slackpkg update |
- | <code bash> | + | If necessary, install the synced multilib packages (see below) **or** without multilib just upgrade glibc-solibs: |
- | #!/bin/bash | + | slackpkg upgrade glibc-solibs |
- | # file: sbmergeEtcConfig | + | |
- | # stettings start | + | Now, only for Slack current or upgrade to next Slackware version: |
- | SEARCHDIR='/etc' | + | slackpkg install-new |
- | NEWSFX='new' | + | |
- | ORGSFX='sborg' | + | |
- | MRGSFX='merged' | + | |
- | # stettings end | + | |
- | DRYRUN='' | + | According to http://docs.slackware.com/howtos:slackware_admin:systemupgrade ''install-new'' installs ony new packages. It does //not// install packages you intentionally skipped on installaton. |
- | if [ "$1" != 'real' ]; then | + | |
- | echo "DRYRUN MODE. Use \"$(basename $0) real\" for real changes!" | + | |
- | DRYRUN='true' | + | |
- | fi | + | |
- | mergeit() { | + | Finally install the new versions of existing packages: |
- | local new="$1" | + | slackpkg upgrade-all |
- | local cur="$(dirname "$new")/$(basename "$new" ".$NEWSFX")" | + | |
- | local org="$cur.$ORGSFX" | + | |
- | local mrg="$cur.$MRGSFX" | + | |
- | if [ ! -r $new ]; then | + | |
- | echo "ERROR: Can't read $new!" | + | |
- | return | + | |
- | fi | + | |
- | if [ ! -r $cur ]; then | + | |
- | echo "ERROR: Can't read $cur!" | + | |
- | return | + | |
- | fi | + | |
- | if [ -r $org ]; then | + | |
- | echo "merge -p $cur $org $new > $mrg" | + | |
- | $DRYRUN merge -p "$cur" "$org" "$new" > "$mrg" | + | |
- | if [ $? -ne 0 ]; then | + | |
- | echo "ERROR: Merge conflict $cur!" | + | |
- | return | + | |
- | fi | + | |
- | echo "cat $mrg > $cur" | + | |
- | if [ "$DRYRUN" != 'true' ]; then | + | |
- | cat "$mrg" > "$cur" | + | |
- | fi | + | |
- | if [ $? -ne 0 ]; then | + | |
- | echo "ERROR: Can't cat $mrg to $cur!" | + | |
- | return | + | |
- | fi | + | |
- | echo "mv $new $org" | + | |
- | $DRYRUN mv "$new" "$org" | + | |
- | if [ $? -ne 0 ]; then | + | |
- | echo "ERROR: Can't mv $new to $org!" | + | |
- | return | + | |
- | fi | + | |
- | else | + | |
- | echo "mv $new $cur" | + | |
- | $DRYRUN mv "$new" "$cur" | + | |
- | if [ $? -ne 0 ]; then | + | |
- | echo "ERROR: Can't mv $new to $cur!" | + | |
- | return | + | |
- | fi | + | |
- | fi | + | |
- | } | + | |
- | for new in $(find "$SEARCHDIR" -name "*.$NEWSFX"); do | + | Again, only for current and distupgrade: |
- | mergeit "$new" | + | slackpkg clean-system |
- | done | + | |
- | </code> | + | |
- | See also [[diffupgrade]] | + | Remove unnecessary installed packages (kde... kompare kopete...) using ''removepkg''. If necessary remove old unused kernel packages as well. |
- | <note important>Note that your ''php.ini'' needs manual treatment. If your php.ini is based on php.ini-production, you have to check if your model php.ini-production was modified by the update and merge the differences into your php.ini. This is becaus currently (Slack 13.37) no .new files are created for PHP.</note> | + | merge *.new files with sbMergeEtcConfig. See below. |
- | ===== Attic == | + | If the kernel was updated: |
- | ==== Upgrade your system to another Slackware version == | + | - An [[slack_initrd|initrd]] must be created if the generic kernel is used |
+ | - (e)Lilo must be reinstalled | ||
+ | - If the new kernel boots, the packages conaining the old kernel and its modules can be removed. | ||
- | <note warning>Obsolete. Keep with Slack current!</note> | + | Do some cleanup: |
+ | - ''/var/www/htdocs/index.html'' may be created by the update if it did not exist before. This may conflict with your custom start page, eg ''index.php'' | ||
+ | - CHANGES_AND_HINTS.TXT for Slack 14.2 recommends to chmod -x rc.alsa | ||
+ | - VGA settings for lilo changed for Slack 14.2. Hence it is probably better to create a new lilo.conf with ''liloconfig'' | ||
+ | - As of 14.2 set mplayer to use [[sound#select_output_driver|pulse]] as output device | ||
+ | - As of Slack 14.2 the symlink ''/etc/rc.modules'' seems not to be used any more. It still points to old rc.modules-<oldkernel>. => Rename it! | ||
+ | - Start php in the console ''php -v'' and make sure no libs are missing. (On a headless server without X11 it may be necesssary to install libXpm) | ||
- | === Requirements == | + | Consider creating bootstick of //old// kernel or, on in case of a vserver log into VCP, start VNC console and reboot from there, to see boot messages |
- | == Partitions == | + | |
- | Have at least 2 partitions: A ''/''-partition where the linux distribution is installed and a ''/home'' where all distribution independend things are located. During upgrade, ''/'' will be completely overwritten by the new distribution, while ''/home'' remains untouched. | + | ===== Slackpkg usage for a multilib system == |
- | FIXME **Not tested yet**: If your current system isn't split like this, you can copy the content of the disk to an image file on a separate drive (eg. USB-drive), then re-partion the drive and restore the content afterward. Use commands like: | + | 1st manually [[slack_multilib#download|sync]] your local mulilib mirror, then |
- | dd if=/dev/hda1 of=harddisk-image # Make the image | + | |
- | dd if=harddisk-image of=/dev/hda1 # Restore the disk content | + | |
- | See http://ldp.bootet.net/LDP/sag/html/sag.html#DISK-NO-FS . Maybe also the cat command is an option. See [[slackmirror>slackware-11.0/rootdisks/README.TXT]] | + | |
- | == Symlinks == | + | <code bash> |
+ | slackpkg check-updates # to see if updates are necessary at all | ||
+ | slackpkg update # to update the package list | ||
+ | slackpkg upgrade slackpkg | ||
- | We assume that /home has its own partition which will be conserved during upgrade. Everything which has to be saved and is locatet in the / partition has to be moved and symlinked to the /home partition: | + | cd <local_mulitlib_mirror> |
+ | upgradepkg --reinstall --install-new *.t?z | ||
+ | upgradepkg --install-new slackware64-compat32/*-compat32/*.t?z | ||
- | <code bash> | + | slackpkg install-new # only for Slack current or upgrade to next Slackware version! |
- | mkdir /home/redirects | + | slackpkg upgrade-all # to finally install the new versions of existing packages |
+ | slackpkg clean-system # only for current and distupgrade (?) | ||
+ | </code> | ||
- | cp -a /usr/local /usr/local.org | + | Continue with lilo etc. See above! |
- | mv /usr/local /home/redirects/usr.local | + | |
- | ln -s /home/redirects/usr.local /usr/local | + | |
- | cp -a /opt /opt.org | + | ===== Howto fix Config Files in /etc == |
- | mv /opt /home/redirects | + | |
- | ln -s /home/redirects/opt /opt | + | |
- | cp -a /var/www /var/www.org | + | After slackpkg has installed the new packages you will be asked how to treat the new config files. Select the first option, i.e. old config files are preserved and new config files get the extension ''.new''. |
- | mv /var/www /home/redirects/var.www | + | |
- | ln -s /home/redirects/var.www /var/www | + | Search in /var/log/scripts with ''/var/log/scripts$ grep -h 'config [^e].*\.new' * | sort'' has shown, that in /usr and /var .new files are created as well. ''sbMergeEtcConfig'' is updated accordingly. |
+ | |||
+ | For everey new config file, it is most convenient to do an automated ''mv'' or ''merge'' with the script ''sbMergeEtcConfig'' FIXME | ||
+ | |||
+ | ===== Attic == | ||
+ | ==== Partitions == | ||
+ | |||
+ | FIXME Move this to slack_install | ||
+ | |||
+ | Have at least 2 partitions: A ''/''-partition where the linux distribution is installed and a ''/home'' where all distribution independend things are located. During upgrade, ''/'' will be completely overwritten by the new distribution, while ''/home'' remains untouched. | ||
+ | |||
+ | FIXME **Not tested yet**: If your current system isn't split like this, you can copy the content of the disk to an image file on a separate drive (eg. USB-drive), then re-partion the drive and restore the content afterward. Use commands like: | ||
+ | dd if=/dev/hda1 of=harddisk-image # Make the image | ||
+ | dd if=harddisk-image of=/dev/hda1 # Restore the disk content | ||
+ | See http://ldp.bootet.net/LDP/sag/html/sag.html#DISK-NO-FS . Maybe also the cat command is an option. See [[slackmirror>slackware-11.0/rootdisks/README.TXT]] | ||
- | # as of Slack 12.2 you might update the symlinks for the apache document root as well: | ||
- | cp /srv/httpd /srv/httpd.org | ||
- | cp /srv/www /srv/www.org | ||
- | ln -s /home/redirects/var.www /srv/httpd | ||
- | ln -s /home/redirects/var.www /srv/www | ||
- | </code> | ||
- | Thest if your moved data and applications are still available and working after that step! | ||