Wednesday, April 16, 2014

Automated installation from ports

Building software from ports takes quite a lot of time, especially when using bulky programs like ImageMagick or Apache. For example, if you install ImageMagick you will notice that this program has a lot of dependencies. Dependencies are programs which need to be installed before ImageMagick can be installed; ImageMagick can't work without them. The hardest thing about installing ImageMagick is that you need to be in the vicinity of the computer to confirm the installation of each dependent program. Installation will be delayed until you click "OK" to confirm the installation of every dependent program (by this action you confirm options of the current program). (source)
I could not say it better.

The article is useful, but, as for me, the best was the Dola Marco's comment, which suggested to run:
# make config-recursive
# make -DBATCH install clean
I have tried it and it worked. I ran those commands against Xorg and it was successfully installed while I slept. Cool!

I suppose, starting from today, it will be the only installation method at all for me.

Best regards.

P.S. There is some additional information about ports configuration. It is in Russian.

Friday, April 4, 2014

pw: user 'messagebus' disappeared during update

Hello.

During dbus installation from ports, I got:
pw: user 'messagebus' disappeared during update
 The interesting thing is that after restarting the installation I got the following:
>Description: /usr/ports/devel/dbus fails if an existing messagebus user is found

===> Creating users and/or groups.
Using existing group `messagebus'.
Creating user `messagebus' with uid `556'.
pw: user 'messagebus' already exists
*** Error code 74

Stop in /usr/ports/devel/dbus.
*** Error code 1
And:
# pw useradd messagebus
pw: user 'messagebus' already exists
# pw usershow messagebus
pw: no such user `messagebus'
# pw userdel messagebus
pw: no such user `messagebus'
The user exists and does not exist in no time, heh.

The solution was found here:
  1. run vipw
  2. save /etc/passwd without changes
It looks like for some reasons the passwd database was corrupted. And vipw reset's it to normal state.

After doing that, 'pw userdel' completed successfully. And as the result, port has been installed successfully too.

Profit \^__^/

Guys, than you for your advise. It was very helpful. And I hope that post will be handy too.

Sunday, March 30, 2014

Upgrade to a new version

Hello.

I didn't use my notebook for a long time, but this time I decided to start again.
I have upgraded my old Asus x51rl and decided to reinstall the OS from scratch.

First of all, I checked if a new FreeBSD version was available and it was (v10). Of course, I could download the new version .iso image, but:
  1. I had not disk to burn the image;
  2. I didn't want to do it.
Fortunately, there was the instruction on how to upgrade FreeBSD to the new version from the previous one. So, I decided to reinstall FreeBSD 9.0 from the disk I had and upgrade the installed OS.

But it was not as easy as it was written in the article.
The first step was completed successfully:
# freebsd-update fetch
# freebsd-update install
After restart uname -a showed me 9.0-RELEASE-p3. Well, I tested the tool and it looked like it worked as it supposed to work.

But the next step:
freebsd-update upgrade -r 10.0-RELEASE
returned me the message:
Cowardly refusing to proceed any further. 
 and exited.

So I decided to run this upgrade in 2 steps:
  1. freebsd-update upgrade -r 9.2-RELEASE
  2. freebsd-update upgrade -r 10.0-RELEASE
And that did the trick. I successfully upgraded my system to the last 9.2 release. And after that I upgraded it to the release 10.0.

But! There is still the last step: upgrading programs.
It recommends to run:
# portmaster -af
but the issue was that I did not have the program installed yet (I had a clean installation). When I tried to install the program from the ports, I got an error:
Improper use of USE_PERL5 in /usr/ports/Mk/bsd.port.mk
or something like that. A short googling advised me to update the port's tree.
What I did:
# cd /usr/ports
# make update
Doing that, I was said, that 'make update' uses portsnap and I have to run:
# portsnap fetch extract
The command started, but failed because of the lack of inodes in /var (I have 2Gb there). A short investigation showed me, that it was because of
/var/db/freebsd-update
which had a lot of little files. So, I cleaned downloaded files, the portsnap file:
/var/db/portsnap/4Fuy78jn&...JHjj78.tgz
 and re-run it in 2 steps:
  1. # portsnap fetch
  2. # portsnap extract
And that time it completed fully successfully.

Good.

So, the last step was to install portmaster and to run:
# portmaster -af
It was completed successfully and I had FreeBSD 10.0-RELEASE with the ports upgraded.

Well done.
Let's start to use it.

Sunday, July 7, 2013

Java and Flash player for Chromium

Hello everyone.

Well, now I have the X-system and KDE installed, but can anyone imagine modern life without the Web? My favorite browser is Opera, but I decided to install and use the Chromium browser. Why? I don't know. I use Google Chrome in the office and I work with Google Docs often. Well, I guess that's the point.
Anyway, I've already installed it and write this post via it.

And of course, there are Java web applications and a lot of media content exist in the Internet. YouTube, for example, and a lot of others.

First of all, I added:
linux_enable="YES"
to /etc/rc.conf. It is required for some Linux applications, which will run on the system (including the Flash Player for Opera).

