≡ Menu

package management

Linux Is Supposed To Be Easy?

Linux is extremely powerful, robust and flexible, which means it must have a significant amount of complexity. Do you think I learnt everything in a day? I don't know who told you Linux was easy, many times other people make it harder than it has to be by thinking they need to understand everything at once.

Some Preliminary Advice

Some recommendations I would give you before you began with Linux:

  • Take it easy. Frustration makes things worse for everyone.
  • Never try anything for the first time in a production environment. Always use test environment. For example, iptables firewall or complex security configurations. Always use a test computer or virtual machine to test the various applications, configurations and settings. It will save lots of time. Recommended virtualization software - Vmware or Xen or VirtualBox
  • Another option is start your journey with with LiveCDs. See the list of all Linux, BSD, LiveCDs and LiveDVDs here.
  • Always refer to hardware compatible list (HCL) and kernel source documentation directory (/usr/src/linux/Documentation/) to check your hardware compatibility.
  • Learn to read and search command man pages and vi / vim text editor. Type vimtutor at a shell prompt. The Vimtutor is useful for people that want to learn their first Vim commands.
  • Don't try to set or create ultra secure servers / services on your first shot. Mess with test system couple times i.e. play for a while until you understand everything. Don't stress out for the perfect solution, it will slow you down.
  • Stay away from advanced stuff until you learn the basic stuff like, ssh, vi text editor, directory structure, log files, searching and greping files, network configuration, package management, patch management, troubleshooting techniques using host, ping, route, ifconfig and other tools.
  • Learn regex and text utilities such as sed, awk, grep and others. It will save lots of time in a long run.
  • Learn to customize your own login environment. This will give you good idea about many configuration options such as ftp, vi, Gnome, Kde, GUI tools and much more. Get a good Linux book, it will be a big help (see below for recommend books).
  • Don't hesitate to ask your questions on the forums and mailing lists. Also help others in the forums when you can. You will be supervised to find out how explaining stuff to someone else helps you understand it better.
  • Learn to automate stuff using shell scripts.
  • When you run into a problem with a configuration, make sure you read:
    • The man pages
    • The info pages
    • Read package README.txt, INSTALL.txt and other files stored in a current directory or /usr/share/doc/package-name directory.
  • Use google / yahoo search engines to do several searches with different terms. My personal experience you may get answer in the forums / websites / mailing lists. Only rarely have my problems not already been answered in the forums.
  • Subscribe to security alert mailing lists.
  • Learn to compile packages using make, configure and other build tools.
  • Once you learnt terminology and basic things, start configuring basic services such as Apache. They idea is simple start by getting something up and visible. Take a time to explore stuff and get comfortable with each service / servers. Always configure one service at a time and get familiar with them one at a time.
  • Don't compare Windows utilities / software with equivalent Linux software. Windows is not Linux or vise versa.
  • Don't try to replace Windows desktop with Linux desktop. Windows desktop has better applications stack. Similarly, Windows can't replace Linux. You need to consider various factors before migrating from Windows systems.
  • Gather experience.
  • Finally, always ignore flame wars such as 'vim vs emacs editor' or 'BSD vs Linux'.

Good Luck!

References / Recommend Readings:

Download of the day: Fedora 9 CD / DVD ISO

Update: Nov-25,2008: Fedora Linux 10 has been related and available for download.

Fedora Linux version 9 has been released and available for download ( jump to download link ). The Fedora Project is a Red Hat sponsored by Red Hat and guided by community and contributing members.

New in Fedora 9

This release includes many new features and software such as GNOME 2.22, KDE 4.0.3, Firefox 3 beta 5, PackageKit ( cross-distribution package management solution ), OpenJDK (Open Source Java version), SELinux confined web browser, Upstart init daemon, Xen virtualization, and many more cutting edge features.

(Fig.01 Fedora Linux 9 Desktop - Click to enlarge image)

Fedora 9 Download

You can download Fedora via the web/ftp server or via BitTorrent (recommended).

Fedora 9 DVD ISO download

Fedora download: Fedora 9 Live CD ISO download

  • Use 32 bit Live CD (691M), if internet connection is slow or you just want to see how Fedora works. You can install fedora from Live cd.

Fedora 9 DVD ISO BitTorrent download

Sun touts big plans for OpenSolaris as first release nears

Sun is planning to release OpenSolaris soon with better package management, GNU userland tools and fast release cycle just like Fedora or Ubuntu Linux. Sun's Ian Murdock gave a presentation about OpenSolaris at LugRadio Live this past weekend. He explained how OpenSolaris reflects Sun's changing platform strategy and also discussed some of the technical attributes that differentiate OpenSolaris from Linux.

The first steps towards this goal have been realized in the latest developer preview release of OpenSolaris which offers a complete GNOME desktop environment as well as a package system and an installer. The final release will take place in May and the distribution will adhere to a six-month release cycle, just like Fedora and Ubuntu.

Few suggestion...

  • Get Gnome desktop instead of Sun branded Java desktop. Please keep your corporate color away from my desktop.
  • Currently OpenSolaris does not support virtual console
  • Get complete package collection; I want something like FreeBSD ports or GNU/Debian APT repos.
  • Get pulse-audio or may be ALSA sound support

=> Sun touts big plans for OpenSolaris as first release nears

Fedora Linux 9 Beta Released

Fedora Linux 9 beta has been released and available for download. Some highlights of Fedora 9 Beta:

=> GNOME 2.22, with new features like a helpful world time clock, better file system performance, security improvements, power management at the login screen, the ability to dynamically configure displays, better Bluetooth integration, improved podcast support, and many other enhancements

=> KDE 4.0.2, which includes a brand new desktop and panel with many new concepts, integrated desktop search, a brand new visual style called Oxygen, a new multimedia API called Phonon, and a new hardware integration framework called Solid -- all integrated by Fedora's KDE SIG

=> Firefox 3 Beta 5, featuring a native look and feel, desktop integration, the new Places that replaces bookmarks, and a reworked address bar

=> Support for resizing ext2, ext3 and NTFS partitions during install

=> Support for creating and installing to encrypted filesystems

=>PackageKit, a cross-distribution package management solution with a complete yum backend, designed to unify different distributions' software management with the latest technologies

=> Kernel 2.6.25-rc5 etc

Fedora 9 (Sulphur) Beta Version ScreenShot
(Fig. 01: Fedora 9 Desktop)

Download Fedora 9 Beta Software

To download, visit:

How to: Linux reset the permissions of the installed rpm packages with –setperms option

Sometime by mistakes all file permissions get changed and you need to restore file permission. For example a shell script or some sort of corruption could change the permissions for packages (installed files), it may be necessary to reset them.

For example a long time ago my shell script run chmod and chown commands on /usr and changed the permission. Luckily rpm command can reset package permission. Sun Solaris pkg command and IBM can also reset permissions.

Please note that this troubleshooting tip is about resetting the permission of the installed package files and not about end users files stored in /home directory.

RPM syntax to fix permission

To set permissions of files in a package, enter:

rpm --setperms {packagename}

RPM syntax to fix file ownership

To set user/group ownership of files in a package, enter:

rpm --setugids {packagename}

List installed package

You can list all installed package with rpm -qa command:
rpm -qa


List individual package file permission

You can list individual installed package file permission using following shell for loop (for example list file permission for zip package):
for f in $(rpm -ql zip); do ls -l $f; done

-rwxr-xr-x 1 root root 75308 Jan  9  2007 /usr/bin/zip
-rwxr-xr-x 1 root root 31264 Jan  9  2007 /usr/bin/zipcloak
-rwxr-xr-x 1 root root 28336 Jan  9  2007 /usr/bin/zipnote
-rwxr-xr-x 1 root root 30608 Jan  9  2007 /usr/bin/zipsplit
total 188
-rw-r--r-- 1 root root  3395 Dec 14  1996 algorith.txt
-rw-r--r-- 1 root root   356 Dec 14  1996 BUGS
-rw-r--r-- 1 root root 60168 Mar  9  2005 CHANGES
-rw-r--r-- 1 root root  2692 Apr 10  2000 LICENSE
-rw-r--r-- 1 root root 40079 Feb 28  2005 MANUAL
-rw-r--r-- 1 root root  8059 Feb 27  2005 README
-rw-r--r-- 1 root root  3149 Feb 21  2005 TODO
-rw-r--r-- 1 root root  2000 Mar  9  2005 WHATSNEW
-rw-r--r-- 1 root root 19032 Apr 19  2000 WHERE
-rw-r--r-- 1 root root 356 Dec 14  1996 /usr/share/doc/zip-2.31/BUGS
-rw-r--r-- 1 root root 60168 Mar  9  2005 /usr/share/doc/zip-2.31/CHANGES
-rw-r--r-- 1 root root 2692 Apr 10  2000 /usr/share/doc/zip-2.31/LICENSE
-rw-r--r-- 1 root root 40079 Feb 28  2005 /usr/share/doc/zip-2.31/MANUAL
-rw-r--r-- 1 root root 8059 Feb 27  2005 /usr/share/doc/zip-2.31/README
-rw-r--r-- 1 root root 3149 Feb 21  2005 /usr/share/doc/zip-2.31/TODO
-rw-r--r-- 1 root root 2000 Mar  9  2005 /usr/share/doc/zip-2.31/WHATSNEW
-rw-r--r-- 1 root root 19032 Apr 19  2000 /usr/share/doc/zip-2.31/WHERE
-rw-r--r-- 1 root root 3395 Dec 14  1996 /usr/share/doc/zip-2.31/algorith.txt
-rw-r--r-- 1 root root 12854 Jan  9  2007 /usr/share/man/man1/zip.1.gz

Reset the permissions of the all installed RPM packages

You need to use combination of rpm and a shell for loop command as follows:
for p in $(rpm -qa); do rpm --setperms $p; done
for p in $(rpm -qa); do rpm --setugids $p; done

Above command combination will reset all the permissions to the default permissions under CentOS / RHEL / Fedora Linux.

A note about Debian / Ubuntu Linux distributions

Only rpm command / Solaris pkg and AIX command supports package file permission reset option. But dpkg / apt-get command doesn’t support this option.

Solaris command example

Boot Solaris / OpenSolaris box in single user mode. Mount /usr and other filesystem:
mount / /a
mount /usr /a/usr
mount /var/ /a/var
mount /opt /a/opt

Login as the root, enter:
pkgchk -R /a -f
Please note that he pkgchk command does not restore setuid, setgid, and sticky bits. These must be set manually. Read pkgchk command man page for more information:
man pkgchk

PC-BSD review

FreeBSD logo

PC-BSD is a Unix-like, desktop-oriented operating system based on FreeBSD.
The main aim is to be easy to install programs by using a graphical installation program, KDE - pre-installed graphical user interface.

PC-BSD does not use ports style package management, instead it use .pbi files. You can just double click on .pbi file to start installation wizard (just like Windows XP).

From the article:
Well, I thought it was about time I got around to doing this properly.

I've been using PC-BSD for approx. 10 Months so I've had enough time to see what life throws at me with it. My first install was 1.0 Release Canadate (RC) 1 and I currently run PC-BSD 1.2 (the current release) on my laptop and have a beta version of 1.3 installed on my desktop for testing. This will cover PC-BSD 1.2 and PC-BSD in general.

PC-BSD is primarly for desktops but makes a darn good laptop/workstation system. I won't cover installation details as this is changing in future versions and often reviewed. My reviews sole interest is in a End User perspective.


Comparison: Linux vs FreeBSD (Bsd) oses

If you would like to compare FreeBSD and Linux, then keep in mind following points:

* SMP support

* Portability

* Reliability/robust

* Performance

* Security

* Filesystem

* Support (community and vendor)

* Clean code and well documented API

* Amount of software/applications

* 3rd party apps support

SMP supportGood (v5.x/6.x+)Very Good (2.6+)
Reliability/robustVery GoodGood
PerformanceVery GoodGood
Security (out of box)Very goodGood
Oracle/ERP appsNot supportedVery good
Package managementExcellent (ports & binary)Depends on distribution (Debian - excellent, RPM based - ok (go for yum))
Dell/IBM/HP server supportN/A (FreeBSD works with these vendors systems; at least I have very good experience with HP boxes)Very good
Support (community and vendor)GoodGood

Based upon my personal experience I recommend FreeBSD for Internet server (webserver or mail servers). They are extremely stable. FreeBSD is known to handle heavy load efficiently.

However, if you are looking to run 4 or 8 way SMP server or Oracle database server, use Linux (go for RHEL or Suse enterprise Linux). Linux has excellent support from these vendors.

In addition, OpenBSD is my choice for firewall/NAT/DMZ. :D If anyone has more information, just comment it below.

Further reading: