# How can I update all of my software ?



## chuugar (Jul 13, 2011)

Hi guys !

So... It is my first message on this forum. 
Well, I'm a new FreeBSD user (I have got a dual boot with Linux), so I am sorry if my question seems to be... stupid.
How can I update all of my software/dependency ? Because, when I tried to install whatever I need to update 2 or 3 dependency... 

I wish I can already say thank you. 
(I am French)


----------



## SirDice (Jul 13, 2011)

Try reading the handbook: Chapter 24 Updating and Upgrading FreeBSD

In case English isn't your first language, the handbook is available in other languages too.


----------



## DutchDaemon (Jul 13, 2011)

Given the subforum this was posted in, I'm assuming this is about ports/packages? 

chuugar, you are aware of the strict separation between the base system (FreeBSD kernel and FreeBSD userland) and add-on software (third-party applications, i.e. ports and packages), which are *not* updated together?

BSD vs Linux

The aforementioned Chapter 24 covers both, but make sure you understand the difference.


----------



## chuugar (Jul 13, 2011)

No, I am not. 
I think that what I have to update is not the kernel, but the applications...
I am going to read the handbook.


----------



## wblock@ (Jul 13, 2011)

Upgrading FreeBSD Ports


----------



## chuugar (Jul 13, 2011)

I did that:

```
portsnap update
```

And FreeBSD returns me: 

```
Ports tree is already up to date
```

What I have to do more ??


----------



## SirDice (Jul 13, 2011)

chuugar said:
			
		

> What I have to do more ??



Read /usr/ports/UPDATING and see which of the ports are out of date.

`# pkg_version -vI`


----------



## chuugar (Jul 13, 2011)

A lot of my ports are out of date.
Must I update all of them manually ?


----------



## wblock@ (Jul 13, 2011)

chuugar said:
			
		

> A lot of my ports are out of date.
> Must I update all of them manually ?



That's a link in post #5.


----------



## SirDice (Jul 13, 2011)

chuugar said:
			
		

> A lot of my ports are out of date.


Which is why you really shouldn't install any of the packages on the CD/DVDs. By the time you get to install the system they'll all be out of date.


----------



## fender0107401 (Jul 17, 2011)

*Read the FreeBSD Handbook.*

Read this.

More specifically, read this for your current question.

More and more specifically, read this.


----------



## vb (Jul 17, 2011)

chuugar said:
			
		

> I did that:
> 
> ```
> portsnap update
> ...



`portsnap fetch update`
`portupgrade -u -a`


----------



## SirDice (Jul 18, 2011)

vb said:
			
		

> `portupgrade -u -a`


Don't! Read the link in post #5.


----------



## vermaden (Jul 18, 2011)

> How can I update all of my software?



(dependencies)

```
# pkg_add -r portmaster
# pkg_add -r portaudit
```

I use two aliases for packages/ports updates:


```
alias [color="Blue"][B]ports-check[/B][/color]="[color="Blue"]portsnap[/color] fetch update; [color="blue"]portmaster[/color] -L --index-only | [color="blue"]grep[/color] -i ' new '; [color="blue"]portaudit[/color] -Fda; [color="Blue"]pkg_updating[/color] -d $( [color="blue"]ls[/color] -ltr -D '%Y%m%d' /var/db/pkg | [color="blue"]awk[/color] 'END{print $6}' )"
alias [color="blue"][B]ports-update[/B][/color]="[color="blue"]portmaster[/color] -y --no-confirm -a --packages-if-newer -m 'BATCH=yes' -d; [color="blue"]portmaster[/color] --check-depends"
```

example output(s):

```
# [color="Blue"][B]ports-check        [/B][/color]                        
Looking up portsnap.FreeBSD.org mirrors... 5 mirrors found.
Fetching snapshot tag from portsnap5.freebsd.org... done.
Fetching snapshot metadata... done.
Updating from Mon Jul 18 11:28:48 CEST 2011 to Mon Jul 18 12:16:56 CEST 2011.
Fetching 3 metadata patches.. done.
Applying metadata patches... done.
Fetching 0 metadata files... done.
Fetching 1 patches. done.
Applying patches... done.
Fetching 0 new ports or files... done.
Removing old files and directories... done.
Extracting new files:
/usr/ports/sysutils/bsdadminscripts/
Building new INDEX files... done.
        ===>>> New version available: bsdadminscripts-6.1.1_1
        ===>>> 1 has a new version available