The next step was to install JDK (openjdk7 and linux-sun-jdk17) but it didn't help. What should I do now? A short googling moved me there. There was a recommendation to use the HandBook. And the instruction from the HabdBook works!

As people usually say, "When you tried everything and nothing helped, read the manual".

So, now Java applications can be run on my system and I can watch videos via my browser.

Mission complete. 

Wednesday, July 3, 2013

X-system installation

When ports updated, I want to install X-system.

I will use Xorg+KDE3. Well, it is simple:

Install Xorg is too easy:

# cd /usr/ports/x11/xorg
# make install clean

But its configuration is not. Here are some points:
  1. The recommendation is to add the following parameters to /etc/rc.conf to autodetect keyboards and mice:

    hald_enable="YES"
    dbus_enable="YES"

    But both keyboard and touchpad work fine for me without it.
  2. Run:

    # Xorg -configure

    If you do, basic X11 configuration file /root/xorg.conf.new will be created. You can tune and test this file before move it to /etc/X11/xorg.conf
  3. Also, I've added the following to /etc/X11/xorg.conf:

    Option "AutoAddDevices" "false"
    ....
    FontPath "/usr/local/lib/X11/fonts/cyrillic/"
    ....
    Section "Screen"
    DefaultDepth 24
       SubSection "Display"
            Viewport 0 0
            Depth 24
            Modes "1280x800"
       EndSubSection
  4. I like to use KDE, therefore I have installed it via ports. If you want KDE to be started automatically when the system starts (and I wanted it), you have to have the line below in your /etc/ttys file:

    ttyv8 "/usr/local/bin/kdm -nodaemon" xterm on secure

Well, that's all I did. KDE starts well and works fine ^_^ As it usually does.
In my further posts, I'll tell you what software do I use.

Wednesday, January 30, 2013

Issue with the host name resolving

Hello again.

The issue which I want to describe now appeared in first when I installed the OS.

When the system starts, the messages like presented below appeared in the console:

Jul 7 16:01:40 <host_name> sendmail[366]: My unqualified host name (<host_name>) unknown; sleeping for retry
Jul 7 16:02:40 <host_name>sendmail[366]: unable to qualify my own domain name (<host_name>) -- using short name
Jul 7 16:02:42 <host_name>sm-mta[421]: My unqualified host name (<host_name>) unknown; sleeping for retry
Jul 7 16:03:42 <host_name>sm-mta[421]: unable to qualify my own domain name (<host_name>) -- using short name
Jul 7 16:03:42 <host_name>sm-msp-queue[425]: My unqualified host name (<host_name>) unknown; sleeping for retry
Jul 7 16:04:43 <host_name>sm-msp-queue[425]: unable to qualify my own domain name (firma123) -- using short name

I never met this before, therefore I googled it and found the solutions:
  1. If you do not plan to use sendmail, you can disable it.
    Add sendmail_enabled="NONE" to your /etc/rc.conf file.
  2. The other way to specify any domain within /etc/hosts. My configuration is:
    192.168.2.11 ltr
    192.168.2.11 ltr.my.com
    
As a result, there is no delay on the system start anymore.

Have a nice day!

P.S. Thanks these guys for the answer.

Monday, January 7, 2013

Before application installation

Everyone, hello again.

Sorry for delay, I was really busy last 3 months, so I haven't a time to do any blog's activity. But now I have a time and will continue configuration posts. Lets continue post installation configuration.

I plan to perform all installations via ports and this is mean that I will download everything from Internet. Lets increase the download speed and decrease the load on general FreeBSD.org servers. Create file /etc/make.conf and add into it:

MASTER_SITE_BACKUP?= \
    ftp://ftp8.ua.FreeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR} \
    ftp://ftp7.ua.FreeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR} \
    ftp://ftp6.ua.FreeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR} \
    ftp://ftp5.ua.FreeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR} \
    ftp://ftp4.ua.FreeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR} \
    ftp://ftp3.ua.FreeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR} \
    ftp://ftp2.ua.FreeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR} \
    ftp://ftp.ua.FreeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}
MASTER_SITE_OVERRIDE?= ${MASTER_SITE_BACKUP}


Now, make will check Ukrainian servers first for distributives.

I want to thank these guys for this information.

The next step is to make ports versions actual. Cvsup will help to do it. I will not use it within X-system.

cd /usr/ports/net/cvsup-without-gui
make
make install

I have to configure it to work with Ukrainian cvsup servers and specify what exactly I want to update. I will use supfile from template:

cp /usr/share/examples/cvsup/cvs-supfile /usr/local/etc/

I want to start this utility via cron, so I don't need graphic interface to it. The command to run update is:

cvsup -g -L 2 <path_to_supfile>

My configuration:

/usr/local/etc/cvs-supfile
*default host=cvsup5.ua.FreeBSD.org
*default base=/var/db
*default prefix=/usr
*default release=cvs tag=.
*default delete use-rel-suffix
*default compress
ports-all

You can use cvsup for src update too, but I don't plane re-build the world this time and will not update something except the ports.

Check handbook for additional information.

Well, now my ports are updated, this process scheduled on a daily basis and I can start X-system installation.

Best regards!
\^_^/