--- wikisrc/pkgsrc/how_to_upgrade_packages.mdwn 2013/02/16 12:17:44 1.2 +++ wikisrc/pkgsrc/how_to_upgrade_packages.mdwn 2019/05/10 07:34:12 1.3 @@ -12,7 +12,7 @@ pkg_add's -u option is used to update a By using the -uu (option used twice), it will attempt to update prerequisite packages also. -See the manual page, [pkg_add(1)](http://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1+NetBSD-current), for details. +See the manual page, [pkg_add(1)](http://netbsd.gw.com/cgi-bin/man-cgi?pkg_add+1+NetBSD-current), for details. ## pkg_chk -b @@ -29,7 +29,7 @@ Or to automatically add any missing pack If both -b and -P are given, no pkgsrc tree is used. If packages are on the local machine, they are scanned directly, otherwise the pkg_summary database is fetched. (Using pkg_summary for local packages is on the TODO list.) -(pkg_chk is also covered below.) +(pkg_chk is also covered below.) # Methods that build packages from source @@ -44,7 +44,7 @@ It is possible, and in the case of updat To use binary packages if available with "make update", use "UPDATE_TARGET=bin-install". If package tarball is not available in ${PACKAGES} locally or at URLs (defined with BINPKG_SITES), it will build a package from source. -To enable manual rollback one can keep binary packages. One method is to always use 'make package', and to have "DEPENDS_TARGET=package" in /etc/mk.conf. Another is to use pkg_tarup to save packages before starting. +To enable manual rollback one can keep binary packages. One method is to always use 'make package', and to have "DEPENDS_TARGET=package" in /etc/mk.conf. Another is to use pkg_tarup to save packages before starting. ## make replace @@ -61,7 +61,7 @@ If you are an expert (and don't plan to USE_ABI_DEPENDS?=no -This is for ignoring the ABI dependency recommendations and just use the required DEPENDS. +This is for ignoring the ABI dependency recommendations and just use the required DEPENDS. ### Problems with make replace @@ -72,7 +72,7 @@ Besides ABI changes (for which pkg_rolli * pkg_delete -r foo, and make package on everything you still want. Or do make update. Note that this could delete a lot. * Automating the first option would be a useful contribution to pkgsrc. -In addition, any problem that can occur with building a package can occur with make replace. Usually, the solution is not make replace specific +In addition, any problem that can occur with building a package can occur with make replace. Usually, the solution is not make replace specific ## pkg_chk @@ -87,7 +87,7 @@ Update packages from sources: You can set UPDATE_TARGET=package in /etc/mk.conf and specify the -b flag, so that the results of compilation work are saved for later use, and binary packages are used if they are not outdated or dependent on outdated packages. -The main problem with pkg_chk, is that it deinstalls all to-be-upgraded candidates before reinstalling then. However a failure is not fatal, because the current state of packages is saved in a pkg_chk* file at the root of the pkgsrc directory. +The main problem with pkg_chk, is that it deinstalls all to-be-upgraded candidates before reinstalling then. However a failure is not fatal, because the current state of packages is saved in a pkg_chk* file at the root of the pkgsrc directory. ## pkg_rolling-replace @@ -116,30 +116,6 @@ Update everything except the packages ab Even if a lot of packages need to be updated, make replace usually works very well if the interval from the last 'pkg_rolling-replace -u' run is not that long (a month or so). With a longer interval, like a year or two, the odds of package renaming/splitting are higher. Still, for those who can resolve the issues, this is a fairly low-pain and reliable way to update. -## pkgmanager - -Pkgmanager use user defined list of wanted packages for upgrading and installing packages. - - %pkgmanager show-wants - [pkgmanager] Wanted packages: - [pkgmanager] (audio/cdparanoia . 1.0) - [pkgmanager] (audio/gtkpod . 1.0) - [pkgmanager] (audio/lame . 1.0) - [pkgmanager] (audio/xmms . 1.0) - [pkgmanager] (chat/gaim . 1.0) - [pkgmanager] (chat/gaim-encryption . 1.0) - [pkgmanager] (chat/gaim-otr . 1.0) - [...] - [pkgmanager] (wm/enlightenment . 1.0) - [pkgmanager] (www/firefox . 1.0) - [pkgmanager] (www/lighttpd . 1.0) - [pkgmanager] (www/links . 1.0) - [pkgmanager] (x11/eterm . 1.0) - [pkgmanager] (x11/gdm . 1.0) - -User can upgrade his packages with "pkgmanager sync". This command removes packages installed on system which are not listed on want list. Then upgrade all wanted packages and dependencies to new version. - - ## Delete everything If you don't have a production environment or don't care if your packages will be missing for a while, you can just delete everything and reinstall. @@ -148,7 +124,7 @@ This method is the easiest: # pkg_delete -Rr '*-*' --or- +-or- # pkg_delete -ff '*-*' @@ -170,7 +146,7 @@ Then edit your "pkgs_i_want_to_have" (cr # cat pkgs_i_want_to_have | (while read pp ; do cd /usr/pkgsrc/$pp ; make && make install ; done) -An alternative way to choose the packages you want installed is to create your own custom meta-package. A meta-package doesn't install any files itself, but just depends on other packages (usually within a similar topic or need). Have a look at pkgsrc/meta-pkgs category for various examples. If your new meta-package is generic enough and useful for others, please be sure to share it. +An alternative way to choose the packages you want installed is to create your own custom meta-package. A meta-package doesn't install any files itself, but just depends on other packages (usually within a similar topic or need). Have a look at pkgsrc/meta-pkgs category for various examples. If your new meta-package is generic enough and useful for others, please be sure to share it. ## chroot environment @@ -183,7 +159,7 @@ Then build and remove packages as you wi Then use other technique from this list to install from these packages (built in chroot). -Or instead of using this manual method, use pkg_comp's chroot. +Or instead of using this manual method, use pkg_comp's chroot. ## pkg_comp's chroot @@ -198,7 +174,7 @@ After you've built new new packages, you If you use PKGBASE instead of PKGNAME, you get the basename of the file. -See [this BSDFreak Article](http://bsdfreak.org/modules/news/article.php?storyid=1) for a nice tutorial on how to set up and use pkg_comp. +See [this BSDFreak Article](http://bsdfreak.org/modules/news/article.php?storyid=1) for a nice tutorial on how to set up and use pkg_comp. ## bulk build framework @@ -231,25 +207,3 @@ You can choose the PKG_DBDIR via shell e And set the LOCALBASE and your PKG_DBDIR in your mk.conf file. You could also simply just have a symlink from /usr/pkg to your new LOCALBASE (and /var/db/pkg to your new PKG_DBDIR) and change this when ever you are ready. - -## pkgviews - -## How to set a specific application version - -PostgreSQL, MySQL and Apache has multiple versions : each of them has a buildlink3.mk in /usr/pkgsrc/mk, to set the version you want add to /etc/mk.conf. - - # postgresql version : - # see /usr/pkgsrc/mk/pgsql.buildlink3.mk - # versions : 84 83 82 - PGSQL_VERSION_DEFAULT= 83 - - # apache version : - # see /usr/pkgsrc/mk/apache.mk - # versions : apache13 apache2 apache22 - PKG_APACHE_DEFAULT= apache22 - - # mysql version : - # see /usr/pkgsrc/mk/mysql.buildlink3.mk - # versions : 50 41 - MYSQL_VERSION_DEFAULT= 50 -