auditfile.tbz                                 100% of   68 kB   59 kBps
New database installed.
Database created: Mon Jul 18 12:35:00 CEST 2011
0 problem(s) in your installed packages found.
```



```
# [color="Blue"][B]ports-update [/B][/color]
===>>> Starting check of installed ports for available updates
===>>> Launching child to update bsdadminscripts-6.1.1 to bsdadminscripts-6.1.1_1

===>>> Port directory: /usr/ports/sysutils/bsdadminscripts

===>>> Gathering dependency list for sysutils/bsdadminscripts from ports
===>>> No dependencies for sysutils/bsdadminscripts
===>>> Returning to update check of installed ports

        ===>>> The sysutils/libgksuui port moved to sysutils/libgksu
        ===>>> Reason: Removed: It is a part of sysutils/libgksu now

===>>> Launching child to reinstall libgksuui-1.0.7_6

        ===>>> The sysutils/libgksuui port moved to sysutils/libgksu
        ===>>> Reason: Removed: It is a part of sysutils/libgksu now

===>>> Port directory: /usr/ports/sysutils/libgksu

===>>> Gathering dependency list for sysutils/libgksu from ports
===>>> Dependency check complete for sysutils/libgksu
===>>> Returning to update check of installed ports
===>>> Starting build and/or install for for ports that need updating <<<===

===>>> Launching child to install sysutils/bsdadminscripts

===>>> Port directory: /usr/ports/sysutils/bsdadminscripts

===>>> Checking package repository for latest available version

===>>> The newest available package (bsdadminscripts-6.1.1)
       is not newer than the installed version (bsdadminscripts-6.1.1)

===>>> There is no valid package to install, building port instead

===>>> Starting check for build dependencies
===>>> Gathering dependency list for sysutils/bsdadminscripts from ports
===>>> No dependencies for sysutils/bsdadminscripts
===>  Cleaning for bsdadminscripts-6.1.1_1

===>  License check disabled, port has not defined LICENSE
=> bsdadminscripts-6.1.1.tar.gz doesn't seem to exist in /usr/ports/distfiles//.
=> Attempting to fetch http://heanet.dl.sourceforge.net/project/bsdadminscripts/bsdadminscripts/bsdadminscripts-6.1.1.tar.gz
bsdadminscripts-6.1.1.tar.gz                  100% of   72 kB  220 kBps
===>  Extracting for bsdadminscripts-6.1.1_1
=> SHA256 Checksum OK for bsdadminscripts-6.1.1.tar.gz.
===>  Patching for bsdadminscripts-6.1.1_1
===>  Applying FreeBSD patches for bsdadminscripts-6.1.1_1
===>  Configuring for bsdadminscripts-6.1.1_1

===>>> Creating a backup package for old version bsdadminscripts-6.1.1

