Installing Applications in FreeBSD

Slides:



Advertisements
Similar presentations
LinuxChix Africa UNIX BASICS. To r00t or not to r00t ● Unix security is (in most cases) binary. Either you are root or you are not. – Effects on permissions.
Advertisements

Module 6: Configuring Windows XP Professional to Operate in a Microsoft Network.
 Two technologies › Packages › Ports  Packages › contains pre-compiled copies of all the commands for the application, as well as any configuration.
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.
Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from
Linux Shell. 2 Linux Command-Line Interface ■ Linux shells: A shell is a command interpreter that allows you to type commands from the keyboard to interact.
Using the “CLI” Unix / Linux Preparation Course May 25 Djibouti.
UNIX ™ /Linux Overview Unix/IP Preparation Course June 9, 2013 Lusaka, Zambia.
Linux Operations and Administration
Chapter-4 Windows 2000 Professional Win2K Professional provides a very usable interface and was designed for use in the desktop PC. Microsoft server system.
Partner Logo German Cancio – WP4-install LCFG HOW-TO - n° 1 WP4 hands-on workshop: EDG LCFGng exercises
CSE 390a Editing and Moving Files
V Avon High School Tech Crew Agenda Old Business –Delete Files New Business –Week 9 Topics: Coming up: –Yearbook Picture: Feb 7 12:20PM.
Benjamin Lavalley, Sr. Product Marketing Manager Kaseya 2 Upgrade Review.
SUSE Linux Enterprise Server Administration (Course 3037) Chapter 4 Manage Software for SUSE Linux Enterprise Server.
The EPIKH Project (Exchange Programme to advance e-Infrastructure Know-How) Overview of software tools for gLite installation & configuration.
11 MANAGING AND DISTRIBUTING SOFTWARE BY USING GROUP POLICY Chapter 5.
Apache Web Server v. 2.2 Reference Manual Chapter 1 Compiling and Installing.
Access Training Linux/Unix Power Broker Access Custom Schema Database Access Customer Training Date: 25-JAN-2005.
Maintain Installed Applications. Computer Center, CS, NCTU 2 In Ports Tree  / Makefile  COMMENT pkg-descr  WWW pkg-message  Shown after installed.
UNIX ™ /Linux Overview Unix/IP Preparation Course May 25, 2014 Djibouti.
Apache, MySQL and PHP Installation and Configuration Chapter 1 Apache Installation and Configuration.
Section 11: Implementing Software Restriction Policies and AppLocker What Is a Software Restriction Policy? Creating a Software Restriction Policy Using.
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.
Wordpress with Mina Automated Deployment Solution Jonathan Gravato DIG 4104c.
Module 5: Creating and Configuring Group Policies.
Apache, MySQL and PHP Installation and Configuration Chapter 2 MySQL Installation and Configuration.
Installing Applications in FreeBSD lctseng. Computer Center, CS, NCTU 2 Before we start  Permission issue root: the super user Like administrator in.
How to configure, build and install Trilinos November 2, :30-9:30 a.m. Jim Willenbring.
Installing Applications in FreeBSD. Computer Center, CS, NCTU 2 Install software  Package Pre-built rpm, yum, dpkg, … FreeBSD: pkg_add, pkg_delete, pkg_info.
Integrity Check As You Well Know, It Is A Violation Of Academic Integrity To Fake The Results On Any.
Vmware 2V0-621D Vmware Exam Questions & Answers VMware Certified Professional 6 Presents
Unit 9 ITT TECHNICAL INSTITUTE NT1330 Client-Server Networking II Date: 2/17/2016 Instructor: Williams Obinkyereh.
Upgrading PD² Archiving Utility Name: Semarria Rosemond Title: Systems Analyst, Lead Date: December 8, 2011.
CACI Proprietary Information | Date 1 Upgrading to webMethods Product Suite Name: Semarria Rosemond Title: Systems Analyst, Lead Date: December 8,
Building programs LinuxChix-KE. What happens in your CPU? ● It executes a small set of instructions called "machine code" ● Each instruction is just a.
Linux Basics Part 2. VIM Editor vi improved Installed on most Linux machines Can be a bit confusing at first... o Cheat sheets FTW Other popular editors:
Using Linux Kaya Oğuz Room: 310.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com SSH Thomas Petazzoni Free.
FreeBSD ports & packages. FreeBSD ports & packages - overview Different UNIX distributions use differents package systems for distributing software Debian.
Overview of software tools for gLite installation & configuration
Installing Applications in FreeBSD
Chapter 9 Managing Software
CS1010: Intro Workshop.
Development Environment Basics
Pkgng.
Install external command line softwares
Chapter 9 Router Configuration (Ospf, Rip) Webmin, usermin Team viewer
Installing Applications in FreeBSD
Overview – SOE Sudo September 2016.
Managing Software.
The Linux Operating System
Introduction to Programming the WWW I
Ubuntu Working in Terminal
Assignment Preliminaries
Unix Systems Administration
June 2011 David Front Weizmann Institute
Lecture 13 RPM and its advantages.
Engineering Innovation Center
Crawling with Heritrix
University of Texas Rio Grande Valley Systems Administration CSCI 6175
(Chapter 2) John Carelli, Instructor Kutztown University
Compilers, Make and SubVersion
Unit 9 NT1330 Client-Server Networking II Date: 8/9/2016
Shells, Help, and Paths.
Working with Mac OS and Linux
FreeBSD ports & packages
Security Templates Lecture 7.
Tools and Explanations for Mac Beginners
Presentation transcript:

