What is a port The Ports Collection is essentially a set of Makefiles, patches, and description files placed in /usr/ports. The port includes instructions.

Slides:



Advertisements
Similar presentations
VMWare to Hyper-V FOR SERVER What we looked at before migration  Performance – Hyper-V performs at near native speeds.  OS Compatibility – Hyper-V.
Advertisements

 Two technologies › Packages › Ports  Packages › contains pre-compiled copies of all the commands for the application, as well as any configuration.
Raymond R. Balise Health Research and Policy
1 Computer Files Stored on disks, CDs, tapes, in memory. Types of files: plain text, formatted (.doc.xls etc…), binary (executable). A disk has a directory.
Using subversion COMP 2400 Prof. Chris GauthierDickey.
Installing Applications in FreeBSD. Computer Center, CS, NCTU 2 Overview  Two technologies Packages Ports  Packages contains pre-compiled copies of.
Installing Applications Chia-Hung Tsai. Computer Center, CS, NCTU 2 Overview  Two technologies Packages Ports  Packages contains pre-compiled copies.
Software installation Chapter 7. Software installation Numerous software options Usually free Open source Several sources Installation CD Websites sourceforge.net.
Hands-On Microsoft Windows Server 2003 Chapter 2 Installing Windows Server 2003, Standard Edition.
Apache : Installation, Configuration, Basic Security Presented by, Sandeep K Thopucherela, ECE Department.
Source Code Management Or Configuration Management: How I learned to Stop Worrying and Hate My Co-workers Less.
Format Scandisk Defragmentation Antivirus Compression Software
Linux+ Guide to Linux Certification, Third Edition Chapter 11 Compression, System Backup, and Software Installation.
NDT Tools Tutorial: How-To setup your own NDT server Rich Carlson Summer 04 Joint Tech July 19, 2004.
Working with SharePoint Document Libraries. What are document libraries? Document libraries are collections of files that you can share with team members.
The Linux Operating System Lecture 2: Installation and Installing Programs Tonga Institute of Higher Education.
Va-scanCopyright 2002, Marchany Unit 3 – Installing Solaris Randy Marchany VA Tech Computing Center.
Chapter 11 Compression, System Backup, and Software Installation.
Using the “CLI” Unix / Linux Preparation Course May 25 Djibouti.
Linux Operations and Administration
Partner Logo German Cancio – WP4-install LCFG HOW-TO - n° 1 WP4 hands-on workshop: EDG LCFGng exercises
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
Unix Command Project Justin Rogers for LS 560 Spring 2015.
Remote Unit Testing Milestone III Alex Riordan Brian Pruitt-Goddard.
CIS 450 – Network Security Chapter 16 – Covering the Tracks.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Apache Web Server v. 2.2 Reference Manual Chapter 1 Compiling and Installing.
Maintain Installed Applications. Computer Center, CS, NCTU 2 In Ports Tree  / Makefile  COMMENT pkg-descr  WWW pkg-message  Shown after installed.
Day 7 Installing Software RPM tar, mtools make, ssh.
SharePoint document libraries I: Introduction to sharing files Sharjah Higher Colleges of Technology presents:
Managing Software Patches 10/15/ Introducing Solaris OE Patches A patch contains collection of files and directories Patch replaces existing files.
Booting Ubuntu Linux Live CSCI 130 – Fall 2008 Action Lab Dr. W. Jones.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
An Introduction to Designing and Executing Workflows with Taverna Aleksandra Pawlik materials by: Katy Wolstencroft University of Manchester.
Publishing Your Web Pages Ann Emmanuel SIUE Web Administrator
Keeping Up-to-date AfNOG X Cairo, Egypt. Recap on FreeBSD design Distribution includes kernel, and some user-land binaries (bind, shells, network tools,
Advanced BioPSE NCRR How to Install and Configure J. Davison de St. Germain Chief Software Engineer SCI Institute December 2003 J. Davison.
Setting up Cygwin Computer Organization I 1 May 2010 ©2010 McQuain Cygwin: getting the setup tool Free, almost complete UNIX environment emulation.
P3 - prepare a computer for installation/upgrade By Ridjauhn Ryan.
Using the remote access option on the lab computers Fall 2005.
1 FreeBSD Installation AFNOG X Cairo, Egypt May 2009 Hervey Allen.
1 CSE306 Operating Systems Projects CVS/SSH tutorial.
Apache, MySQL and PHP Installation and Configuration Chapter 2 MySQL Installation and Configuration.
2007 TAX YEARERO TRAINING - MODULE 61 ERO (Transmitter) Training Module 6 Federal and State Installation and Updates.
1 FreeBSD Installation AFNOG Chix 2011 Blantyre, Malawi 31 st Oct - 4 th Nov 2011 Dorcas Muthoni and Evelyn Namara.
More Unix Naomi Altman. Directories Directory = folder mkdir - makes a new directory rmdir - removes an empty directory cd mydirectory - moves you into.
Software in the Data Protector Architecture
Installing Applications in FreeBSD lctseng. Computer Center, CS, NCTU 2 Before we start  Permission issue root: the super user Like administrator in.
Installing Applications in FreeBSD. Computer Center, CS, NCTU 2 Install software  Package Pre-built rpm, yum, dpkg, … FreeBSD: pkg_add, pkg_delete, pkg_info.
Post Install Configuration FreeBSD SANOG 9 January 14, 2007 Colombo, Sri Lanka Hervey Allen.
Your current Moodle 1.9 Minimum Requirements Ability to do a TEST RUN! Upgrading Moodle to Version 2 By Ramzan Jabbar Doncaster College for the Deaf By.
CACI Proprietary Information | Date 1 PD² SR13 Client Upgrade Name: Semarria Rosemond Title: Systems Analyst, Lead Date: December 8, 2011.
Joomla Awdhesh Kumar Singsys Pte Ltd. What is Joomla? Joomla is an award-winning content management system (CMS), which enables you to build Web sites.
Building programs LinuxChix-KE. What happens in your CPU? ● It executes a small set of instructions called "machine code" ● Each instruction is just a.
1 April 2, Software Packaging and Releasing Best Practices William Cohen NCSU CSC 591W April 2, 2008.
FreeBSD ports & packages. FreeBSD ports & packages - overview Different UNIX distributions use differents package systems for distributing software Debian.
Updating FreeBSD Unix System Administration. Objectives At the end of this session you should be able to: 1. Understand the differences between the CURRENT.
Autonomy Paradigm Warning: This document is a part of my “Responsible Programming” theme. All docs related to that theme just gather some of my ideas.
After Construction Name: Per #:.
Installing Applications in FreeBSD
Chapter 7 Installing Program &Backup Tool
The Linux Operating System
Automation System (OPAC) Tutorial
Keeping Up-to-date AfNOG X Cairo, Egypt.
Lecture 13 RPM and its advantages.
Post Install Configuration FreeBSD
Installing Applications in FreeBSD
FreeBSD ports & packages
Cygwin: getting the setup tool
Presentation transcript:

What is a port The Ports Collection is essentially a set of Makefiles, patches, and description files placed in /usr/ports. The port includes instructions on how to build source code, but does not include the actual source code. You can get the source code from a CD-ROM or from the Internet. Source code is distributed in whatever manner the software author desires. Frequently this is a tarred and gzipped file, but it might be compressed with some other tool or even uncompressed. The program source code, whatever form it comes in, is called a ``distfile'' A port skeleton is a minimal set of files that tell your FreeBSD system how to cleanly compile and install a program.

A “Makefile”. The Makefile contains various statements that specify how the application should be compiled and where it should be installed on your system. A “distinfo” file. This file contains information about the files that must be downloaded to build the port and their checksums, to verify that files have not been corrupted during the download using md5. A “files” directory. This directory contains patches to make the program compile and install on your FreeBSD system. Patches are basically small files that specify changes to particular files. They are in plain text format, and basically say ``Remove line 10'' or ``Change line 26 to this...''. See the man pages for diff and patch for details. A “pkg-descr” file. This is a more detailed, often multiple-line, description of the program. A “pkg-plist” file. This is a list of all the files that will be installed by the port. It also tells the ports system what files to remove upon Composition of a sample port.

Installing using Ports In our example we are going to install the lsof package which is a nice systems administration utility that does not come with FreeBSD by default. However before we do this we need to make a small change to our /etc/make.conf. ● vi /etc/make.conf ● We are going to insert a magic line in here which you won't need at home: MASTER_SITE_OVERRIDE=ftp://inst.ws.linuxchix.or.ke/pub/FreeBSD/ports/distfiles/

Magic explained.. If you have a local mirror of the FreeBSD ports, you can save bandwidth on your network by configuring you machines to try downloading from that mirror first. You can do this on a per port basis.. e.g # cd /usr/ports/sysutils/lsof # make MASTER_SITE_OVERRIDE=.... install However, putting this setting in /etc/make.conf ensures we won't need to type this long command all week.

Installing the lsof port Now that we have edited our /etc/make.conf, let us install the lsof port: # cd /usr/ports/sysutils/lsof # make # make install

Once you are returned to your prompt, you should be able to run the application you just installed. Since lsof is a program that runs with increased privileges, a security warning is shown. During the building and installation of ports, you should take heed of any other warnings that may appear. You can save an extra step by just running make install instead of make and make install as two separate steps. Note: If you are using the c shell (csh) or it's relatives (tcsh) you will have to ask it to regenerate the internal database of binaries and where in your $PATH they are located. So, if after installing a new port you can't run the binary, then do “rehash” to fix that.

For users which cannot be connected all the time, the make fetch option is provided. Note that if a port depends on libraries or other ports this will not fetch the distfiles of those ports too. Replace fetch with fetch-recursive if you want to fetch all the dependencies of a port too. Note: You can build all the ports in a category or as a whole by running make in the top level directory, just like the aforementioned make fetch method. This is dangerous, however, as some ports cannot co-exist. In other cases, some ports can install two different files with the same filename. Using the Ports Collection will use up disk space over time. Because of this tendency of the ports tree to grow in size, after building and installing software from the ports, you should always remember to clean up the temporary work directories using the make clean command. This will remove the work directory after a port has been built and installed. You can also remove the source distribution files from the distfiles directory, and remove the installed ports if the need for them has passed.

Removing Installed Ports # cd /usr/ports/sysutils/lsof # make deinstall That was easy enough. You have removed lsof from your system. If you would like to reinstall it, you can do so by running make reinstall from the /usr/ports/sysutils/lsof directory. Note: The make deinstall and make reinstall sequence does not work once you have run make clean. If you want to deinstall a port after cleaning, use pkg_delete

Updating the ports tree This is a quick method for getting the Ports Collection using CVSup. On Monday we installed the cvsup-without-gui from the CDs. If you don't have it installed, then install net/cvsup As root, edit /usr/share/examples/cvsup/ports-supfile Change CHANGE_THIS.FreeBSD.org to a CVSup server near you. In our case this will be noc.ws.linuxchix.or.ke. Run cvsup: # cvsup -g -L 2 /usr/share/examples/cvsup/ports-supfile It is wise to do this regularly in order to ensure that you install the latest version of a port each time you use ports for installation. The same command is used to update your /usr/src tree; just that you use the stable-supfile.

UPGRADING PORTS Keeping your ports up to date can be a tedious job. For instance, to upgrade a port you would go to the ports directory, build the port, deinstall the old port, install the new port, and then clean up after the build. The sysutils/portupgrade utility will do everything for you! Just install it like you would any other port, using the make install clean command. # cd /usr/ports/sysutils/portupgrade # make install Now create a database with the pkgdb -F command. This will read the list of installed ports and create a database file in the /var/db/pkg directory. #pkgdb -F Now when you run portupgrade -a, it will read this and the ports INDEX file. Finally, portupgrade will begin to download, build, backup, install, and clean the ports which have been updated. portupgrade comes with a lot of options for different use cases, the most important ones will be presented here:

Portupgrade Options If you want to upgrade only a certain application, not the complete database, use portupgrade pkgname, include the flags -r if portupgrade should act on all those packages depending on the given package as well, and -R to act on all packages required by the given packages. To use packages instead of ports for installation, provide -P. With this option portupgrade searches the local directories listed in PKG_PATH, or fetches packages from remote site if it is not found locally. If packages can not be found locally or fetched remotely, portupgrade will use ports. To avoid using ports, specify -PP. To just fetch distfiles (or packages, if -P is specified) without building or installing anything, use -F. Note: It is important to regularly update the package database using pkgdb - F to fix inconsistencies, especially when portupgrade asks you to. Do not abort portupgrade while it is updating the package database, this will leave you an inconsistent database.

Portsnap: The future. As of FreeBSD 6.x you are encouraged to use portsnap for upgrading the ports tree (instead of cvsup). You still will have to use portupgrade to install the new ports you'll have downloaded. # portsnap fetch (this downloads a new ports snapshot) # portsnap install (create a tree from the snapshot downloaded) Once you've done that the first time, next time you need to upgrade your ports do: # portsnap fetch # portsnap update