===>>> Starting check for runtime dependencies
===>>> Gathering dependency list for sysutils/bsdadminscripts from ports
===>>> No dependencies for sysutils/bsdadminscripts
===>  Installing for bsdadminscripts-6.1.1_1
===>   Generating temporary packing list
===>  Checking if sysutils/bsdadminscripts already installed
installing: /usr/local/man/man1/bsdadminscripts.1.gz
installing: /usr/local/share/bsdadminscripts/buildflags.awk
installing: /usr/local/etc/buildflags.conf.sample
installing: /usr/local/share/bsdadminscripts/buildflags.mk
installing: /usr/local/man/man1/buildflags.awk.1.gz
installing: /usr/local/man/man1/buildflags.conf.1.gz
installing: /usr/local/man/man1/buildflags.mk.1.gz
installing: /usr/local/sbin/distviper
installing: /usr/local/man/man1/distviper.1.gz
installing: /usr/local/sbin/pkg_libchk
installing: /usr/local/man/man1/pkg_libchk.1.gz
installing: /usr/local/sbin/pkg_upgrade
installing: /usr/local/man/man1/pkg_upgrade.1.gz
installing: /usr/local/sbin/pkg_validate
installing: /usr/local/man/man1/pkg_validate.1.gz
installing: /usr/local/sbin/portconfig
installing: /usr/local/man/man1/portconfig.1.gz
installing: /usr/local/sbin/rcstart
installing: /usr/local/man/man1/rcstart.1.gz
installing: /usr/local/sbin/uma
installing: /usr/local/man/man1/uma.1.gz
installing: /usr/local/etc/uma.conf.sample
hardlinking: /usr/local/sbin/rcstart -> /usr/local/sbin/rcstatus
hardlinking: /usr/local/sbin/rcstart -> /usr/local/sbin/rcstop
hardlinking: /usr/local/sbin/rcstart -> /usr/local/sbin/rcrestart
hardlinking: /usr/local/sbin/rcstart -> /usr/local/sbin/rconestart
hardlinking: /usr/local/sbin/rcstart -> /usr/local/sbin/rconestatus
hardlinking: /usr/local/sbin/rcstart -> /usr/local/sbin/rconestop
hardlinking: /usr/local/sbin/rcstart -> /usr/local/sbin/rconerestart
hardlinking: /usr/local/sbin/portconfig -> /usr/local/sbin/portbuild
hardlinking: /usr/local/sbin/portconfig -> /usr/local/sbin/portclean
hardlinking: /usr/local/sbin/portconfig -> /usr/local/sbin/portfetch
hardlinking: /usr/local/sbin/portconfig -> /usr/local/sbin/portpackage
hardlinking: /usr/local/sbin/portconfig -> /usr/local/sbin/portconfig-recursive
hardlinking: /usr/local/sbin/portconfig -> /usr/local/sbin/portfetch-recursive
===>   Registering installation for bsdadminscripts-6.1.1_1
===>  Cleaning for bsdadminscripts-6.1.1_1

===>>> Upgrade of bsdadminscripts-6.1.1 to bsdadminscripts-6.1.1_1 succeeded

===>>> Returning to update check of installed ports

===>>> Launching child to install sysutils/libgksu

===>>> Port directory: /usr/ports/sysutils/libgksu

===>>> Checking package repository for latest available version

===>>> Creating a backup package for old version libgksu-2.0.9
pkg_delete: package 'libgksu-2.0.9' is required by these other packages
and may not be deinstalled (but I'll delete it anyway):
gnochm-0.9.11_6
py27-gnome-extras-2.25.3_11

===>>> Starting check for runtime dependencies
===>>> Gathering dependency list for sysutils/libgksu from ports
===>>> Dependency check complete for sysutils/libgksu
===>>> Installing package

===>>> Updating dependencies for libgksu-2.0.9 to match installed versions
===>>> Updating dependency entry for libgksu-2.0.9 in each dependent port
===>>> Re-installation of libgksu-2.0.9 succeeded

===>>> Returning to update check of installed ports

===>>> Update check of installed ports complete

===>>> The following actions were performed:
        Upgrade of bsdadminscripts-6.1.1 to bsdadminscripts-6.1.1_1
        Re-installation of libgksu-2.0.9

(...)
===>>> Checking libgksu-2.0.9
===>>> Checking libgksuui-1.0.7_6
        ===>>> /usr/ports/sysutils/libgksuui does not exist
        ===>>> This port should probably be updated
===>>> Checking libglade2-2.6.4_4
===>>> Checking libglut-7.4.4
(...)
===>>> Checking pcre-8.12
===>>> Checking pdfedit-0.4.5
===>>> Checking perl-5.10.1_3
        ===>>> Updating perl-5.10.1_3/+REQUIRED_BY
===>>> Checking perl-5.12.3
===>>> Checking perl-5.12.4
(...)
```


----------



## Kiiski (Jul 19, 2011)

Of course there is always many ways to do things, but these aliases don't seem to contain checking /usr/ports/UPDATING. But that is cladly covered in earlier posts. 

Some examples of easing that is covered at least in this thread:
http://forums.freebsd.org/showthread.php?t=25015 in posts #4 and #5. 

If you are planning on using aliases, maybe you could consider adding that example to ports-check alias.


----------



## vermaden (Jul 19, 2011)

@Kiiski

Added, thanks


----------