Installing Applications in FreeBSD wengyc

Before we start Permission issue root: the superuser In Unix-like system, root is the conventional name of the user who has all rights or permissions (to all files and programs) in all modes (single- or multi-user) Like administrator in M$ Windows Don’t execute commands as root directly It’s DANGEROUS But sometimes you still need to be root to do something Install software Manage system file Create/modify/delete users

Before we start Become root Change current user Console login with root By default, you cannot login as root via SSH Change current user Don’t need to login with console Use command ‘su -’, and them type root’s password To see which credit you are using, use ‘whoami’ nctucs [~] -wangth- whoami wangth nctucs [~] -wangth- su - Password: root

Before we start As mentioned before, don’t run as root directly Can we execute with root’s credential only for some specific commands? Like ‘Run as administrator’ in Windows Is there similar commands in FreeBSD?

Before we start Run commands with other user’s permission ‘sudo’ command Only simplest explanation here for basic usage ‘sudo’ syntax and other details will explain in later chapter Here only tell you how to simply enable ‘sudo’ How to enable sudo? ‘sudo’ is not a built-in command, need to be installed manually

Before we start – Enable ‘sudo’ (1) Install the package Check Internet connection ping 168.95.1.1 Become root (su -) Execute ‘pkg install sudo’ This will install ‘sudo’ from Internet Type ‘Y’( means yes) when it asks for conformation

Before we start – Enable ‘sudo’ (2) Allowing your user to execute ‘sudo’ Switch to root first Type ‘visudo’ to edit the sudoer file Specific who can use ‘sudo’ Save the file and exit, back to normal user Use ‘logout’ command or press Ctrl+D ## ## User privilege specification root ALL=(ALL) ALL wangth ALL=(ALL) ALL

Before we start – Using ‘sudo’ Now, you can prepend ‘sudo’ before commands to run them as root But please think carefully before you type Execute commands with ‘sudo’ sudo whoami You have root’s credential sudo pkg install vim Install software without become root directly You need to re-type your password Don’t need to re-type within 5 minutes

Install software Package Source Pre-built Like most of installer (.msi) in Windows Other Unix-like system: rpm, yum, dpkg, apt, … FreeBSD: pkg Source Compile the source files first and then install Tar ball, a pack of source code tar -xzf certain-source.tar.gz cd certain-source ./configure --help ./configure [options …] make make install (root permission)

Install software : Overview Three technologies Packages Ports Tar ball pre-built ports, contain pre-compiled copies of all the commands for the application, as well as any configuration files or documentation a collection of files designed to automate the process of compiling an application from source code and additional patches a set of Makefile, patches, description files, … Both packages and ports understand dependencies fetch it, configure the installation options, and compile it by yourself NO DEPENDENCY CHECKING.

Overview Package benefits Ports benefits Why tar ball? Packages do not require any additional compilation Benefit for slow machines Ports benefits You can tweak the compilation options to generate code that is specific to a different processor – speed Some applications have compile time options relating to what they can and cannot do – customization Why tar ball? Some software cannot be found in ports collection Some latest version of software may have new configurations that do not exist in port

Package System (1) pkg Install new software New generation of FreeBSD package system Install new software Fetch packages from Internet pkg install <names of packages…> pkg install vim screen tmux Run with root’s permission (sudo) Automatically update the database By default invoking either of pkg install or pkg upgrade will cause repository catalogues to be updated automatically Perform dependency check Will install software that required by new software

Package System (2) Upgrade currently installed software pkg upgrade <names of packages…> pkg upgrade vim pkg upgrade Upgrade all installed software This will also update the database Update packages database only pkg update Delete a package pkg delete <names of packages> pkg delete php53

Package System (3) Show information about installed packages pkg info Show all installed packages Use ‘grep’ to find specific packages pkg info | grep vim pkg info <name of package> Show detailed information pkg info php56 Show version of installed packages pkg version pkg version -v nctucs [~] -wangth- pkg version -v bash-4.3.46_1 < needs updating (remote has 4.4.12_2) bind99-9.9.9P8_1 < needs updating (remote has 9.9.10P3) ca_root_nss-3.32 = up-to-date with remote

