Unix-linux Operating System

1y ago
6 Views
1 Downloads
1.44 MB
57 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Halle Mcleod
Transcription

UNIX-LINUXOPERATINGSYSTEM1201376

DIVIDERSLIDE UBUNTULINUXInstallingSectiontitle& keep the systemup-to-dateOlarik Surinta, PhD.Lecturer

Get Ubuntu Ubuntu is completely free e: 27 August 20173

Download Ubuntu Desktop4

Download Ubuntu DesktopDownload: Ubuntu 17.045

6

Download Ubuntu Desktop7

Download Ubuntu Desktopubuntu-17.04-desktopamd64.isoSize: 1.6 GB8

Install Ubuntu on virtualmachineVirtualBoxvmware9

Install Ubuntu on virtualmachinevmware fusion10

Keep the system up-to-date The apt-get and yum utilities bothfill the same role: They install andupdate software packages.Both utilities compare the files in arepository (generally on the Internet)with those on the local system andupdate the files on the local systemaccording to your instructions.11

Keep the system up-to-date Both utilities (apt-get and yum) automaticallyinstall and update any additional files that apackage depends on (dependencies).Most Linux distributions come with apt-get oryum.Debian-based systems such as Ubuntu are set upto use apt-get, which works with deb packages.Red Hat and Fedora use yum, which works withrpm packages.12

Keep the system up-to-date On a Mac OS X system it is easiest to usethe software update GUI to keep thesystem up-to-date.To facilitate the update process, apt-getand yum keep locally a list of packagesthat are held in each of the repositoriesthey use. Any software you want to installor update must reside in a repository.13

Keep the system up-to-date When you give apt-get or yum acommand to install a package, they lookfor the package in a local package list.If the package appears in the list, aptget or yum fetches both that packageand any packages the package you areinstalling depends on and installs thepackages.14

Using apt-get APT (Advanced Package Tool) is acollection of utilities that download,install, remove, upgrade, and reporton software packages.APT utilities download packages andcall dpkg utilities to manipulate thepackage once they are on the localsystem.15

Using apt-get The primary APT command is aptget; its arguments determine whatthe command does.Working with root privileges, give thecommand apt-get update to updatethe local package list16

Using apt-get: updating thepackage list sudo apt-get updateGet:1 file:/var/cuda-repo-8-0-local InReleaseIgn:1 file:/var/cuda-repo-8-0-local InReleaseGet:2 file:/var/cuda-repo-8-0-local Release [574 B]Get:2 file:/var/cuda-repo-8-0-local Release [574 B]Hit:4 http://th.archive.ubuntu.com/ubuntu xenialInRelease17

sudo apt-get update18

Using apt-get: check thedependency tree The apt-get utility does not tolerate abroken dependency tree.To check the status of the localdependency tree, give the commandapt-get check19

sudo apt-get check sudo apt-get checkReading package lists. DoneBuilding dependency treeReading state information. Done20

sudo apt-get update21

Problem with root privileges apt-get checkE: Could not open lock file /var/lib/dpkg/lock - open (13:Permission denied)E: Unable to lock the administration directory(/var/lib/dpkg/), are you root?Problem: This is because you do not work with rootprivileges.22

Problem with unable to lockthe administration directory Unable to lock the administrationdirectory (/var/lib/dpkg/).Maybe another process using it.23

Problem with unable to lockthe administration directory sudo apt-get checkE: Could not get lock /var/lib/dpkg/lock - open(11: Resource temporarily unavailable)E: Unable to lock the administration directory(/var/lib/dpkg/), is another process using it?24

Problem with unable to lockthe administration directory How to solve the problem Tip 1:–You can delete the lock file with the followingcommand: sudo rm /var/lib/apt/lists/lock–You may also need to delete the lock file in the cachedirectory sudo rm /var/cache/apt/archives/lock sudo rm /var/lib/dpkg/lock25

Problem with unable to lockthe administration directory Tip 2:–You can kill the apt-get process with the following command: ps aux grep apt-get or ps aux grep aptpid process idmrolarik 4166 0.0 0.0 14276 1016 pts/13 S 13:090:00 grep --color auto apt–Then kill the process kill pid or kill -9 pid 26

Using apt-get to installingpackages We can use apt-get to installpackages.The following command uses apt-getto install the zsh package:27

Using apt-get to installingpackages When specific package does not install intoyour Linux system, actually, the system willshow you the install hint. So, you just typeand hit enter. zshThe program 'zsh' is currently not installed. You can installit by typing:sudo apt install zsh28

Using apt-get to installingpackages sudo apt-get install zsh29

Using apt-get to removepackages Remove a package the same way youinstall a package, substitutingremove for install: sudo apt-get remove zsh30

Using apt-get to removepackages31

Using apt-get to removepackages To ensure you can later reinstall a packagewith the same configuration, the apt-getremove command does not removeconfiguration files from the /etc directoryhierarchy.Although it is not recommended, you canuse the purge command instead ofremove to remove all the package files,including configuration files.32

Using apt-get to upgrade thesystem Two arguments cause apt-get to upgradeall packages on the system:–upgrade upgrades all packages on thesystem that do not require new packages tobe installed.–dist-upgrade upgrades all packages on thesystem, installing new packages as needed.–This argument will install a new version ofthe operating system if one is available.33

Using apt-get to upgrade thesystem sudo apt-get upgrade34

Using apt-get to upgrade thesystem When apt-get asks if you want to continue,enter Y to upgrade the listed packages;otherwise, enter N. Packages that are notupgraded because they depend on packagesthat are not already installed are listed as keptback.Use dist-upgrade to upgrade all packages,including packages that depend on packagesthat are not installed. This command alsoinstalls dependencies.35

Other apt-get commandsCommanddefinitionautocleanRemoves old archive files.checkChecks for broken dependencies.cleanRemove archive files.dist-upgradeUpgrades packages on the system,installing new packages as needed. Ifa new version of the operating systemis available, this option upgrades tothe new version.purseRemoves a package and all itsconfiguration files.sourceDownloads source files.updateRetrieves new lists of packages.upgradeUpgrades all packages on the systemthat do not require new packages tobe installed.36

Repositories Repositories hold collections ofsoftware packages and relatedinformation, including headers thatdescribe each package and provideinformation on the packages thepackage depends on.Typically, a Linux distribution maintainsrepositories for each of its releases.37

Repositories – softwarepackage categories Software packages are frequently divided intoseveral categories. Ubuntu uses the followingcategories:–main – Ubuntu-supported open-source software–universe – Community-maintained open-source software–multiverse – Software restricted by copyright or legalissues.–restricted – Proprietary device drivers–backports – Packages from later releases of Ubuntu thatare not available for an earlier release38

Repositories – softwarepackage categories The apt-get utility selects packagesfrom repositories it searches basedon the categories specified in thesources.list file.39

Specifies repositories forapt-get to search sources.list: The /etc/apt/sources.list filespecifies the repositories apt-get searcheswhen you ask it to find or install a package.You must modify the sources.list file toenable apt-get to download software fromnondefault repositories.Typically, you do not need to configureapt-get to install supported software.40

sources.list Each line in sources.list describes one repository andhas the following format:Type URI repository category-listwhere type is deb for packages of executable files anddeb-src for packages of source files; URI is the locationof the repository, usually cdrom or an Internet addressthat starts with http://; repository is the name of therepository apt-get selects packages from.41

sources.listdeb http://us.archive.ubuntu.com/ubuntu/jaunty main restricted multiverse The above line from sources.list on anUbuntu system causes apt-get to search theJaunty archive located atus.archive.ubuntu.com/ubuntu for debpackages that contain executable files.It accepts packages that are categorized asmain, restricted, and multiverse42

cat /etc/apt/sources.list43

Use repositories you trust There are many repositories of software packages.Be selective in which repositories you add tosource.list.When you add a repository, you are trusting theperson who runs the repository not to putmalicious software in packages you may download.In addition, ussupported packages may conflictwith other packages or cause upgrades to fail.44

Tip: cat The cat (short for “concatenate”)command is one of the mostfrequently used command inLinux/Unix like operating systems.cat command allows us to createsingle or multiple files, view contain offile, concatenate files and redirectoutput in terminal or files.45

cat --help46

General Syntax cat [OPTION] [FILE] .47

Display contents of file cat /etc/apt/sources.list# deb cdrom:[Ubuntu 16.04 LTS Xenial Xerus Release amd64 (20160420.1)]/ xenial main restricted# See http://help.ubuntu.com/community/UpgradeNotesfor how to upgrade to# newer versions of the distribution.deb http://th.archive.ubuntu.com/ubuntu/ xenial mainrestricted48

View contents of multiplefiles in terminal cat test test1Hello World!Good morning49

Create a file cat test2Create a file with cat command If you finish the text, press CTRL Dto exit.50

cat test251

Display line number With -n option you could see the line numbersof a specific file in the output terminal. cat -n test test1 test21Hello World!2Good morning3create a file with cat command452

Use standard output withredirection operator We can redirect standard output of afile into a new file else existing file with‘ ’ (greater than) symbol.Careful, existing contents of test1 willbe overwritten by contents of test file cat test test153

Appending standard outputwith redirection operator Appends in existing file with ‘ ’(double greater than) symbol.Here, contents of test file will beappended at the end of test1 file. cat test test154

Redirecting standard inputwith redirection operator When you use the redirect with standardinput ‘ ’ (less than symbol), it use filename test2 as input for a command andoutput will be shown in a terminal. cat test2Show contents of test2 file55

Redirecting multiple filescontain in a single file This will create a file called test3 andall output will be redirected in a newlycreated file. cat test test1 test2 test356

reference A Practical Guide to Linux Commands,Editors, and Shell Programming –Mark G. om/13-basic-cat-command-examples-in-linux/–57

12 Keep the system up-to-date Both utilities (apt-get and yum) automatically install and update any additional files that a package depends on (dependencies). Most Linux distributions come with apt-get or yum. Debian-based systems such as Ubuntu are set up to use apt-get, which works with deb packages. Red Hat and Fedora use yum, which works with

Related Documents:

Linux in a Nutshell Linux Network Administrator’s Guide Linux Pocket Guide Linux Security Cookbook Linux Server Hacks Linux Server Security Running Linux SELinux Understanding Linux Network Internals Linux Books Resource Center linux.oreilly.comis a complete catalog of O’Reilly’s books on Linux and Unix and related technologies .

Unix 101: Introduction to UNIX (i.e. Unix for Windows Users) Mark Kegel September 7, 2005 1 Introduction to UNIX (i.e. Unix for Windows Users) The cold hard truth · this course is NOT sponsored by the CS dept. · you will not receive any credit at all introduce ourselv

UNIX operating system, we will try to place our observations in a wider context thanjustthe UNIXsystem or one particular version of the UNIX system. UNIX system security is neither better nor worse than that of other systems. Any system that provides the same facilities as the UNIX system will necessarily have similar hazards.

UNIX is one of the ground-breaking operating systems from the early days of computing. Mac OS X is built on top of UNIX. Linux is a variation of UNIX. The shell is the command line interface for running UNIX (and Mac OS X and Linux) with just typing (no mouse).

The Linux Programming Interface is the definitive guide to the Linux and UNIX programming interface—the interface employed by nearly every application that runs on a Linux or UNIX system. In this authoritative work, Linux programm

Hello, this is Linus Torvalds, and I pronounce Linux as Linux! Inspired by the UNIX OS, the Linux kernel was developed as a clone of UNIX GNU was started in 1984 with a mission to develop a free UNIX-like OS Linux was the best fit as the kernel for the GNU Project Linux kernel was passed onto many interested developers throughout the

o Company migrating to UNIX/Linux o Joining a company which is using SAS on the Linux platform Challenge Too many commands to learn! Why Use SAS On Unix/Linux o Customising Linux sessions will ensure you increase work efficiency by taking advantage of the imbedded Linux tools. In general transferring and running large files will be quicker in .

UNIX and POSIX APIs: The POSIX APIs, The UNIX and POSIX Development Environment, API Common Characteristics. UNIT – 2 6 Hours UNIX Files: File Types, The UNIX and POSIX File System, The UNIX and POSIX File Attributes, Inodes in UNIX