Upgrade FreeBSD

Selama menggunakan GNU/Linux Debian, sistem APT di Debian memang memanjakan seorang administrator untuk masalah install menginstall paket, update dan bahkan upgrade sistem ke rilis terbaru.

Dengan sebuah jurus sakti APT,

#aptitude safe-upgrade

atau

#aptitude full-upgrade

Jadilah sistem Debian mengupgrade secara otomatis.. dan kita mendapatkan sistem yang up to date.

Tapi bukan itu yang hendak ditulis di sini, tapi bagaimana FreeBSD menyediakan tool yang “hampir sama” dengan APT-nya debian untuk mengupdate dan mengupgrade binary package, bahkan mampu mengupgrade ke release di atasnya, suatu hal yang menyenangkan menurut saya 🙂

FreeBSD, kalau saya tidak keliru, menyediakan tool freebsd-update mulai Release 6.2. Tool ini memungkinkan mengupdate dan mengupgrade binary dari freebsd.
Ini keterangannya :

The freebsd-update tool is used to fetch, install, and rollback binary updates to the FreeBSD base system. Note that updates are only available if they are being built for the FreeBSD release and architecture being used; in particular, the FreeBSD Security Team only builds updates for releases shipped in binary form by the FreeBSD Release Engineering Team, e.g., FreeBSD 7.3-RELEASE and FreeBSD 8.0-RELEASE, but not FreeBSD 6.3-STABLE or FreeBSD 9.0-CURRENT

Sebelum kita upgrade, ini release FreeBSD yang saya gunakan

# uname -r 
8.2-RELEASE-p3