How to use ports Obtain the ports collection We should… Ports will List of ports available to be installed into system We should… Find the application Change to the directory for the port Ports will Fetch the tar ball Ask for configuration friendly Compile the source code Install your application Deinstall process

Obtaining the Ports Collection (1/2) portsnap(8) Fetch and update your port tree fetch, extract, update, cron sudo portsnap fetch extract update /etc/portsnap.conf sudo vim /etc/portsnap.conf SERVERNAME=portsnap.tw.FreeBSD.org https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html

Obtaining the Ports Collection (2/2) svn(1) / svnlite Install Root SSL certificates to allows Subversion to verify the identity of HTTPS repository servers pkg install ca_root_nss Checkout from a given repository  svn checkout https://svn.FreeBSD.org/repository/branch lwcdir sudo svn checkout https://svn.FreeBSD.org/ports/head /usr/ports Update the local working copy svn update lwcdir sudo svn update /usr/ports https://www.freebsd.org/doc/handbook/svn.html

Obtaining the Ports Collection Port directory /usr/ports/<category>/<name>

Ports system (1) Find your application cd /usr/ports make search name=program name make search key=string liuyh@NASA /usr/ports $ make search name=zh-mutt Port: zh-mutt-devel-1.5.20_20090629 Path: /usr/ports/chinese/mutt Info: The Mongrel of Mail User Agents with Chinese support Maint: rafan@FreeBSD.org B-deps: autoconf-2.62 autoconf-wrapper-20071109 automake-1.10.1 automake-wrapper-20071109 gettext-0.17_1 libiconv-1.13.1 m4-1.4.13,1 perl-5.8.9_3 zh-autoconvert-0.3.16 R-deps: gettext-0.17_1 libiconv-1.13.1 mime-support-3.46.1 zh-autoconvert-0.3.16 WWW: http://www.mutt.org/

Ports system (2) psearch(1) Simple but useful tool to find ports ports-mgmt/psearch Install it before you use psearch <name of port> psearch vim nctucs [~] -wangth- psearch vim audio/vitunes Curses-based media player with vim-like keybinds devel/clewn Clewn provides Gdb support within Vim devel/p5-Shell-EnvImporter Inherit different shell environments and restore previous editors/cream Gvim extension with many features editors/neovim Next generation Vim editors/p5-Vimana Vim script manager editors/vim Improved version of the vi editor editors/vim-lite Improved version of the vi editor (lite package) …

Ports system (3) Type “make install clean” to install your application make config (/var/db/ports/) make fetch (/usr/ports/distfiles/) make checksum make extract make patch make configure make build “make” means all of the above make install make clean make distclean Clean files generated by configure process

Ports system (4) The ports system uses fetch(1) to download the files MASTER_SITES environment variable /etc/make.conf Options for ports make config Won’t build or install the port Use this to re-configure ports (otherwise, it uses old one instead) hidden options (not shown in ‘make config’) Edit the Makefiles under that port directory MASTER_SITE_BACKUP?= \ http://FreeBSD.cs.nctu.edu.tw/distfiles/${DIST_SUBDIR}/ MASTER_SITE_OVERRIDE?= ${MASTER_SITE_BACKUP}

Ports system (5) I have installed the application but Command not found… Logout, and then login. If you use (t)csh rehash

Deinstall Applications Two methods pkg delete Find the package name via pkg info Dependency check Disable dependency check -f : force pkg delete -f <names of packages> make deinstall Change to the ports directory Delete it anyway Similar to ‘pkg delete -f’

Upgrading Ports using Portmaster ports-mgmt/portmaster A utility for easily upgrading and installing ports Install or upgrade a port portmaster <category>/<name> portmaster sysutils/lsof /usr/ports/UPDATING Read before attempting any port upgrades!!! Useful options -B, -D, -a, -r, -y, -H, -w portmaster -dyBwH editors/vim cd /usr/ports/ports-mgmt/portmaster make install clean B:不要備份舊的package D:不要清除distfiles a:升級全部 r:指定某一個port要重新build y:讓所有問問題的時候都自動回答yes H:把噴出來的資訊存到log檔案而不是螢幕上 w:保留舊的shared library

Package/Port Security Issue Show security issues about installed packages No matter from port or from package pkg audit Upgrade these packages to avoid security problems nctucs [~] -wangth- pkg audit lynx-2.8.8.2_3,1 is vulnerable: lynx -- multiple vulnerabilities CVE: CVE-2016-9179 CVE: CVE-2014-3566 WWW: https://vuxml.FreeBSD.org/freebsd/03532a19-d68e-11e6-9171-14dae9d210b8.html

Try to install from ports screen, tmux vim, emacs mutt wget, curl lftp lynx, w3m expect zh-telnet