# Interrupted port install + portable ports



## kuze (Aug 25, 2011)

1. Interrupted port install:
What are the steps to be taken in case of interrupted installation using ports(make install clean)?
I have got an interrupted installation with multilpe dependencies and total size or /usr/ports has increase by 1.5 GB+. So, lot of compiled data is sitting there.
How should i go about handling this situation? DO, i delete the ports directory & reinstall the ports?

2. Portable ports:
Is the ports dir portable? If i move it to a USB drive, will there be any problem?(like path error when dependency resolving takes place or while installation,..)


----------



## wblock@ (Aug 25, 2011)

kuze said:
			
		

> 1. Interrupted port install:
> What are the steps to be taken in case of interrupted installation using ports(make install clean)?
> I have got an interrupted installation with multilpe dependencies and total size or /usr/ports has increase by 1.5 GB+. So, lot of compiled data is sitting there.



The biggest are usually distfiles.  Clean, then go back to installing to get the next round of dependencies.  If it runs out of space again, repeat.  portsclean(1) from ports-mgmt/portupgrade (or -devel) can remove outdated distfiles and libraries to save space.



> 2. Portable ports:
> Is the ports dir portable? If i move it to a USB drive, will there be any problem?(like path error when dependency resolving takes place or while installation,..)



Mount the portable drive at /usr/ports.  That directory is only used for building.  Dependencies are found where they were installed, usually /usr/local.


----------



## jb_fvwm2 (Aug 26, 2011)

(Applicable to a full answer probably..)...
If you knew where the build/install interrupted, you can resume... 
	
	



```
cd /usr/ports/devel/ccache 
make build
```
 ... Suppose you are out of time, or in an xterm and need to get to a console? Just cntl-c the build., and repeat the two commands (later, or at the console.) .  Ninety-five percent of the time, the build will resume *where it left off* with no untoward effects.


----------



## kuze (Aug 26, 2011)

wblock said:
			
		

> Mount the portable drive at /usr/ports.  That directory is only used for building.  Dependencies are found where they were installed, usually /usr/local.


So, the ports dir is not portable? I was intending to move the ports dir to my USB. 
a. If i mount it at /usr/ports. The path to my package will become /usr/ports/ports/package. Will that work?

b. If i mount it at /mnt/usb. and do "cd /mnt/usb/ports/package" and "make install clean" If a depenency is not found to be installed at /usr/local. Where will it look for its port? At /usr/ports/dependency1 or /mnt/usb/ports/dependency1?




			
				jb_fvwm2 said:
			
		

> ```
> cd /usr/ports/devel/ccache
> make build
> ```
> ... Suppose you are out of time, or in an xterm and need to get to a console? Just cntl-c the build., and repeat the two commands (later, or at the console.) .  Ninety-five percent of the time, the build will resume *where it left off* with no untoward effects.


This is great. But, i will have cd to the port i actually mean to install or do have cd to port of dependency which was getting resolved when i did ctrl-c?
Also, will it work if i move the ports dir.
i.,e if i move it to usb, then mount it to /mnt/usb and do "cd /mnt/usb/ports/package" and "make build"

Thanks.


----------



## kuze (Aug 26, 2011)

ps: please assume ../package to be ../category/package
and ../dependency1 to be ../category/dependency1 in above


----------



## SirDice (Aug 26, 2011)

You can set *PORTSDIR* to point to an alternative location. See ports(7).


----------



## jb_fvwm2 (Aug 26, 2011)

If you are watching the build before cntl-c, you can conjecture which port is building. If it is a dependency, you would restart there *maybe* ( portmaster, if you are practiced, can handle most of the restarting *in most cases*, but often fails if trying to reinstall a dependency that is already (re)installed.  ). 
	
	



```
portmaster -d -B -P -i [FILE]category/port[/FILE] [port] category/port category/port [/port]
```
 works super, more often than not. (I've _almost_ perfected placing that command in a .sh to seamlessly handle a multiday upgrade procedure, but can save a few hours doing it piecemeal...)


----------



## kuze (Aug 27, 2011)

The disk being full i cannot continue the installation. I am trying to move the ports dir, but having mounting issues with ext4/ufs. 

I will post back when i try out the suggested solutions. Thank-you!


----------



## wblock@ (Aug 27, 2011)

Deleting /usr/ports/distfiles is mostly safe.  Any that are actually needed will be downloaded again.  Don't do it if you're saving distfiles from old versions.


----------

