Monthly Archives: January 2013

My steps after Fedora installation

I’ve wanted to write a post about setting up my Linux environment for a long time. It’s for my personal purposes, so it doesn’t claim to be the best guide that you are looking for. The main motivation is to have easy-to-access place (like this blog), where I can find useful and well-arranged information quickly. I’ve googled many things many times and I would like to avoid repeating of my search queries. Code snippets are sometimes specific to Fedora 17, but generally the commands will be helpful with future releases too.

Do not count on Linux distribution upgrade feature

I’ve upgraded several Linux distributions many times in the past and rarely with success. Very often there have been problems with broken dependencies, kernel upgrades, hardware, Java, etc. The best solution is to divide your partition when doing the first installation (fortunately Fedora installer can partition the drive, if you are not sure):

  • root /
  • home dir /home
  • swap

This division of your hard drive partition enables you to just format your root partition and reinstall Linux there without any problems. All of your user data will be kept on your /home partition including configuration of all applications used before. This tip can save you several hours.

Install additional software

I am used to software of my choice and often I don’t like the default software for distribution chosen by someone else. So I install several types of packages:

$ su -
# yum -y install audacious audacious-plugins-freeworld-mp3 audacious-plugins-freeworld-ffaudio gimp git htop keepassx krb5-workstation nfs-utils pidgin subversion terminator thunderbird tig vim wireshark-gnome

Java

# yum -y install java-1.7.0-openjdk java-1.7.0-openjdk-devel

This command installs both Java runtime environment and development kit.

Services

# yum -y install httpd phpmyadmin mysql-server postgresql-server phpPgAdmin

Services include MySQL (mysqld) and PostgreSQL (postgresql) databases and web server (httpd). The services can be controlled like this:

# service httpd|mysqld|postgresql start|restart|stop

To start services at each system boot it is necessary to run:

# chkconfig postgresql on

Phpmyadmin might refuse to login. Then it’s necessary to reset MySQL database password:

$ mysql -u root
mysql> set password for root@localhost = password('yourpassword');
mysql> exit;

Later you need to login into MySQL using the password authentication.

$ mysql -u root -p

Unpackaged software

This kind of software includes many tools and application useful for Java developer.

  • Intellij Idea – instructions how to add GUI icon for Idea
  • Maven – just unzip and add $M2_HOME system variable and $M2_HOME/bin directory to your $PATH variable
  • Eclipse

Yes, the question is where to put these kind of software. You have probably successfully downloaded the archive into $HOME/Downloads. If your computer is and will remain single user, then the easiest solution is to put these applications inside something like ~/Apps. For multiuser machine you should use /opt, but this dir means additional configuration of access rights for root. After unzipping and moving the app directory you just need to add bin dir of the apps to your system $PATH variable.

Unofficial Fedora repository – RPM Fusion

Fedora strongly complies to the ideas of free software, so it doesn’t package nonfree software. But there are still many sites and data formats which require such nonfree software. To solve this problem you can add RPM Fusion repository, which contains such nonfree, but sometimes necessary software. You can follow their guide. Or just use these commands:

$ su -c 'yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm'
$ su -c 'yum install gstreamer-{ffmpeg,plugins-{good,ugly,bad{,-free,-nonfree}}}'

Install Adobe Flash

I have taken the steps from here.

# rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm
# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux
# yum install flash-plugin nspluginwrapper alsa-plugins-pulseaudio libcurl

Printer autodiscovery

This demonstrates how to configure cups to automatically discover all printers available in the local network.

# vim /etc/cups/cupsd.conf
Browsing On
BrowsePoll cups.site.company.com:631
# service cups restart

Sometimes it’s necessary to change user and group id, especially after system reinstallation (Fedora 20):

systemctl isolate multi-user.target
groupmod -g GID group
usermod -u UID -g GID user
systemctl isolate graphical.target
# find / -uid OLD_UID -exec chown -h UID  '{}' \+
# find / -gid OLD_GID -exec chgrp -h GID '{}' \+