Dan menurut referensi, release terbaru FreeBSD adalah 9.0-RELEASE, yang akan kita jadikan tujuan upgrade.
Catatan Penting :
Mengupgrade sistem selalu punya resiko, bisa sukses dan bisa gagal. Untuk mengantisipasinya, saran saya :

  • Selalu punya backup data-data maupun konfigurasi penting dari sistem.. ini penting !!! 🙂
  • Kemudian baca juga Release Note, Issue, errata, dan petunjuk upgrade dari release yang akan kita gunakan.
  • Selalu siap bergoogling ria kalau ada masalah, tidak cepat menyerah 🙂
  • Mari kita mulai mengupgrade sistem :
    Dengan freebsd-update, baca manualnya agar lebih jelas, untuk mengupgrade gunakan opsi -r RELEASE dan perintah upgrade

    [root@fribeesde /usr/home/najwa]# freebsd-update -r 9.0-RELEASE upgrade
    Looking up update.FreeBSD.org mirrors... 4 mirrors found.
    Fetching metadata signature for 8.2-RELEASE from update5.FreeBSD.org... done.
    Fetching metadata index... done.
    Fetching 2 metadata patches.. done.
    Applying metadata patches... done.
    Inspecting system... done.
    
    The following components of FreeBSD seem to be installed:
    kernel/generic src/share world/base world/dict world/doc world/manpages
    
    The following components of FreeBSD do not seem to be installed:
    src/base src/bin src/cddl src/contrib src/crypto src/etc src/games
    src/gnu src/include src/krb5 src/lib src/libexec src/release src/rescue
    src/sbin src/secure src/sys src/tools src/ubin src/usbin world/catpages
    world/games world/info world/proflibs
    
    Does this look reasonable (y/n)? 
    

    Tekan y untuk melanjutkan proses upgrade

    Fetching metadata signature for 9.0-RELEASE from update5.FreeBSD.org... done.
    Fetching metadata index... done.
    Fetching 1 metadata patches. done.
    Applying metadata patches... done.
    Fetching 1 metadata files... done.
    
    The update metadata is correctly signed, but
    failed an integrity check.
    Cowardly refusing to proceed any further.
    

    Saya rasa itu adalah masalah dengan proses upgrade. Sesuai saran di atas, jangan lupa baca catatan, issue yang datang dengan release tersebut, akhirnya ketemu masalah tersebut dan solusinya.
    Dari errata dan issue release 9.0-RELEASE ini, kita ketahui, masalah tersebut sudah disebutkan dan diberikan solusinya

    Problem Description
    freebsd-update in affected releases is unable to perform an automated upgrade
    to FreeBSD 9.0 due to unsupported characters in FreeBSD 9.0 filenames. When
    this bug is triggered, updates fail with the following error message:

    The update metadata is correctly signed, but
    failed an integrity check.
    Cowardly refusing to proceed any further

    dan solusinya sudah disebutkan
    – dengan source patch
    – dengan binary update

    Systems running 7.3-RELEASE, 7.4-RELEASE, 8.1-RELEASE, or 8.2-RELEASE on the
    i386 or amd64 platforms can be updated via the freebsd-update(8) utility:
    # freebsd-update fetch
    # freebsd-update install

    Saya memilih yang binary update, maka sesuai dengan yang disarankan, jalankan perintah tersebut

    # freebsd-update fetch
    Looking up update.FreeBSD.org mirrors... 4 mirrors found.
    Fetching metadata signature for 8.2-RELEASE from update5.FreeBSD.org... done.
    Fetching metadata index... done.
    Fetching 1 metadata patches. done.
    Applying metadata patches... done.
    Inspecting system... done.
    Preparing to download files... done.
    Fetching 325 patches.....10....20....30....40....50....60....70....80....90....100....110....120....130....140....150....160....170....180....190....200....210....220....230....240....250....260....270....280....290....300....310....320.. done.
    Applying patches... done.
    Fetching 1 files... done.
    
    The following files will be added as part of updating to 8.2-RELEASE-p6:
    /usr/src/lib/libc/gen/libc_dlopen.c
    
    The following files will be updated as part of updating to 8.2-RELEASE-p6:
    /bin/chflags
    /bin/csh
    /bin/pax
    /bin/sh
    ......
    /sbin/halt
    /sbin/init
    /sbin/ipf
    /sbin/ipfstat
    /sbin/ipftest
    /usr/sbin/zdump
    /usr/sbin/zic
    

    kemudian lanjutkan dengan

    # freebsd-update install
    Installing updates...install: ///usr/src/lib/libc/gen/libc_dlopen.c: No such file or directory
     done.
    

    Muncul masalah lagi, dan dengan hasil googling, ketemu masalahnya.
    Dari beberapa hasil googling, saya menemukan link ini yang cukup membantu.

    Unfortunately, I couldn’t find anything. So I investigated the problem, and I found that it was caused by the missing source. In a nut shell, if you did not install the FreeBSD with the source (i.e., /usr/src is empty), this problem will show up.

    To fix this problem, simply create a dummy directory:
    sudo mkdir -p /usr/src/lib/libc/gen

    Kemudian jalankan proses upgradenya yang sempat terhenti tadi

    # freebsd-update -r 9.0-RELEASE upgrade
    Looking up update.FreeBSD.org mirrors... 4 mirrors found.
    Fetching metadata signature for 8.2-RELEASE from update4.FreeBSD.org... done.
    Fetching metadata index... done.
    Inspecting system... done.
    
    The following components of FreeBSD seem to be installed:
    kernel/generic src/share world/base world/dict world/doc world/manpages
    
    The following components of FreeBSD do not seem to be installed:
    src/base src/bin src/cddl src/contrib src/crypto src/etc src/games
    src/gnu src/include src/krb5 src/lib src/libexec src/release src/rescue
    src/sbin src/secure src/sys src/tools src/ubin src/usbin world/catpages
    world/games world/info world/proflibs
    
    Does this look reasonable (y/n)? y
    
    Fetching metadata signature for 9.0-RELEASE from update4.FreeBSD.org... done.
    Fetching metadata index... done.
    Inspecting system... done.
    Fetching files from 8.2-RELEASE for merging... done.
    Preparing to download files... done.
    Fetching 8580 patches.....10....20....30....40....50....60....70 .........8560....8570....8580 done.
    Applying patches... done.
    Fetching 1915 files... 
    ......
    
    sampai selesai, dan kemudian install update
    
    # freebsd-update install
    Installing updates...
    Completing this upgrade requires removing old shared object files.
    Please rebuild all installed 3rd party software (e.g., programs
    installed from the ports tree) and then run "/usr/sbin/freebsd-update install" again to finish installing updates.
    
    

    Sesuai yang disarankan, jalankan reboot

    #reboot
    

    dan setelah reboot, jalankan kembali

    #freebsd-update install
    

    Itu proses upgrade menggunakan tool freebsd-update. selanjutnya jika kita perlu mengupgrade software dari ports, lakukan proses upgrade lewat ports tree seperti biasa, karena belum tentu software yang lama berjalan dengan baik setelah upgrade ini.

    Kalau setelah update,

    $ uname -a 
    FreeBSD fribeesde 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:15:25 UTC 2012     root@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
    
    Advertisements

    Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out / Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out / Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out / Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out / Change )

    Connecting to %s

    %d bloggers like this: