Linux basic configurations - linux administration http://basicconfig.com/taxonomy/term/4 en Linux backup tutorial http://basicconfig.com/administration/linux-backup <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>This is a tutorial on how to make backup on a Linux system. Please read and understand how Linux backup works before attempting to create the real backup job. This tutorial is a step by step guide, so it starts with a simple example and finish with a complete example.</p> <h2>Linux file backup software and backup programs</h2> <p>There are several backup tools in Linux.</p> <ol><li>Ubuntu backup using Simple Backup program</li> <li>Linux backup using Linux tar command utility</li> <li>Linux backup using dd command utility</li> </ol><h2>Ubuntu backup system using Simple Backup program</h2> <p>The <b>Simple Backup</b> program is a gui backup tool. You can install it in Ubuntu Desktop by clicking on the <em>Applications</em> and choose <em>Add/Remove</em>. When the Add/Remove pane opens, type <em>Simple Backup</em> in the <b>Search</b> textbox. You'll see a few backup programs in the result, but what we need is the Simple Backup Suite which includes Simple Backup Config and the Simple Backup Restore.</p> <p><b>Here is the description about Simple Backup Suite:</b></p> <p>Simple Backup Suite is a set of backend backup daemon and GNOME GUI frontends that provide a simple yet powerful backup solution for common desktop users. Backups can be written to local directory or remote servers using GNOME VFS technology. A fine control is possible regarding what folders and files to backup. Files can be excluded even with a set of regular expressions. Regular backups can be scheduled. This tool has been written with Google sponsorship during Summer of Code 2005 with mentoring help from Ubuntu.</p> <p><em>Canonical does not provide updates for Simple Backup Config (and Simple Backup Restore). Some updates may be provided by the Ubuntu community.</em></p> <p>Click on the Simple Backup Config and the Simple Backup Restore tickboxes. See the example screenshot below:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/2/Screenshot-Add-Remove-Applications_1.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/2/thumbs/Screenshot-Add-Remove-Applications_1.png" alt="Simple Backup Config screenshot image" /></a></p> <p>A new pane pops up asking you whether you want to apply the changes. Please check that only the Simple Backup Config and the Simple Backup Restore were there. Click Apply button. See the example screenshot below:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/2/Screenshot-Simple-Backups-Suite.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/2/thumbs/Screenshot-Simple-Backups-Suite.png" alt="choose Simple Backup Suite screenshot image" /></a></p> <p>Here is the Simple Backup Config and the Simple Backup Restore installation in progress screenshot:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/2/Screenshot-Installing-Software.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/2/thumbs/Screenshot-Installing-Software.png" alt="Installing Simple Backup Suite screenshot image" /></a></p> <p>When the installation complete, you'll see a screenshot like the example below:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/2/Screenshot-Applications-Installed.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/2/thumbs/Screenshot-Applications-Installed.png" alt="Simple Backup Suite installation finished screenshot image" /></a></p> <p>Now you can start using Simple Backup Config to backup files. Click <em>System</em> and choose <em>Administration</em>. From the list, choose Simple Backup Config to open the backup program. You need to enter your password to do the backup job. Here is the example screenshot of the Simple Backup Config program:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/2/Screenshot-Simple-Backup-Properties.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/2/thumbs/Screenshot-Simple-Backup-Properties.png" alt="Simple Backup program screenshot image" /></a></p> <p>Here is the backup options:</p> <ul><li>Use recommended backup settings.</li> <li>Use custom backup settings.</li> <li>Manual backups only.</li> </ul><p>You can customize the backup properties, such as:</p> <ul><li>Include - Add/Remove directories or files to backup.</li> <li>Exclude - Add/Remove directories or files to backup. You can specify the path, file types, regex and max size details.</li> <li>Destination - Use default destination (/var/backup), set custom local backup directory or use a remote directory if you want to backup to a network server.</li> <li>Time - Set time for a regular manual/automatic backup including a full backup and incremental backup.</li> <li>Purging - Set to purge old and incomplete backup.</li> </ul><p>When you done customizing the backup properties, click <em>Save</em>. Click <em>Backup Now</em> to start backup Ubuntu system. </p> <p>Backup information and tips:</p> <ul><li>Backup can take some times to finish (depends on how many directories and size).</li> <li>Testing backup on the disk first before setting backup directly to a cd, dvd or external hard disk.</li> <li>Do not put backup on the same hard disk where your Ubuntu resides. Put backup on the second hard disk, cd, dvd or external hard disk.</li> <li></li> <li>Create a full backup at least once a week and daily incremental backup is recommended.</li> </ul><h2>Linux backup using Linux tar command utility</h2> <p>Probably the most popular backup utility in Linux is the tar command. We have discussed about tar command quite detail in <a href="/linux/tar" target="_blank">Linux tar command - How to archive, compress and extract files in Linux</a> tutorial. You can check the tutorial for more information about tar command syntax, how to make tar archive and compress tar file. Here are some examples on how to do backup using tar command:</p> <p>To backup only certain files and directories in Linux, we'll use 'tar -cvf' command to archive all the files and directories like in the example below:</p> <table><tr><td><code>root@slackware:~# <span style="color:red;">cd /home/luzar/</span><br /> root@slackware:/home/luzar# <span style="color:red;">mkdir /var/backup</span><br /> root@slackware:/home/luzar# <span style="color:red;">tar -cvf /var/backup/selective-backup.tar tutorials/ priority/ sony/ barcode/</span><br /></code></td> </tr></table><p>The example above creates an archive file named 'selective-backup.tar' which contains tutorials, priority, sony and barcode directories in /var/backup directory. All files have been archived but not compressed.</p> <p>To backup a complete user's home directory in Linux system, we'll use 'tar -czvf' and automatically compressed the archived file with gunzip using the '-z' option. See the example below:</p> <table><tr><td><code>root@slackware:/home/luzar# <span style="color:red;">cd</span><br /> root@slackware:~# <span style="color:red;">tar -czvf /var/backup/luzar-home.tar.gz /home/luzar/</span><br /><span style="color:red;">tar: Removing leading `/' from member names</span><br /> /home/luzar/<br /> ...<br /></code></td> </tr></table><p>In the example above, we use absolute path names, so when restoring backup, all files will be restored to their respective directories. We also have a message <em>tar: Removing leading `/' from member names</em>. This statement means a '/' will be removed from all files and directories added to the archive. It will be 'home/luzar/' instead of '/home/luzar/'. The difference is, when restoring an archive file with '/home/luzar/', all the data will be written to the /home directory which eventually will overwrite the existing data while the 'home/luzar/' will be written to wherever it's been extracted to.</p> <p>If we want to compress file using 'bzip2', using '-j' command instead. The extension for bzip2 compressed destination file is 'file.tar.bz2'.</p> <p>Here is an example result of an archive file, gunzip compressed and bunzips compressed file. See the different in size:</p> <table><tr><td><code>root@slackware:/home/luzar# <span style="color:red;">tar -cvf /var/backup/priority.tar priority/</span><br /> root@slackware:/home/luzar# <span style="color:red;">tar -cjvf /var/backup/priority.tar.bz2 priority/</span><br /> root@slackware:/home/luzar# <span style="color:red;">tar -czvf /var/backup/priority.tar.gz priority/</span><br /> root@slackware:/home/luzar# <span style="color:red;">ls -l /var/backup/</span><br /> total 1844<br /> -rw-r--r-- 1 root root 675840 2009-08-17 22:40 priority.tar<br /> -rw-r--r-- 1 root root 601202 2009-08-17 22:41 priority.tar.bz2<br /> -rw-r--r-- 1 root root 597244 2009-08-17 22:42 priority.tar.gz<br /> root@slackware:/home/luzar#<br /></code></td> </tr></table><h3>Linux incremental backup</h3> <p>All backup in the previous examples are full backup. The incremental backup means we only backup data(files and directories) updated after the full backup. This way, we can save both times and hard disk spaces. To make an incremental backup, we have to create a snapshot file during the full backup. Here is a complete command example:</p> <table><tr><td><code>root@slackware:/home/luzar# <span style="color:red;">tar -czvg /var/backup/tutorials-snapshot -f /var/backup/tutorials-full-backup.tar.gz tutorials/</span><br /></code></td> </tr></table><p>To backup into the external hard disk drive or usb drive, change backup target file to the correct drive mount point. For example, if we want to backup files to the external hard disk drive, mount the external hard disk and use tar command to create the backup:</p> <table><tr><td><code>root@slackware:/home/luzar# <span style="color:red;">mount /dev/sdc1 /media/</span><br /> root@slackware:/home/luzar# <span style="color:red;">tar -czvg /var/backup/tutorials-snapshot -f /media/tutorials-full-backup.tar.gz tutorials/</span><br /></code></td> </tr></table><p>To backup files into the cd or dvd, see the next section, <em>Backup Linux using dd command</em>.</p> <h2>Backup Linux using dd command utility</h2> <p>Linux dd command is another great backup utility. We have seen files and directories backup examples using tar command. With Linux dd command, you can save those backups in the cd or dvd. More important is that, we can backup the whole hard disk device or the whole system using dd command. Yes, Linux dd command can do that. Here is the meaning of dd as described in <em>info coreutils 'dd invocation'</em>:</p> <table><tr><td><code>`dd' copies a file (from standard input to standard output, by default)<br /> with a changeable I/O block size, while optionally performing<br /> conversions on it.<br /></code></td> </tr></table><p>The Linux dd command's usage format is pretty simple. Here is an example of dd command syntax:</p> <table><tr><td><code>root@slackware:~# <span style="color:red;">dd if=/dev/sda of=/dev/sdb bs=4096</span><br /></code></td> </tr></table><p>Here is the explanation:</p> <ul><li>dd - Convert and copy a file.</li><br /><li>if=/dev/sda - Input (source).</li><br /><li>of=/dev/sdb - Output.</li><br /><li>bs=4096 - Set both input and output block sizes to 4096 bytes.</li> </ul><p>Yes. That's the Linux dd command syntax you need to backup the first hard disk to the second hard disk.</p> <p>To backup the gunzip or bzip2 compressed file into the cd or dvd, you need to provide the correct dvd writer drive. Mount the drive if you need to. Here is the example command:</p> <table><tr><td><code>root@slackware:~# <span style="color:red;">dd if=/var/backup/tutorials-full-backup.tar.gz of=/dev/sr0</span><br /></code></td> </tr></table><p>That's it. Good luck!</p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/4" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux administration</a></div></div></div> Sun, 16 Aug 2009 15:18:14 +0000 jinlusuh 101 at http://basicconfig.com http://basicconfig.com/administration/linux-backup#comments Build and install mcrypt libmcrypt package for Slackware Linux http://basicconfig.com/administration/build-install-mcrypt-package-slackware-linux <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>The mcrypt is a Linux tool that allows user to use a wide range of encryption functions in Linux system. It replaces the previous crypt package and crypt command which is a well known command for encrypt and decrypt file. This tutorial is a guide on how to create Slackware package and install mcrypt and libmcrypt package in Slackware Linux. You need to install libmcrypt package before installing mrypt package. Otherwise, you'll get an error of missing mcrypt library.The easiest way to create a Slackware package is to get libmcrypt and mcrypt's slackbuild script from SlackBuild website. For the latest mcrypt and libmcrypt sources, you can download them from <a href="http://mcrypt.sourceforge.net/" target="_blank">Sourceforge website</a>.</p> <p>When you have mcrypt and libmcrypt in your computer (slackbuild scripts and sources), copy them to the proper build directory. Here is step by step example as your guide.</p> <h2>Build Slackware libmcrypt package</h2> <p>1) Change to a specific directory to build Slackware package. Extract libmcrypt.tar.gz, which contains slackbuild scrips that you download from Slackbuild website:</p> <table><tr><td><code>root@slackware:~# <span style="color:red;">cd /home/slackware/source/myslackware/</span><br /> root@slackware:/home/slackware/source/myslackware# <span style="color:red;">tar zxvf /home/slackware/build/libmcrypt/libmcrypt.tar.gz</span><br /></code></td> </tr></table><p>2) Copy <em>libmcrypt source</em> to the slackbuild extracted directory (libmcrypt):</p> <table><tr><td><code>root@slackware:/home/slackware/source/myslackware# <span style="color:red;">cp /home/slackware/source/libmcrypt-2.5.8.tar.bz2 libmcrypt/</span><br /></code></td> </tr></table><p>3) Change directory to the libmcrypt build directory and run <b>libmcrypt.SlackBuild</b> script:</p> <table><tr><td><code>root@slackware:/home/slackware/source/myslackware# <span style="color:red;">cd libmcrypt/</span><br /> root@slackware:/home/slackware/source/myslackware/libmcrypt# <span style="color:red;">./libmcrypt.SlackBuild</span><br /></code></td> </tr></table><p>The build package process only takes a few seconds. You can find the complete Slackware libmcrypt package result in the /tmp directory (default slackbuild configuration).</p> <h2>Install Slackware libmcrypt package</h2> <p>Change to the /tmp directory and run <em>installpkg</em> command to install libmcrypt package. You can keep a copy of Slackware libmcrypt package as a backup.</p> <table><tr><td><code>root@slackware:/home/slackware/source/myslackware/libmcrypt# <span style="color:red;">cd /tmp/</span><br /> root@slackware:/tmp# <span style="color:red;">installpkg libmcrypt-2.5.8-i486-1_SBo.tgz</span><br /> Installing package libmcrypt-2.5.8-i486-1_SBo...<br /> PACKAGE DESCRIPTION:<br /> libmcrypt: libmcrypt (encryption functions for MCrypt)<br /> libmcrypt:<br /> libmcrypt: mcrypt is a program for encrypting files or streams. It is intended<br /> libmcrypt: to be a replacement for the old UNIX crypt. It uses well-known and<br /> libmcrypt: well-tested algorithms like BLOWFISH, AES, ARCFOUR, CAST-128, and<br /> libmcrypt: more in several modes or operation.<br /> libmcrypt:<br /> libmcrypt: Homepage: http://freshmeat.net/projects/mcrypt/<br /> libmcrypt:<br /> Executing install script for libmcrypt-2.5.8-i486-1_SBo...<br /><br /> root@slackware:/tmp# <span style="color:red;">cp libmcrypt-2.5.8-i486-1_SBo.tgz /home/slackware/packages/</span><br /></code></td> </tr></table><h2>Build Slackware mcrypt package</h2> <p>The steps to build Slackware mcrypt package is the same as building libmcrypt package example above. First extract the mcrypt slackbuild script:</p> <table><tr><td><code>root@slackware:/tmp# <span style="color:red;">cd /home/slackware/source/myslackware/</span><br /> root@slackware:/home/slackware/source/myslackware# <span style="color:red;">tar zxvf /home/slackware/build/mcrypt/mcrypt.tar.gz</span><br /> mcrypt/<br /> mcrypt/README<br /> mcrypt/slack-desc<br /> mcrypt/mcrypt.SlackBuild<br /> mcrypt/mcrypt.info<br /></code></td> </tr></table><p>2) Copy mcrypt source to the slackbuild extracted directory:</p> <table><tr><td><code>root@slackware:/home/slackware/source/myslackware# <span style="color:red;">cp /home/slackware/source/mcrypt-2.6.8.tar.gz mcrypt/</span><br /></code></td> </tr></table><p>3) Change directory to the mcrypt build directory (extracted directory - mcrypt) and run <b>mcrypt.SlackBuild</b> script:</p> <table><tr><td><code>root@slackware:/home/slackware/source/myslackware# <span style="color:red;">cd mcrypt/</span><br /> root@slackware:/home/slackware/source/myslackware/mcrypt# <span style="color:red;">./mcrypt.SlackBuild</span><br /></code></td> </tr></table><p>If there is no error, then we can have the Slackware mcrypt package in the /tmp directory.</p> <h2>Install Slackware mcrypt package</h2> <p>As we did in the Slackware libmcrypt package installation above, change directory to /tmp directory and install the mcrypt package.</p> <table><tr><td><code>root@slackware:/home/slackware/source/myslackware/mcrypt# <span style="color:red;">cd /tmp</span><br /> root@slackware:/tmp# <span style="color:red;">installpkg mcrypt-2.6.8-i486-1_SBo.tgz</span><br /> Installing package mcrypt-2.6.8-i486-1_SBo...<br /> PACKAGE DESCRIPTION:<br /> mcrypt: mcrypt (simple encryption app)<br /> mcrypt:<br /> mcrypt: Mcrypt is a simple encryption program, intended to be<br /> mcrypt: a replacement for the old unix crypt.<br /> mcrypt:<br /> mcrypt: Home Page http://mcrypt.sourceforge.net<br /> mcrypt:<br /> Executing install script for mcrypt-2.6.8-i486-1_SBo...<br /><br /> root@slackware:/tmp#<br /></code></td> </tr></table><p>Keep a copy of Slackware mcrypt in your Slackware packages directory.</p> <table><tr><td><code>root@slackware:/tmp# <span style="color:red;">cp mcrypt-2.6.8-i486-1_SBo.tgz /home/slackware/packages/</span><br /></code></td> </tr></table><p>That's all. Here is the result package of the example above if you don't have time to build one for yourself. However, <a href="http://www.basicconfig.com">www.basicconfig.com</a> and the writer do not responsible for any harm done to your system. By using this package, you are agreed to the <a href="http://www.basicconfig.com/disclaimer" target="_blank">Web Site Agreement</a>. Use it at your own risk.</p> <p>Download Slackware 12.2 <a href="http://www.basicconfig.com/files/download/mcrypt-2.6.8-i486-1_SBo.tgz">mcrypt-2.6.8-i486-1_SBo.tgz</a> package.</p> <p>Download Slackware 12.2 <a href="http://www.basicconfig.com/files/download/libmcrypt-2.5.8-i486-1_SBo.tgz">libmcrypt-2.5.8-i486-1_SBo.tgz</a> package.</p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/4" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux administration</a></div></div></div> Wed, 08 Jul 2009 02:10:29 +0000 jinlusuh 106 at http://basicconfig.com http://basicconfig.com/administration/build-install-mcrypt-package-slackware-linux#comments Manage Linux software and packages http://basicconfig.com/administration/manage-linux-software-packages <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><h2>Manage Linux software and packages</h2> <p>Manage software and packages in Linux is one of the important part in Linux administration. Every Linux user has to keep software applications and programs in order, secure and safe. If we need to install software which is not included in official distribution packages (which means it does not officially support), we have to build the package ourselves. You can find some tutorials that might help you create and manage Linux software and packages here.</p> <p><a href="/linux/package">Linux administration - Linux software packages</a><br /> A Linux administration mostly relates Linux programs and Linux packages. This is a basic tutorial about Linux software package. Learn what contains in Linux software package and what happen when you install software package using Linux package management system.</p> <p><a href="/linux/pms">Linux administration - Linux package management system</a><br /> Find more information about Linux package management systems and take a closer look at Ubuntu dpkg and Slackware slackpkg here.</p> <p><a href="/linux/slackpkg">slackpkg - Slackware package management system</a><br /> Slackware finally includes a third party automated tool for managing its software packages. Check what else slackpkg can do in this tutorial.</p> <p><a href="/linux/ubuntu_package_management_system">apt-get - Ubuntu package management system</a><br /> Ubuntu which is based on Debian Linux, share the same great package management system as Debian such as dpkg, apt, aptitude and synaptic for x-window. In this tutorial, we are going to look closely into the popular apt package management system.</p> <br /> <p><a href="/administration/build-install-mcrypt-package-slackware-linux">Build and install mcrypt libmcrypt package for Slackware Linux</a><br /> The mcrypt is a Linux tool that allows user to use a wide range of encryption functions in Linux system. It replaces the previous crypt package and crypt command which is a well known command for encrypt and decrypt file. Check this tutorial out to learn how to build Slackware package and install libmcrypt and libmcrypt package in Slackware Linux.</p> <p>After finished building a Linux package, keep all related files in their respective directory in your work area (the build directory). You are going to need it again when upgrading software source. Also record all non-official software used in your Linux system.</p></div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/4" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux administration</a></div></div></div> Wed, 08 Jul 2009 01:56:46 +0000 jinlusuh 221 at http://basicconfig.com http://basicconfig.com/administration/manage-linux-software-packages#comments How to upgrade software or install security patches for Slackware Linux http://basicconfig.com/security/howto_upgrade_software_install_security_patch_slackware_linux <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>You can always use Slackware package management tool such as slackpkg to upgrade software or install security patches for your Slackware system. However, the ftp server mirrors took sometimes to update the latest software or security patches to their server. So the best way is to upgrade them yourself. This is an example on how to upgrade software or install security patches for Slackware Linux. First thing you need to do is to subscribe the Slackware security mailing list from Slackware website. To do this, visit <a href="http://www.slackware.com/lists/" target="_blank">Slackware mailing list</a> at Slackware official website. The picture below is an example of the current Slackware mailing list page:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/s/suarkuyak/security_patch01.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/s/suarkuyak/thumbs/security_patch01.png" alt="Slackware mailing list subscription page screenshot image" /></a>.</p> <p>It is easy to subscribe the Slackware security mailing list. You just have to email Slackware security team and mention what mailing list you are going to subscribe. The detail can be found in the Slackware mailing list subscription page. You'll start receiving security mailing list in your email when you successfully completed the mailing list subscription procedure.</p> <h2>Upgrade software or install security patches for Slackware Linux</h2> <p>You'll receive email when there is an upgrade or security patch for Slackware. See the example screenshot below:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/s/suarkuyak/security_patch02.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/s/suarkuyak/thumbs/security_patch02.png" alt="Slackware mailing list for security patches screenshot image" /></a></p> <p>This tutorial shows how to upgrade or patch Mozilla Firefox as an example. When there is a Slackware security notification in your email inbox, read the email and choose the correct update package version for your Slackware system. Click the link to download the package. Save the package in your Slackware user home directory. See the example screenshot below:</p> <p><a href="http://www.basicconfig.com/files/imagepicker/s/suarkuyak/security_patch03.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/s/suarkuyak/thumbs/security_patch03.png" alt="Slackware download security patch screenshot image" /></a></p> <p>The software download in progress. Wait until the process complete.</p> <p><a href="http://www.basicconfig.com/files/imagepicker/s/suarkuyak/security_patch04.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/s/suarkuyak/thumbs/security_patch04.png" alt="Software download progress screenshot image" /></a></p> <p>When the download finished, switch to command line terminal and login as root. Use Slackware upgradepkg command to upgrade the software. See the example below:</p> <table><tr><td><code>root@slackware:~# <span style="color:red;">upgradepkg /home/luzar/Desktop/mozilla-firefox-3.0.8-i686-1.tgz</span><br /><br /> +==============================================================================<br /> | Upgrading mozilla-firefox-3.0.7-i686-1 package using /home/luzar/Desktop/mozilla-firefox-3.0.8-i686-1.tgz<br /> +==============================================================================<br /><br /> Pre-installing package mozilla-firefox-3.0.8-i686-1...<br /><br /> Removing package /var/log/packages/mozilla-firefox-3.0.7-i686-1-upgraded-2009-03-28,16:12:35...<br /> - - -<br /> - - -<br /> Installing package mozilla-firefox-3.0.8-i686-1...<br /> PACKAGE DESCRIPTION:<br /> mozilla-firefox: mozilla-firefox (Mozilla Firefox Web browser)<br /> mozilla-firefox:<br /> mozilla-firefox: This project is a redesign of the Mozilla browser component written<br /> mozilla-firefox: using the XUL user interface language. Firefox empowers you to<br /> mozilla-firefox: browse faster, more safely and more efficiently than with any other<br /> mozilla-firefox: browser.<br /> mozilla-firefox:<br /> mozilla-firefox: Visit the Mozilla Firefox project online:<br /> mozilla-firefox: http://www.mozilla.org/projects/firefox/<br /> mozilla-firefox:<br /> Executing install script for mozilla-firefox-3.0.8-i686-1...<br /><br /> Package mozilla-firefox-3.0.7-i686-1 upgraded with new package /home/luzar/Desktop/mozilla-firefox-3.0.8-i686-1.tgz.<br /><br /> root@slackware:~#<br /></code></td> </tr></table><p>If you installed firefox plugins such as Adobe Flash player, you have to copy the plugins manually. When the Firefox installation is complete, change directory to /usr/lib/firefox-3.0.X/plugins, where X is firefox previous version. Copy the plugins to the new firefox directory. See the example below on how to do this:</p> <table><tr><td><code>root@slackware:~# <span style="color:red;">cd /usr/lib/firefox-3.0.7/plugins</span><br /> root@slackware:/usr/lib/firefox-3.0.7/plugins# <span style="color:red;">ls</span><br /> libflashplayer.so*<br /> root@slackware:/usr/lib/firefox-3.0.7/plugins# <span style="color:red;">cp * ../../firefox-3.0.8/plugins</span><br /></code></td> </tr></table><p>Now we can safely remove the old firefox version with <strong>rm -r</strong> command. See the example below:</p> <table><tr><td><code>root@slackware:/usr/lib/firefox-3.0.7/plugins# cd ../..<br /> root@slackware:/usr/lib# <span style="color:red;">ls -l | grep firefox</span><br /> lrwxrwxrwx 1 root root 13 2009-03-28 16:12 firefox -&gt; firefox-3.0.8/<br /> drwxr-xr-x 3 root root 4096 2009-03-28 16:12 firefox-3.0.7/<br /> drwxr-xr-x 14 root root 4096 2009-03-28 07:46 firefox-3.0.8/<br /> root@slackware:/usr/lib# <span style="color:red;">rm -r firefox-3.0.7/</span><br /> root@slackware:/usr/lib#<br /></code></td> </tr></table><p>Switch back to the kde x-window and start Firefox. The new version of Firefox started and it will check the compatibility for add-ons you installed in the previous version.</p> <p><a href="http://www.basicconfig.com/files/imagepicker/s/suarkuyak/security_patch05.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/s/suarkuyak/thumbs/security_patch05.png" alt="Firefox check compatibility screenshot image" /></a></p> <p>You'll get the latest Firefox version updated page which means you have successfully upgraded and patched the software.</p> <p><a href="http://www.basicconfig.com/files/imagepicker/s/suarkuyak/security_patch06.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/s/suarkuyak/thumbs/security_patch06.png" alt="Firefox successfull upgrade screenshot image" /></a><br /></p> <p>That's all. Upgrading and patching your Slackware is not a hard and complicated job as many people said. Make it a priority so that your Slackware system always secure.</p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/4" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux administration</a></div><div class="field-item odd" rel="dc:subject"><a href="/taxonomy/term/13" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux security</a></div></div></div> Sat, 28 Mar 2009 08:47:51 +0000 jinlusuh 141 at http://basicconfig.com http://basicconfig.com/security/howto_upgrade_software_install_security_patch_slackware_linux#comments Linux fdisk command - check hard disk partitions http://basicconfig.com/linux/linux_fdisk_command_check_hard_disk_partitions <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>You need to check your hard disk partitions from time to time to keep your eyes on hard disk usage and to make sure your hard disk is not out of space. Normally, the /home partition always running out of space if you setup Linux as a desktop. It's because you are using a normal user account to do your job and keep all data in /home/ directory. If you setup your Linux as a server, then give most of your hard disk space to the main partition (the mount point). For example, if you setup a web server, then, you should give /var directory a bigger space because all website data will be kept in /var/www/htdocs. That's why it's very important for you to properly plan the hard disk partition and give a proper hard disk space to every mount point (directory) depends on the needs.</p> <p>This tutorial is about how to check hard disk partitions from an already running Linux operating system using Linux fdisk command. If you are looking for fdisk tutorial to partition your hard disk, check the step by step partition guide with screenshots in <a href="/slackware_partitioning_fdisk">Slackware hard disk partition with fdisk</a> tutorial.</p> <h3>Check hard disk partitions with Linux fdisk command</h3> <p>The Linux fdisk command is a popular tool used to create hard disk partitions. Whoever installed Slackware Linux before should be familiar with Linux fdisk command. However, fdisk command also can be used to check hard disk partitions on the running Linux system. It's not only Slackware but you can find fdisk command in other Linux distributions too including Ubuntu. So this tutorial can be used to check hard disk space usage in any Linux distributions.</p> <p>You need root privileges to run fdisk, otherwise you will have a <i>command not found</i> message if you are using Slackware or <i>Cannot open /dev/sda</i> if you are using Ubuntu like in the example below:</p> <p>Invoke fdisk command without root privilege in Slackware Linux.</p> <table><tr><td><code>luzar@slackware:~$ <span style="color:red;">fdisk -l</span><br /> -bash: fdisk: command not found<br /></code></td> </tr></table><p>Invoke fdisk command without root privilege in Ubuntu Linux.</p> <table><tr><td><code>luzar@ubuntu:~$ <span style="color:red;">fdisk -l /dev/sda</span><br /> Cannot open /dev/sda<br /></code></td> </tr></table><p>You can use <b>su -</b> in Slackware and for Ubuntu, you can use <b>sudo</b> command to gain root privilege.</p> <p>Slackware example:</p> <table><tr><td><code>luzar@slackware:~$ <span style="color:red;">su -</span><br /> Password:<br /></code></td> </tr></table><p>Ubuntu example:</p> <table><tr><td><code>luzar@ubuntu:~$ <span style="color:red;">sudo fdisk -l /dev/sda</span><br /> [sudo] password for luzar:<br /><br /> Disk /dev/sda: 80.0 GB, 80026361856 bytes<br /> 255 heads, 63 sectors/track, 9729 cylinders<br /> Units = cylinders of 16065 * 512 = 8225280 bytes<br /> Disk identifier: 0xa403a403<br /><br /> Device Boot Start End Blocks Id System<br /> /dev/sda1 1 124 995998+ 82 Linux swap / Solaris<br /> /dev/sda2 5100 9728 37182442+ f W95 Ext'd (LBA)<br /> /dev/sda3 * 125 2556 19535040 83 Linux<br /> /dev/sda4 2557 5099 20426647+ 83 Linux<br /> /dev/sda5 5100 9728 37182411 7 HPFS/NTFS<br /><br /> Partition table entries are not in disk order<br /></code></td> </tr></table><p>Here is a part of manual page for Linux fdisk command. The important part is the <b>SYNOPSIS</b> which will be our reference in all the examples.</p> <table><tr><td><code>NAME<br /> fdisk - Partition table manipulator for Linux<br /><br /> SYNOPSIS<br /> fdisk [-u] [-b sectorsize] [-C cyls] [-H heads] [-S sects] device<br /><br /> fdisk -l [-u] [device ...]<br /><br /> fdisk -s partition ...<br /><br /> fdisk -v<br /><br /> DESCRIPTION<br /> Hard disks can be divided into one or more logical disks called parti-<br /> tions. This division is described in the partition table found in sec-<br /> tor 0 of the disk.<br /><br /> In the BSD world one talks about `disk slices' and a `disklabel'.<br /></code></td> </tr></table><p>We can use the second syntax in the synopsis above to check hard disk partitions in our current system. If we want to check the first hard disk in Linux system, issue fdisk command and the first hard disk. See example below:</p> <table><tr><td><code>root@slackware:~# <span style="color:red;">fdisk -l /dev/sda</span><br /><br /> Disk /dev/sda: 160.0 GB, 160041885696 bytes<br /> 255 heads, 63 sectors/track, 19457 cylinders<br /> Units = cylinders of 16065 * 512 = 8225280 bytes<br /> Disk identifier: 0xb262b262<br /><br /> Device Boot Start End Blocks Id System<br /> /dev/sda1 1 250 2008093+ 82 Linux swap<br /> /dev/sda2 251 3898 29302560 83 Linux<br /> /dev/sda3 3899 5115 9775552+ 83 Linux<br /> /dev/sda4 5116 19457 115202115 83 Linux<br /> root@slackware:~#<br /></code></td> </tr></table><p>The Linux <b>fdisk -l</b> option if invoked without giving specific hard disk, will print hard disk based on data found in the /proc/partitions.</p> <table><tr><td><code>root@slackware:~# <span style="color:red;">fdisk -l</span><br /><br /> Disk /dev/sda: 160.0 GB, 160041885696 bytes<br /> 255 heads, 63 sectors/track, 19457 cylinders<br /> Units = cylinders of 16065 * 512 = 8225280 bytes<br /> Disk identifier: 0xb262b262<br /><br /> Device Boot Start End Blocks Id System<br /> /dev/sda1 1 250 2008093+ 82 Linux swap<br /> /dev/sda2 251 3898 29302560 83 Linux<br /> /dev/sda3 3899 5115 9775552+ 83 Linux<br /> /dev/sda4 5116 19457 115202115 83 Linux<br /><br /> Disk /dev/sdb: 250.0 GB, 250059350016 bytes<br /> 255 heads, 63 sectors/track, 30401 cylinders<br /> Units = cylinders of 16065 * 512 = 8225280 bytes<br /> Disk identifier: 0xa5bbe44b<br /><br /> Device Boot Start End Blocks Id System<br /> /dev/sdb1 1 5099 40957686 7 HPFS/NTFS<br /> /dev/sdb2 5100 30400 203230282+ f W95 Ext'd (LBA)<br /> /dev/sdb5 5100 8923 30716248+ 7 HPFS/NTFS<br /> /dev/sdb6 8924 15297 51199123+ 7 HPFS/NTFS<br /> /dev/sdb7 15298 21671 51199123+ 7 HPFS/NTFS<br /> /dev/sdb8 21672 30400 70115661 7 HPFS/NTFS<br /> root@slackware:~#<br /></code></td> </tr></table><p>The result above shows all hard disk used in the current Linux system. If we want to print size in sector instead of cylinder, add -u option with the command. See example below:</p> <table><tr><td><code>root@slackware:~# <span style="color:red;">fdisk -l -u /dev/sda</span><br /><br /> Disk /dev/sda: 160.0 GB, 160041885696 bytes<br /> 255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors<br /> Units = sectors of 1 * 512 = 512 bytes<br /> Disk identifier: 0xb262b262<br /><br /> Device Boot Start End Blocks Id System<br /> /dev/sda1 63 4016249 2008093+ 82 Linux swap<br /> /dev/sda2 4016250 62621369 29302560 83 Linux<br /> /dev/sda3 62621370 82172474 9775552+ 83 Linux<br /> /dev/sda4 82172475 312576704 115202115 83 Linux<br /> root@slackware:~#<br /></code></td> </tr></table><p>We can display the size of partition in block using fdisk - s option. However we need to provide the partition name. See the example below:</p> <table><tr><td><code>root@slackware:~# <span style="color:red;">fdisk -s /dev/sda4</span><br /> 115202115<br /> root@slackware:~#<br /></code></td> </tr></table><p>That's all. Now you can check your hard disk usage with Linux fdisk command and take appropriate action before any partition runs out of space. Remember to check hard disk space regularly or you can write a script to let you know if a certain partition is reaching the limit.</p> <p>Back to <a href="/linux-basic-commands-tutorial">Linux basic commands main page.</a><a></a></p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/4" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux administration</a></div><div class="field-item odd" rel="dc:subject"><a href="/taxonomy/term/3" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux commands</a></div></div></div> Sun, 01 Mar 2009 08:40:26 +0000 jinlusuh 52 at http://basicconfig.com http://basicconfig.com/linux/linux_fdisk_command_check_hard_disk_partitions#comments Linux usermod command - Edit or modify Linux user account information http://basicconfig.com/linux/edit_modify_linux_user_account_information_usermod_command <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>As a Linux user, you must be able to manage user account in the Linux system. You need to know how to edit or modify a Linux user account information, such as change user password, assign groups to user account, remove group from the user account, change user login name, change password and many more. There is one command in Linux that can do all those stuff. That command is usermod command.</p> <p>If you view manual page for Linux usermod command, you can see that the function of usermod command almost the same as useradd command function. Below is a synopsis and description of Linux usermod command taken from the manual page:</p> <p>SYNOPSIS<br /> usermod [-c comment] [-d home_dir [-m]]<br /> [-e expire_date] [-f inactive_time]<br /> [-g initial_group] [-G group [,...]]<br /> [-l login_name] [-p passwd]<br /> [-s shell] [-u uid [-o]] [-L|-U] login </p> <p>DESCRIPTION </p> <p>The usermod command modifies the system account files to reflect the changes that are specified on the command line.</p> <p>As you can see from the synopsis, usermod command options offer the same task that you can do with useradd except usermod can't create a new user. Now let's see some examples on how to use usermod command to edit user account in Linux system.</p> <p>First, create a new user account that we can use to practice using Linux usermod command. In the example below, we use a user account called aura. View current id for aura with Linux id command. See example below:</p> <p>root@slackware:~# id aura<br /> uid=1001(aura) gid=100(users) groups=100(users)<br /> root@slackware:~#</p> <p>If we want to add a new group called vmware to aura, we can use usermod command with -G option. Be careful though, if you use usermod command with -G option alone, all other groups the user currently belongs to will be removed. So it's better to add -a with -G option if you want to add group or append new group. See how to do it with usermod command example below:</p> <p>Linux adding groups using usermod -G command example:</p> <p>root@slackware:~# usermod -G users,vmware aura<br /> root@slackware:~# id aura<br /> uid=1001(aura) gid=100(users) groups=100(users),102(vmware)<br /> root@slackware:~#</p> <p>Linux append group using usermod -aG command example:</p> <p>kkcj@ubuntu:/var/www/kkcj/sites/all/themes$ id kkcj<br /> uid=1000(kkcj) gid=1000(kkcj) groups=1000(kkcj),4(adm),20(dialout),24(cdrom),46(plugdev),112(lpadmin),120(admin),122(sambashare)<br /> kkcj@ubuntu:/var/www/kkcj/sites/all/themes$ sudo usermod -aG www-data kkcj<br /> sudo: unable to resolve host ubuntu<br /> [sudo] password for kkcj:<br /> kkcj@ubuntu:/var/www/kkcj/sites/all/themes$ id kkcj<br /> uid=1000(kkcj) gid=1000(kkcj) groups=1000(kkcj),4(adm),20(dialout),24(cdrom),33(www-data),46(plugdev),112(lpadmin),120(admin),122(sambashare)<br /> kkcj@ubuntu:/var/www/kkcj/sites/all/themes$ </p> <p>If we want to set expired date for aura user account, we can use usermod command with -e option. Provide the final date aura user account will be alive in YYYY-MM-DD format. A complete usermod command example with the correct option and syntax is shown below:</p> <p>root@slackware:~# usermod -e 2010-10-10 aura </p> <p>We can also set a brief comment about user account using usermod command with -c option. This comment can be seen when we view /etc/passwd file. The example below shows the syntax:</p> <p>root@slackware:~# usermod -c programmer aura<br /> root@slackware:~# less /etc/passwd | grep aura<br /> aura:x:1001:100:programmer:/home/aura:/bin/bash<br /> root@slackware:~#</p> <p>To change a user password with usermod command, we can use usermod -p command. We have to mention username who's password to be changed as in the usermod command example below:</p> <p>root@slackware:~# usermod -p New_Password aura </p> <p>If user aura is not login into the system, we can even change the login name.</p> <p>root@slackware:~# usermod -l auta aura </p> <p>We use usermod -l option in the example above to change login name for aura. So the username aura has been replaced with the new name auta. If we try to login with username aura now, the system will give login incorrect error because aura is not exist in the system.</p> <p>You can also put all usermod options that you want to use together in one line. Here is the example on how to do that:</p> <p>root@slackware:~# usermod -g users -d /home/aura -s /bin/csh -c programmer -p aurapasswd01 aura<br /> root@hitam:~#</p> <p>That covers almost everything you need to know about Linux usermod command and how to modify Linux user account.</p> <p>Back to <a href="/linux-basic-commands-tutorial">Linux basic commands main page.</a><a></a></p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/4" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux administration</a></div><div class="field-item odd" rel="dc:subject"><a href="/taxonomy/term/3" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux commands</a></div></div></div> Tue, 03 Feb 2009 13:58:23 +0000 jinlusuh 44 at http://basicconfig.com http://basicconfig.com/linux/edit_modify_linux_user_account_information_usermod_command#comments Introduction to Linux administration http://basicconfig.com/introduction_to_linux_administration <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>What is Linux administration? I didn't find any exact phrase for it. Linux administration always described as job that Linux system administrator does. If that so, then Linux administration means everything about Linux such as Linux installation, create and manage user accounts, permissions, ownerships, hardware, software and data management, Linux networking system, Linux system and network security, software installation, system upgrade, backup and so on. That's basically true. To do administration on Linux system, a user needs to know everything about Linux. However, we don't do Linux installation everyday. So I would say, Linux administration is an on going tasks to make Linux operating system works in proper order, safe and secure.</p> <p>This tutorial is the introduction of basic Linux administration tutorials available in basicconfig.com website.It supposes to give some exposure before user skip to the administration section where the real deal is. Let's take a brief description about all Linux administration tasks mention above. I am not going to exposed the Linux system administrator's job. That's the big scope. Rather, the system administration that average Linux users need to know and implement on their system.</p> <p>You probably know about Linux installation process and procedure. In reality, we don't install Linux everyday as I already mentioned but we do upgrade the system occasionally. The Linux administration really starts after the system is up and running. And probably the first thing we do is creating a new user account. It's a good practice not to use root account in daily use. That's why we need to create a normal user account and use su(switch user) to gain root privilege when we need to do system administration task.</p> <p>If you have several other users in the system, then, the administration task normally would be creating user account, change password, disabling and removing user account. Other administration task maybe you need to set groups, file and directory permissions. </p> <p>In a network environment, such as home networking or small office network, basically you have to setup network printer, file sharing server and Internet access. These tasks involve many processes and system administrations you need to do frequently. For example, you need to setup and manage network, system monitoring and software updates. Perhaps make regular backup too.</p> <p>The most important administration task every Linux user need to do, whether in a network environment or standalone is to monitor Linux system. Monitoring disk usage frequently and setting up disk quota is recommended.</p> <p>If you are ready to do administration tasks in your Linux, check out the basic Linux administration archive in <a href="/linuxadmin">Linux administration tutorials for beginner</a>.</p></div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/4" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux administration</a></div><div class="field-item odd" rel="dc:subject"><a href="/taxonomy/term/7" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux tutorials</a></div></div></div> Sun, 21 Dec 2008 07:38:22 +0000 jinlusuh 132 at http://basicconfig.com http://basicconfig.com/introduction_to_linux_administration#comments apt-get - Ubuntu package management system http://basicconfig.com/linux/ubuntu_package_management_system <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Ubuntu which is based on Debian Linux, share the same great package management system as Debian such as dpkg, apt, aptitude and synaptic for x-window. In Ubuntu, apt is more like the official package management system at the moment. However, users still have a choice and can freely use whatever package management system they are comfortable with.</p> <p>In this tutorial, we are going to look closely into the popular apt package management system.</p> <h2>Ubuntu apt package manager</h2> <p><b>apt</b> means Advanced Package Tool, is a software package manager use by Ubuntu and other Debian-based Linux distributions' users around the world. The apt-get which is apt package handling utility is a command line interface for update, upgrade, install and remove software packages. So, for package management system in Ubuntu, what a user needs is <b>apt-get</b>. Lets take a closer look at apt-get manual page:</p> <table><tr><td><code>NAME<br /> apt-get - APT package handling utility -- command-line interface<br /><br /> SYNOPSIS<br /> apt-get [-hvs] [-o=config string] [-c=file] {[update] | [upgrade] |<br /> [dselect-upgrade] | [install pkg...] | [remove pkg...] |<br /> [purge pkg...] | [source pkg...] | [build-dep pkg...] | [check]<br /> | [clean] | [autoclean] | [autoremove]}<br /><br /> DESCRIPTION<br /> apt-get is the command-line tool for handling packages, and may be<br /> considered the user´s "back-end" to other tools using the APT library.<br /> Several "front-end" interfaces exist, such as dselect(8), aptitude,<br /> synaptic, gnome-apt and wajig.<br /></code></td> </tr></table><p>apt-get cannot be used alone without options except for -p or --help. You need to specify what do you want apt-get to do such as update, upgrade, install or remove package. Here are apt-get options that normally used with apt-get:</p> <ul><li>update - update is used to resynchronize the package index files from their sources.<br /> The indexes of available packages are fetched from the location(s) specified<br /> in /etc/apt/sources.list. </li> <li>upgrade - upgrade is used to install the newest versions of all packages currently<br /> installed on the system from the sources enumerated in /etc/apt/sources.list. </li> <li>install - install is followed by one or more packages desired for installation.<br /> Each package is a package name, not a fully qualified name with a version.</li> <li>remove - remove is identical to install except that packages are removed instead<br /> of installed.</li> </ul><p>There are other options available to use with apt-get. The options above are what user normally need to manage software packages in Ubuntu system. You can check apt-get manual page for more options if you need that later. Use the command <b>man apt-get</b> to open apt-get manual page.</p> <h2>How to use Ubuntu apt-get?</h2> <p>Normally, we would use <b>apt-get update</b> command first to synchronize software packages installed in our system with the latest software packages in Ubuntu sources server. Software packages is not being installed. The apt-get update only compare system packages with the latest sources from the server. Because installing software packages need root privilege, you need to add <b>sudo</b> command before apt-get. Here is an example in real situation:</p> <table><tr><td><code>luzar@ubuntu:~$ <span style="color:red;">sudo apt-get update</span><br /> [sudo] password for luzar:<br /> Hit http://security.ubuntu.com hardy-security Release.gpg<br /> Ign http://security.ubuntu.com hardy-security/main Translation-en_US<br /> Hit http://us.archive.ubuntu.com hardy Release.gpg<br /> Ign http://us.archive.ubuntu.com hardy/main Translation-en_US<br /> ...<br /> ...<br /> ...<br /> Reading package lists... Done<br /> luzar@ubuntu:~$<br /></code></td> </tr></table><p>We can update the latest packages list database with <b>apt-get upgrade</b> command.</p> <table><tr><td><code>luzar@ubuntu:~$ <span style="color:red;">sudo apt-get upgrade</span><br /> Reading package lists... Done<br /> Building dependency tree<br /> Reading state information... Done<br /> The following packages have been kept back:<br /> linux-image-server linux-server<br /> 0 upgraded, 0 newly installed, 0 to remove and <b>2 not upgraded.</b><br /><br /> luzar@ubuntu:~$<br /></code></td> </tr></table><p>From the apt-get upgrade example above, in the bottom sentence the <b>2 not upgraded</b> has been intentionally bold. Just to notify you that sometimes you'd see this kind of result. The update is available but your Ubuntu system does not install or upgrade it. To make Ubuntu install or upgrade the updates, you have to use <b>dist-upgrade</b> option instead of <b>upgrade</b> alone. Here is the example:</p> <table><tr><td><code>luzar@ubuntu:~$ <span style="color:red;">sudo apt-get dist-upgrade</span><br /> Reading package lists... Done<br /> Building dependency tree<br /> Reading state information... Done<br /> Calculating upgrade... Done<br /> The following NEW packages will be installed:<br /><span style="color:blue;">linux-image-2.6.27-9-server</span><br /> The following packages will be upgraded:<br /><span style="color:blue;">linux-image-server linux-server</span><br /> 2 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.<br /> Need to get 23.5MB of archives.<br /> After this operation, 94.5MB of additional disk space will be used.<br /> Do you want to continue [Y/n]? Y<br /></code></td> </tr></table><p>Normally, this involves an upgrade of the system's kernel as highlighted in blue colored text in the example above. Answer <b>Y</b> to download and upgrade the new updates.</p> <table><tr><td><code>Get:1 http://us.archive.ubuntu.com intrepid-updates/main<br /> linux-image-2.6.27-9-server 2.6.27-9.19 [23.5MB]<br /> 0% [1 linux-image-2.6.27-9-server 139910/23.5MB 0%] 3733B/s 1h44min28s<br /></code></td> </tr></table><p>As you can see, apt-get is downloading a <em>Linux image</em> which the size is 23.5MB before it can upgrade the Ubuntu system. This is going to take a while. So, if you have a job to, better switch to different command line terminal.</p> <p>To install a new software packages with Ubuntu apt-get, we can use the <b>install</b> option. The syntax or command format is <b>apt-get install software_package</b>. Replace software_package with the name of software you want to install. See the example below:</p> <table><tr><td><code>luzar@ubuntu:~$ <span style="color:red;">sudo apt-get install nmap</span><br /> Reading package lists... Done<br /> Building dependency tree<br /> Reading state information... Done<br /> ...<br /> ...<br /> ...<br /> Unpacking nmap (from .../archives/nmap_4.53-3_i386.deb) ...<br /> Setting up nmap (4.53-3) ...<br /><br /> luzar@ubuntu:~$<br /></code></td> </tr></table><p>If we need to remove software from Ubuntu system, we can use apt-get <b>remove</b> option. The complete command syntax is <b>apt-get remove software_package</b>. Change the software_package with the name of the package you want to remove. See the example below:</p> <table><tr><td><code>luzar@ubuntu:~$ <span style="color:red;">sudo apt-get remove nmap</span><br /> Reading package lists... Done<br /> Building dependency tree<br /> Reading state information... Done<br /> The following packages were automatically installed and are no longer required:<br /> libdns32 libisc32<br /> Use 'apt-get autoremove' to remove them.<br /> The following packages will be REMOVED:<br /> nmap<br /> 0 upgraded, 0 newly installed, 1 to remove and 2 not upgraded.<br /> After this operation, 3506kB disk space will be freed.<br /> Do you want to continue [Y/n]? <span style="color:red;">Y</span><br /> (Reading database ... 19065 files and directories currently installed.)<br /> Removing nmap ...<br /> luzar@ubuntu:~$<br /></code></td> </tr></table><p>That's all the basics on how to use Ubuntu package management system. Hopefully, all apt-get examples above make sense and help you understand how to install and update packages in Ubuntu command line terminal. Apt-get has been (and still) a very powerful package management system for Ubuntu. You can continue using apt-get if you are comfortable with it or you can check <b>aptitude</b> which is the advanced package management system based on apt-get.</p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/4" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux administration</a></div></div></div> Sun, 23 Nov 2008 16:28:31 +0000 jinlusuh 105 at http://basicconfig.com http://basicconfig.com/linux/ubuntu_package_management_system#comments slackpkg - Slackware package management system http://basicconfig.com/linux/slackpkg <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Slackware has an automated tool for managing its software packages in its official package. The one we are talking here is slackpkg. Although it's not included in default installation, slackpkg can be install later after you finish the standard installation. Slackpkg can be found in /extra directory in the official dvd installer.</p> <p>Slackware, which is the oldest Linux distribution available today, however is less popular for beginner compared to other major distributions (currently number 13 and has 499 hits per day in distrowatch.com). Although Slackware has proved to be a stable and secure Linux server, it's only appreciated by it's loyal followers. Maybe because Slackware itself is unique. Slackware has it's own personality. If you ask true slackers, one of the reason they love Slackware is because it is the only distribution that still maintain the originality of Linux and it's nostalgic. We can see that Slackware still maintains lilo and fdisk in its official release. Most tasks in Slackware have to be done manually too and that includes managing software packages. Maybe that's why Linux beginner is avoiding Slackware. Well, that's only my personal opinion. Don't forget that everything depend on personal preferences. User can have what they want, how they want it to be. And that reason has been the biggest asset of Linux as you can see many Linux distributions available and they have their own followers.</p> <p>That's quite a long shabby introduction. Let's see a piece of information about slackpkg in the manual page:</p> <table><tr><td><code>NAME<br /> slackpkg - Automated tool for managing Slackware Linux packages<br /><br /> SYNOPSIS<br /> slackpkg [OPTIONS] {install|remove|search|upgrade|reinstall|blacklist}<br /> { PATTERN | FILE }<br /><br /> slackpkg [OPTIONS] info PACKAGE<br /><br /> slackpkg [OPTIONS] update [gpg]<br /><br /> slackpkg [OPTIONS] (clean-system|upgrade-all|install-new|new-config)<br /><br /> DESCRIPTION<br /> Slackpkg is a tool for those who want to easily install or upgrade<br /> packages via the network. With slackpkg, you can have a minimal<br /> installation of Slackware Linux and install/upgrade only those packages<br /> you need most.<br /></code></td> </tr></table><p>As you can see from the synopsis above, slackpkg is doing the same job as pkgtool, which is to install, remove and upgrade packages. Actually slackpkg did use pkgtool to do the base job plus it enhanced the job one step and provides automatic update via the Internet. Many Slackware system administrator is going to love Slackware for this feature (Pat loves slackpkg too and he mentioned it in his email). </p> <p>Here are the complete slackpkg options with descriptions: </p> <ul><li>update gpg - Update Slackware GPG's key. The GPG key doesn't change. This should be a "one time" command </li> <li>update - Update will download the latest package lists from a Slackware mirror </li> <li>search <i>packagename</i> - Search the official Slackware packages for any file in the Slackware distribution.</li> <li>install <i>packagename</i> - Package will be downloaded and installed.</li> <li>upgrade <i>packagename</i> - Installs the most recent official version of the specified package.</li> <li>reinstall <i>packagename</i> - Reinstall the same version of a package that is currently installed (in case of package corrupted).</li> <li>remove <i>packagename</i> - Remove certain installed packages.</li> <li>clean-system - Removes all of the packages that don't belong to a standard Slackware installation. </li> <li>upgrade-all - Upgrades every package installed on the system to the version in the official Slackware tree.</li> <li>install-new - Installs any new packages that are added to the official Slackware package set.</li> <li>new-config - Searches for .new configuration files and ask the user what to do with those files.</li> <li>blacklist <i>packagename</i> - Blacklisted packages will not be installed, upgraded, or removed by slackpkg.</li> <li>download <i>packagename</i>- Download the packages, but do not install them.</li> <li>info <i>packagename</i> - Prints information about the package(s).</li> </ul><p>The first thing you need to do before using slackpkg is to choose and enable a mirror in it's configuration file. Use your favorite text editor and edit /etc/slackpkg/mirrors file. Here is an example using vim editor:</p> <table><tr><td><code>root@slackware:~# <span style="color:red;">vim /etc/slackpkg/mirrors</span><br /><br /> # mirrors - List of Slackware Linux mirrors.<br /> #<br /> # SlackPkg - An Automated packaging tool for Slackware Linux<br /> # Copyright (C) 2003,2004,2005,2006,2007 Roberto F. Batista, Evaldo Gardenali<br /> #<br /> ...<br /> ...<br /> ...<br /> #----------------------------------------------------------------<br /> # Slackware 12.1<br /> #----------------------------------------------------------------<br /> #Australia, 155Mbit<br /> #http://ftp.planetmirror.com/pub/slackware/slackware-12.1/<br /> #ftp://ftp.planetmirror.com/pub/slackware/slackware-12.1/<br /> #Australia, 250Mbit<br /> #http://mirror.pacific.net.au/linux/slackware/slackware-12.1/<br /> #ftp://mirror.pacific.net.au/linux/slackware/slackware-12.1/<br /> #Australia, 45mbit, 100Mbit<br /> #ftp://mirror.veridas.net/pub/slackware/slackware-12.1/<br /></code></td> </tr></table><p>Choose a mirror close to your city. Remove # to enable that mirror. Save and exit.</p> <p>If you just finished the installation and already has Internet connection, it's time to update your Slackware. Number 1 step is to run <b>slackpkg update</b>. See example below:</p> <table><tr><td><code>root@slackware:~# <span style="color:red;">slackpkg update</span><br /><br /> Downloading /GPG-KEY...<br /> - - - -<br /> - - - -<br /> - - - -<br /> HTTP request sent, awaiting response... 200 OK<br /> Length: 1565 (1.5K) [text/plain]<br /> Saving to: `/tmp/slackpkg.AmK8eg/gpgkey'<br /><br /> 100%[======================================&gt;] 1,565 --.-K/s in 0s<br /><br /> 2008-11-15 01:49:59 (145 MB/s) - `/tmp/slackpkg.AmK8eg/gpgkey' saved [1565/1565]<br /> ...<br /> ...<br /> ...<br /> 2008-11-15 02:01:10 (111 MB/s) - `/tmp/slackpkg.AmK8eg/testing-PACKAGES.TXT' saved [914/914]<br /><br /> Formatting lists to slackpkg style...<br /> Package List<br /> Package descriptions<br /><br /> root@slackware:~#<br /></code></td> </tr></table><p>The second step is to run <b>slackpkg update gpg</b> command.</p> <table><tr><td><code>root@slackware:~# <span style="color:red;">slackpkg update gpg</span><br /></code></td> </tr></table><p>The third step is running <b>slackpkg install-new</b></p> <table><tr><td><code>root@slackware:~# <span style="color:red;">slackpkg install-new</span><br /> root@slackware:~# slackpkg install-new<br /><br /> Looking for NEW packages to install. Please wait... DONE<br /><br /> No packages match the pattern for install. Try:<br /><br /> /usr/sbin/slackpkg upgrade|reinstall<br /><br /> root@slackware:~#<br /></code></td> </tr></table><p>The next step is running <b>slackpkg upgrade-all</b> and select which software you want to update. See the example below on how to run the command:</p> <table><tr><td><code>root@slackware:~# <span style="color:red;">slackpkg upgrade-all</span><br /></code></td> </tr></table><p>Sometimes there are many software and applications need to be upgraded including software security patches as you can see in the screenshot example below. Since the command option is upgrade all, you should upgrade all the patches for Slackware security and stability. If you have a slow Internet connection, you can deselect some upgrades and run 'slackpkg upgrade-all' command again when the first upgrade is finished.</p> <p><a href="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/upgradeall.png" title="Image" target="_blank"><img src="http://www.basicconfig.com/files/imagepicker/j/jinlusuh/thumbs/upgradeall.png" alt="Slackware slackpkg upgrade-all screenshot" /></a></p> <p>The final step is running <b>slackpkg clean-system</b> </p> <table><tr><td><code>root@slackware:~# <span style="color:red;">slackpkg clean-system</span><br /></code></td> </tr></table><h2>Troubleshooting slackpkg</h2> <p>There is no big problem and there is no fatal error I had while using slackpkg. The one that maybe hits you is <em>Error downloading from <a href="ftp://mirror.name.domain/pub/slackware/slackware-12.2/">ftp://mirror.name.domain/pub/slackware/slackware-12.2/</a>. Please, check your mirror and try again</em>. That's only a small problem. Change the mirror and it fixed. Below is the example about this:</p> <table><tr><td><code>root@slackware:~# slackpkg update<br /><br /> Updating the package lists...<br /> Downloading...<br /> Downloading ChangeLog.txt...<br /> --2009-07-15 20:17:53-- ftp://mirror.name.domain/pub/slackware/slackware-12.2/ChangeLog.txt<br /> =&gt; `/tmp/slackpkg.ZYk2hG/ChangeLog.txt'<br /> Resolving mirror.name.domain... 123.45.67.89<br /> Connecting to mirror.name.domain|123.45.67.89|:21... connected.<br /> Logging in as anonymous ... Logged in!<br /> ==&gt; SYST ... done. ==&gt; PWD ... done.<br /> ==&gt; TYPE I ... done. ==&gt; CWD /pub/slackware/slackware-12.2 ...<br /> No such directory `pub/slackware/slackware-12.2'.<br /><br /> Error downloading from ftp://mirror.name.domain/pub/slackware/slackware-12.2/.<br /> Please, check your mirror and try again.<br /><br /> root@slackware:~#<br /></code></td> </tr></table><p>What you need to do is to open the slackpkg mirrors' file with text editor and change to different mirror. See example below:</p> <table><tr><td><code>root@slackware:~# <span style="color:red;">vim /etc/slackpkg/mirrors</span><br /></code></td> </tr></table><p>Comment(insert #) the current mirror and choose a new mirror(remove #):</p> <table><tr><td><code>#<br /> #----------------------------------------------------------------<br /> # Slackware 12.2<br /> #----------------------------------------------------------------<br /> #Australia, 155Mbit<br /> #http://ftp.planetmirror.com/pub/slackware/slackware-12.2/<br /><span style="color:red;">ftp://ftp.planetmirror.com/pub/slackware/slackware-12.2/</span> --&gt; Active mirror<br /> #Australia, 250Mbit<br /> #http://mirror.pacific.net.au/linux/slackware/slackware-12.2/<br /> #ftp://mirror.pacific.net.au/linux/slackware/slackware-12.2/<br /> #Australia, 45mbit, 100Mbit<br /> #ftp://mirror.veridas.net/pub/slackware/slackware-12.2/<br /> ...<br /> ...<br /></code></td> </tr></table><p>Try run <em>slackpkg update</em> again after you change to a new mirror. If your problem persist, change to another mirror until you got the one that's working.</p> <h2>Other issues</h2> <p>For a new Slackware user (or if you are a Ubuntu user before), there is a small problem if you are upgrading Linux kernel automatically using slackpkg. If you are using nvidia driver, upgrading the Linux kernel would give you nvidia driver error when you are trying to enter x-window. This is because the nvidia driver is a kernel module, so every time you upgrade the Linux kernel, you need to recompile the nvidia driver.</p> <p>Another issue is, when recompile the nvidia driver, a new xorg.conf file is created, so all configurations you set previously such as enable mouse scroll and monitor size setting are gone. Well, the file is not totally removed from the system but it has been saved as a backup file called 'xorg.conf.backup'. You can copy your previous configurations and the problem solved.</p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/4" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux administration</a></div></div></div> Fri, 14 Nov 2008 18:29:27 +0000 jinlusuh 104 at http://basicconfig.com http://basicconfig.com/linux/slackpkg#comments Introduction to Linux software packages http://basicconfig.com/linux/package <!-- google_ad_section_start --><div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>You have already come across Linux packages during the installation stage. Remember you were asked to choose packages you want to install in your Linux? Well, at that time, you may be clueless about what Linux packages do you need. However after some times playing with Linux, you may need to install new programs or perhaps network or security tools. Maybe you realize that you need to upgrade or patch some software because security reason. Now it’s the time you look for software package.</p> <p>A Linux software package is a group of programs that has been compiled in an archive format and ready to be installed in your Linux system by package management system. It contains meta-information such as a package description, version, dependencies, vendor and checksum. The program that comes with Linux official distribution is part of software packages. Normally, to install program in Linux, you have to configure the source, compile it, and install the source code step by step. With Linux software packages, system administrator’s job is made easier, quick and convenient. </p> <h2>Slackware software packages</h2> <p>Slackware is one of the major Linux distributions started over 14 years ago. Its package concept is similar to the Unix variants which offer simplicity and robust. Although Slackware uses tarballs format which is a tar archive and gunzip format, it is a binary package not a source code. Here is a made up programs and example of exploded Slackware tarball package : </p> <p>./<br /> usr/<br /> usr/bin/<br /> usr/bin/btsethttpseeds.py<br /> usr/bin/btlaunchmanycurses.py<br /> usr/doc/<br /> usr/doc/BitTornado-0.3.18/<br /> usr/doc/BitTornado-0.3.18/FAQ.txt<br /> usr/lib/<br /> usr/lib/python2.5/<br /> usr/lib/python2.5/site-packages/<br /> usr/lib/python2.5/site-packages/BitTornado/<br /> usr/lib/python2.5/site-packages/BitTornado/BT1/<br /> usr/lib/python2.5/site-packages/BitTornado/BT1/DownloaderFeedback.py<br /> install/<br /> install/doinst.sh<br /> install/slack-desc</p> <p>Some of the list of BitTornado package above has been removed. The complete exploded file is a long list and it is not necessary because this is just to show what’s inside the Slackware tarball package. </p> <p>The full package's name which come with the official distribution cd/dvd looks like this: </p> <p>slackpkg-2.70.3-noarch-2. </p> </div></div></div><!-- google_ad_section_end --><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above"><div class="field-label">Tags:&nbsp;</div><div class="field-items"><div class="field-item even" rel="dc:subject"><a href="/taxonomy/term/4" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux administration</a></div><div class="field-item odd" rel="dc:subject"><a href="/taxonomy/term/7" typeof="skos:Concept" property="rdfs:label skos:prefLabel" datatype="">linux tutorials</a></div></div></div> Thu, 25 Sep 2008 12:07:35 +0000 jinlusuh 102 at http://basicconfig.com http://basicconfig.com/linux/package#comments