25afa
![]() |
|
|
|
|
|||||||
| Howtos & FAQs (Moderated) Would you like to share some of your solutions for certain problems? Tips or tricks? Post here. All new topics are automatically moderated. |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
||||
|
||||
|
There are many ways to upgrade FreeBSD along with installed packages to the newest version(s), most of them include compilation (buildworld/portmaster), this HOWTO will provide simple and fast way to upgrade FreeBSD system without needless compilation.
Upgrade if the base system is relatively easy, its about to type 4 commands, read and UNDERSTAND on screen comunicates, if it goes to packages, we will use the fact, that all packages are build to newest version along with newest *-RELEASE version. 0. CONFIGURATION BACKUP (rather not needed, but ...) root # tar -czf /root/ETC.tar.gz /etc /usr/local/etc 1. BASE SYSTEM UPGRADE (I assume that 8.1-RELEASE is the current latest version) root # freebsd-update upgrade -r 8.1-RELEASE root # freebsd-update install root # shutdown -r now root # freebsd-update install While doing the base system procedure we will be asked for installed 'datasets' and about modifications in config files, we only need to read and UNDERSTAND the on screen comunicats. 2. PACKAGES UPGRADE root # pkg_info -qoa | sort > /root/packagelist root # pkg_delete -a -f root # rm -r -f /boot/modules /usr/local /var/db/pkg root # while read PKG; do pkg_add -r $( basename ${PKG} ); done < /root/packagelist At this point all old packages have been removed, and latest pacakges have been installed on their place, it works automatically, unless port nam has changed, like with VirtualBox, when its port name changed from emulators/virtualbox into emulators/virtualbox-ose, so the only 'risk' here, is that some packages will not be added automatically. 2.1. SEARCHING FOR MISSED PACKAGES root # pkg_info -qoa | sort > /root/packagelist.NEW root # diff -u /root/packagelist* This way is probably the fastest and easiest to find missed packages. 3. CLEANUP root # rm -r -f /root/packagelist* root # rm -r -f /root/ETC.tar.gz If we had made some bigger changes in the configuration, we may keep the old configuration (/root/ETC.tar.gz).
__________________
Religions, worst damnation of mankind. "FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM http://vermaden.blogspot.com Last edited by vermaden; December 3rd, 2010 at 07:26. |
| The Following 13 Users Say Thank You to vermaden For This Useful Post: | ||
Caliante (October 3rd, 2010), garrych (March 4th, 2011), graudeejs (September 13th, 2010), hansivers (September 26th, 2010), hbokh (November 7th, 2010), mfaridi (September 14th, 2010), nemo (September 14th, 2010), psycho (September 13th, 2010), renice (September 13th, 2010), Sora_ (September 20th, 2010), toomanysecrets (September 21st, 2010), vertexSymphony (September 15th, 2010), YZMSQ (September 7th, 2011) | ||
|
#2
|
|||
|
|||
|
great how-to, like usual...
__________________
Hiroshima '45 - Tschernobyl '86 - Windows '95 - Psycho '10 |
|
#3
|
||||
|
||||
|
fix: s/probable/probably/ at the end of post
Nice howto Last edited by graudeejs; September 13th, 2010 at 22:14. |
| The Following User Says Thank You to graudeejs For This Useful Post: | ||
vermaden (September 13th, 2010) | ||
|
#4
|
|||
|
|||
|
FBSD 7.3 is not supported?
Code:
# freebsd-update upgrade -r 8.1-RELEASE Looking up update.FreeBSD.org mirrors... 4 mirrors found. Fetching public key from update4.FreeBSD.org... failed. Fetching public key from update5.FreeBSD.org... failed. Fetching public key from update2.FreeBSD.org... failed. Fetching public key from update3.FreeBSD.org... failed. No mirrors remaining, giving up. |
|
#5
|
||||
|
||||
|
Even 7.2-RELEASE have info about upgrade using freebsd-update, so its definitely supported, the question is why You could not found any mirrors, any network issues?
http://freebsd.org/releases/7.2R/announce.html
__________________
Religions, worst damnation of mankind. "FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM http://vermaden.blogspot.com |
|
#6
|
|||
|
|||
|
Quote:
I can easily browse http://update5.freebsd.org/ and http://update4.freebsd.org/. But not http://update.freebsd.org/. |
|
#7
|
|||
|
|||
|
Quote:
|
|
#8
|
|||
|
|||
|
Nice tut! It working for me..
|
|
#9
|
|||
|
|||
|
Maybe this is the problem?
Code:
# freebsd-update upgrade -v debug -r 8.1-RELEASE Looking up update.FreeBSD.org mirrors... 4 mirrors found. Fetching public key from update4.FreeBSD.org... fetch: http://update4.FreeBSD.org/7.3-STABLE/amd64/pub.ssl: Not Found failed. Fetching public key from update5.FreeBSD.org... fetch: http://update5.FreeBSD.org/7.3-STABLE/amd64/pub.ssl: Not Found failed. Fetching public key from update2.FreeBSD.org... fetch: http://update2.FreeBSD.org/7.3-STABLE/amd64/pub.ssl: Not Found failed. Fetching public key from update3.FreeBSD.org... fetch: http://update3.FreeBSD.org/7.3-STABLE/amd64/pub.ssl: Not Found failed. No mirrors remaining, giving up.
|
|
#10
|
||||
|
||||
|
@surgeon
Stable is development, there are no binary updates for it.
__________________
What was the goal of the Linux community--to replace Windows? One can imagine higher aspirations., Bill Joy |
|
#11
|
||||
|
||||
|
Quote:
You may of course stay 'STABLE' and update packages only, as step 2. and later will work as advertised (if I recall correctly packages for *-STABLE are rebuild wvery week).
__________________
Religions, worst damnation of mankind. "FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM http://vermaden.blogspot.com |
|
#12
|
|||
|
|||
|
Quote:
Many thanks again for your very informative post. If my understanding of your script is correct, the removal of /usr/local directory (3rd line) will destroy all modifications to packages config files in /usr/local/etc. So, the admin will have to retype again all these modifications AFTER installation of newest packages. Would have been more efficient just to keep /usr/local/etc directory untouched, to provide the newest packages with the personalized version of config files? |
|
#13
|
||||
|
||||
|
... but the 0. step BACKUPS the /usr/local/etc directory.
__________________
Religions, worst damnation of mankind. "FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM http://vermaden.blogspot.com |
|
#14
|
|||
|
|||
|
Yes, I have noticed. My question was more about what to do after installation of newer packages. If I follow your script step by step, the older config files are not lost (because of the initial backup) but they are no longer installed in the /usr/local/etc directory.
So I understand that the admin have two possible courses of action: a) untar the older config files in /usr/local/etc (but it will replace the newer config files, a risky operation) b) manually merge older and newer config files (with diff or something like that?) That why I asked previously whether it would have been more simple to just keep /usr/local/etc untouched (to avoid the manual merging). Many thanks again for your feedback. It is much appreciated! |
|
#15
|
||||
|
||||
|
Quote:
As for NOT deleting /usr/local/etc, something like that my be usefull: Code:
# cd /usr/local
# ls | grep -v etc | while read I; do rm -r -f "${I}"; done
__________________
Religions, worst damnation of mankind. "FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM http://vermaden.blogspot.com |
|
#16
|
||||
|
||||
|
Be very careful! WHY do a "rm -rf" on the complete /usr/local but backup ONLY etc in that directory?
A lot of users have a whole lot of stuff in /usr/local (web-root / installers / certificates / etc.). |
|
#17
|
||||
|
||||
|
@hbokh
HOWTO creator assumes that You KNOW what You are doing ...
__________________
Religions, worst damnation of mankind. "FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM http://vermaden.blogspot.com |
|
#18
|
|||
|
|||
|
I get a "variable not defined" error at this step:
Code:
root # while read PKG; do pkg_add -r $( basename ${PKG} ); done < /root/packagelist
|
|
#19
|
||||
|
||||
|
@freeck
You need to use POSIX sh(1) compatible for these commands.
__________________
Religions, worst damnation of mankind. "FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM http://vermaden.blogspot.com |
|
#20
|
|||
|
|||
|
oppps.
I'm getting "Illegal variable name" when tryiing step 4 Code:
#while read PKG ; do pkg_add -r $( basename ${PKG} ) ; done < /root/packagelist
Illegal variable name.
but the same Illegal variable name is shown. can someone please help me? my server is down now. |
|
#21
|
||||
|
||||
|
Both csh/tcsh are C-shells, use sh/zsh/fish/ksh/bash which are Bourne Shells.
__________________
Religions, worst damnation of mankind. "FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM http://vermaden.blogspot.com |
|
#22
|
|||
|
|||
|
Thanks so much for the reply. I was able to change to sh and run the command.
problem now is that I'm getting Code:
unable to fetch 'ftp://ftp.package' protocol error my google turn that I need to add the http:// to the url but not sure how to apply to the command Code:
while read PKG ; do pkg_add -r $( basename ${PKG} ) ; done < /root/packagelist
thanks again. Last edited by wblock@; July 28th, 2012 at 21:54. Reason: add [code] tags |
|
#23
|
|||
|
|||
|
Forget the upgrade. I was stupid enough to delete my www dir which was inside /usr/local. Damn me so stupid.
Please add to your initial post a warning so other stupid user like myself, who don't fall in the 'know what they doing' won't *beep**beep**beep**beep* up their sites so easily. Feels like jumping from the roof now. Last edited by wblock@; July 29th, 2012 at 04:38. Reason: Capitalization/spelling. |
|
#24
|
||||
|
||||
|
Look at it this way:
A) It shows how valuable backups are. B) When you recreate it, it will be better than before because of your experience. |
![]() |
| Tags |
| binary, packages, portmaster, update, upgrade |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| HOWTO: WINE on amd64 (faster/binary way) | vermaden | Howtos & FAQs (Moderated) | 25 | January 25th, 2013 11:09 |
| [Solved] Binary upgrade (freebsd-update) Base + Jails 8.0 -> 8.1 | Predy | Installing & Upgrading | 4 | October 13th, 2010 15:21 |
| [Solved] Lots of binary packages missing | Navigium | Installation and Maintenance of FreeBSD Ports or Packages | 7 | September 16th, 2010 02:50 |
| What's better for upgrade base system ? + Question about CFLAGS | elvis4526 | Installing & Upgrading | 7 | August 4th, 2010 04:33 |
| Upgrade a binary package | rainman82 | Installation and Maintenance of FreeBSD Ports or Packages | 1 | September 9th, 2009 15:59 |