[转]Installing an OpenBSD 4.9 (i386) desktop system
发表于 : 2011-11-25 22:35
来自agentoss.wordpress.com
作者:fred?
原文在墙外,所以直接复制过来,准备在这个基础上研究5.0的中文桌面
Installing an OpenBSD 4.9 (i386) desktop system
How to obtain a lightweight OpenBSD desktop using the XFCE 4.8 environment
Download the install CD image : http://ftp.fr.openbsd.org/pub/OpenBSD/4 ... tall49.iso (french mirror)
Choose your mirror here : http://www.openbsd.org/ftp.html
Installing OpenBSD
The install procedure is straightforward. Boot the CD and follow the Official faq : http://www.openbsd.org/faq/index.html
“Do you expect to run the X Window System?” : yes
“Do you want the X Window System to be started by xdm(1)?” : no
(we will enable it later)
“Setup a user?” : fred
Partitioning your disk (the hardest part of the setup) :
I personally opt for a (simpler) (C)ustom layout :
example for a 20Go hard disk (I’m using a low capacity virtual hard disk here!) :
a: / 1G
b: swap 1G
d: /usr 10G
e: /tmp 1G
f: /var 1G
g: /home (all the remaining disk space)
Adapt at your will.
So when prompted, choose (C)ustom layout, and type the following to delete all partitions and create our layout :
(use the ? command for help)
> z
> a
partition: [a] (enter, use defaults)
offset: [...] (enter, use defaults)
size: [...] 1G
FS type : [4.2BSD] (enter, use defaults)
mount point: [none] /
> p
(we see our partition)
> a
partition: (enter, use defaults)
offset: [...] (enter, use defaults)
size: [...] 1G
FS type : [swap] (enter, use defaults)
> a
partition: [d] (enter, use defaults)
offset: [...] (enter, use defaults)
size: [...] 10G
FS type : [4.2BSD] (enter, use defaults)
mount point: [none] /usr
> a
partition: [e] (enter, use defaults)
offset: [...] (enter, use defaults)
size: [...] 1G
FS type : [4.2BSD] (enter, use defaults)
mount point: [none] /tmp
> a
partition: [f] (enter, use defaults)
offset: [...] (enter, use defaults)
size: [...] 1G
FS type : [4.2BSD] (enter, use defaults)
mount point: [none] /var
> a
partition: [g] (enter, use defaults)
offset: [...] (enter, use defaults)
size: [...] (enter, use all remaining space)
FS type : [4.2BSD] (enter, use defaults)
mount point: [none] /home
> p
Ok, we are done, save changes
> w
and exit partitioning
> x
Installation of the CD sets, just use the defaults.
If all went well
# reboot
First root login after installation
We add the PKG_PATH environment variable (location of packages to download) in the .profile shell configuration file.
# vi .profile
add the line :
export PKG_PATH=http://ftp.fr.openbsd.org/pub/OpenBSD/4 ... s/`machine -a`/
(here for the french mirror, remember to use a suitable mirror for your location)
Do the same for regular user fred
# nano -w /home/fred/.profile
Exit and re-log as root for the modification to be effective.
Now let’s install our first package : the friendlier text editor Nano
# pkg_add -v nano
Enable sudo for user fred
# visudo
uncomment the line
# %wheel ALL=(ALL) SETENV: ALL
then make sure our user belongs to the wheel group
# groups fred
if not :
# usermod -G wheel fred
NOTE : if you’re using a VM, you can now connect with ssh (as user fred) on your openbsd system for convenient terminal copy & paste.
Installing the XFCE Desktop environment from packages
$ su
# pkg_add -v gamin xfce4-session xfce-utils xfdesktop xfconf xfce4-mixer xfce4-settings xfce4-panel xfce4-terminal xfce4-places xfwm4 xfwm4-themes
# cat >>/etc/rc.conf.local <<EOF
rc_scripts="dbus_daemon"
EOF
Then start X Window with XFCE
# echo >~/.xinitrc startxfce4
# startx
Note : for X troubleshooting, see http://www.openbsd.org/faq/faq11.html
If everything works well so far, we can enable X to start automatically at boot, via the xdm login manager
# echo >>/etc/rc.conf.local xdm_flags=""
We also need to set .xsession (otherwise fvwm is the default window manager)
# exit
$ echo >~/.xsession startxfce4
(reboot to apply changes)
You may want to use gdm as login manager instead of xdm (more gnome dependencies will be installed) :
# pkg_add -v gdm
# nano /etc/rc.conf.local
xdm_flags=NO
and add gdm to the rc_scripts line :
rc_scripts=”dbus_daemon gdm”
While we are at it, enable the aucat sound daemon at boot time
# nano /etc/rc.conf.local
add the line :
aucat_flags=”"
Start aucat as daemon
# aucat -l
Ok, we have now a bare XFCE desktop, it’s time to install some apps!
Installing applications for our desktop
Internet apps
Lightweight web browser Midori (uses WebKit like Chromium)
$ sudo pkg_add midori
NOTE : Midori is able to play HTML5 videos
See http://www.youtube.com/html5 (“Join the trial”)
Chromium web browser (*not recommended at this time because of stability problems! And the sound doesn’t seem to work*)
$ sudo pkg_add chromium
There are some things to do for Chromium to be a bit functional :
# echo >>/etc/sysctl.conf kern.shminfo.shmall=32768
# nano /etc/login.conf
in the “default” section :
add
penfiles-max=400:\
(system will need to be restarted)
Add the Chromium icon in XFCE’s menu
Create the file chromium.desktop
# nano /usr/local/share/applications/chromium.desktop
[Desktop Entry]
Version=1.0
Type=Application
Categories=Application;Network
Name=Chromium
Comment=Chromium Web browser
Icon=/usr/local/chrome/product_logo_48.png
Exec=chrome %u
Path=
Terminal=false
StartupNotify=false
Firefox 3.6.x + language pack
$ sudo pkg_add firefox-i18n-fr
(here for the french language, adapt to your case)
media player plugin for Firefox (uses mplayer)
$ sudo pkg_add gecko-mediaplayer
(verify your plugins with about:plugins in firefox)
There’s no native flash player support in *BSD (hopefully this crappy piece of software will be rendered obsolete by HTML5 video support)
So we have some workarounds with Firefox 3.6 (Firefox 4.0 supports HTML5 videos, but is not available as a package in OpenBSD release 4.9…)
Youtube without flash for Firefox :
* Install the Greasemonkey add-on
* Install the following script for Greasemonkey : “Youtube without Flash Auto”
http://userscripts.org/scripts/show/50771
NOTE : doesn’t work for me right now!
Another work-around :
Youtube-dl for downloading videos
$ sudo pkg_add -v youtube-dl
$ youtube-dl <URL_of_youtube_video>
Then use mplayer to replay the video.
Email client Thunderbird
$ sudo pkg_add mozilla-thunderbird
If you prefer a lighter client, sylpheed / claws-mail are also available.
FTP client FileZilla
$ sudo pkg_add filezilla
IM client, Empathy (warning, many gnome dependencies!)
$ sudo pkg_add empathy
xchat for a much lighter, IRC client only.
$ sudo pkg_add xchat
Multimedia apps
VLC media player (warning, qt4-dependant!)
$ sudo pkg_add vlc
Lightweight audio player : Audacious
$ sudo pkg_add audacious-plugins
To have sound output in Audacious, be sure to select “Sndio output plugin” in preferences/audio.
Office apps
Lightweight text editor : mousepad
$ sudo pkg_add mousepad
LibreOffice suite (Warning, heavy!)
$ sudo pkg_add libreoffice-i18n-fr libreoffice-java
(adapt to your own language)
To define default language in LibreOffice, start it then go to the Tools menu > Options > Language settings.
PDF viewer
$ sudo pkg_add -v epdfview-0.1.7p7
Image processing : GIMP
$ sudo pkg_add gimp
Image displayer : eog (again, heavy gnome-dependencies!)
$ sudo pkg_add eog-plugins
Updated 07/22/2011 : Mike suggests Ristretto which is an XFCE app (so much lighter)
Some more useful utilities (archive manager, calc, …)
$ sudo pkg_add thunar-archive galculator
Now we want to add support for .rar archives, rar/unrar isn’t available as a package, but is present in OpenBSD’s ports.
Installing the ports tree
$ cd /tmp
$ ftp ftp://ftp.fr.openbsd.org/pub/OpenBSD/4.9/ports.tar.gz
$ cd /usr
$ sudo tar xzf /tmp/ports.tar.gz
Compiling and installing unrar :
$ cd /usr/ports/archivers/unrar
$ sudo make install
NOTE : the OpenBSD developers strongly suggest to use binary packages whenever possible.
THE END!
As always, feedback is welcome
OpenBSD optimizations
Disk optimization : add the softdep and noatime options for your partitions in /etc/fstab
# nano -w /etc/fstab
/dev/wd0a / ffs rw,softdep,noatime 1 1
/dev/wd0g /home ffs rw,nodev,nosuid,softdep,noatime 1 2
/dev/wd0e /tmp ffs rw,nodev,nosuid,softdep,noatime 1 2
/dev/wd0d /usr ffs rw,nodev,softdep,noatime 1 2
/dev/wd0f /var ffs rw,nodev,nosuid,softdep,noatime 1 2
TIPS
# man afterboot
# man intro
# man 8 intro
# man hier
Manually update the files database so we can use the locate command to look for a file
# /usr/libexec/locate.updatedb
# locate <name>
List installed packages
# pkg_info |more
Search for packages in repository (provided by PKG_PATH)
# pkg_info -Q <search string>
Update all packages on the system
# pkg_add -v -u
------end-------
作者:fred?
原文在墙外,所以直接复制过来,准备在这个基础上研究5.0的中文桌面
Installing an OpenBSD 4.9 (i386) desktop system
How to obtain a lightweight OpenBSD desktop using the XFCE 4.8 environment
Download the install CD image : http://ftp.fr.openbsd.org/pub/OpenBSD/4 ... tall49.iso (french mirror)
Choose your mirror here : http://www.openbsd.org/ftp.html
Installing OpenBSD
The install procedure is straightforward. Boot the CD and follow the Official faq : http://www.openbsd.org/faq/index.html
“Do you expect to run the X Window System?” : yes
“Do you want the X Window System to be started by xdm(1)?” : no
(we will enable it later)
“Setup a user?” : fred
Partitioning your disk (the hardest part of the setup) :
I personally opt for a (simpler) (C)ustom layout :
example for a 20Go hard disk (I’m using a low capacity virtual hard disk here!) :
a: / 1G
b: swap 1G
d: /usr 10G
e: /tmp 1G
f: /var 1G
g: /home (all the remaining disk space)
Adapt at your will.
So when prompted, choose (C)ustom layout, and type the following to delete all partitions and create our layout :
(use the ? command for help)
> z
> a
partition: [a] (enter, use defaults)
offset: [...] (enter, use defaults)
size: [...] 1G
FS type : [4.2BSD] (enter, use defaults)
mount point: [none] /
> p
(we see our partition)
> a
partition: (enter, use defaults)
offset: [...] (enter, use defaults)
size: [...] 1G
FS type : [swap] (enter, use defaults)
> a
partition: [d] (enter, use defaults)
offset: [...] (enter, use defaults)
size: [...] 10G
FS type : [4.2BSD] (enter, use defaults)
mount point: [none] /usr
> a
partition: [e] (enter, use defaults)
offset: [...] (enter, use defaults)
size: [...] 1G
FS type : [4.2BSD] (enter, use defaults)
mount point: [none] /tmp
> a
partition: [f] (enter, use defaults)
offset: [...] (enter, use defaults)
size: [...] 1G
FS type : [4.2BSD] (enter, use defaults)
mount point: [none] /var
> a
partition: [g] (enter, use defaults)
offset: [...] (enter, use defaults)
size: [...] (enter, use all remaining space)
FS type : [4.2BSD] (enter, use defaults)
mount point: [none] /home
> p
Ok, we are done, save changes
> w
and exit partitioning
> x
Installation of the CD sets, just use the defaults.
If all went well
# reboot
First root login after installation
We add the PKG_PATH environment variable (location of packages to download) in the .profile shell configuration file.
# vi .profile
add the line :
export PKG_PATH=http://ftp.fr.openbsd.org/pub/OpenBSD/4 ... s/`machine -a`/
(here for the french mirror, remember to use a suitable mirror for your location)
Do the same for regular user fred
# nano -w /home/fred/.profile
Exit and re-log as root for the modification to be effective.
Now let’s install our first package : the friendlier text editor Nano
# pkg_add -v nano
Enable sudo for user fred
# visudo
uncomment the line
# %wheel ALL=(ALL) SETENV: ALL
then make sure our user belongs to the wheel group
# groups fred
if not :
# usermod -G wheel fred
NOTE : if you’re using a VM, you can now connect with ssh (as user fred) on your openbsd system for convenient terminal copy & paste.
Installing the XFCE Desktop environment from packages
$ su
# pkg_add -v gamin xfce4-session xfce-utils xfdesktop xfconf xfce4-mixer xfce4-settings xfce4-panel xfce4-terminal xfce4-places xfwm4 xfwm4-themes
# cat >>/etc/rc.conf.local <<EOF
rc_scripts="dbus_daemon"
EOF
Then start X Window with XFCE
# echo >~/.xinitrc startxfce4
# startx
Note : for X troubleshooting, see http://www.openbsd.org/faq/faq11.html
If everything works well so far, we can enable X to start automatically at boot, via the xdm login manager
# echo >>/etc/rc.conf.local xdm_flags=""
We also need to set .xsession (otherwise fvwm is the default window manager)
# exit
$ echo >~/.xsession startxfce4
(reboot to apply changes)
You may want to use gdm as login manager instead of xdm (more gnome dependencies will be installed) :
# pkg_add -v gdm
# nano /etc/rc.conf.local
xdm_flags=NO
and add gdm to the rc_scripts line :
rc_scripts=”dbus_daemon gdm”
While we are at it, enable the aucat sound daemon at boot time
# nano /etc/rc.conf.local
add the line :
aucat_flags=”"
Start aucat as daemon
# aucat -l
Ok, we have now a bare XFCE desktop, it’s time to install some apps!
Installing applications for our desktop
Internet apps
Lightweight web browser Midori (uses WebKit like Chromium)
$ sudo pkg_add midori
NOTE : Midori is able to play HTML5 videos
See http://www.youtube.com/html5 (“Join the trial”)
Chromium web browser (*not recommended at this time because of stability problems! And the sound doesn’t seem to work*)
$ sudo pkg_add chromium
There are some things to do for Chromium to be a bit functional :
# echo >>/etc/sysctl.conf kern.shminfo.shmall=32768
# nano /etc/login.conf
in the “default” section :
add
penfiles-max=400:\
(system will need to be restarted)
Add the Chromium icon in XFCE’s menu
Create the file chromium.desktop
# nano /usr/local/share/applications/chromium.desktop
[Desktop Entry]
Version=1.0
Type=Application
Categories=Application;Network
Name=Chromium
Comment=Chromium Web browser
Icon=/usr/local/chrome/product_logo_48.png
Exec=chrome %u
Path=
Terminal=false
StartupNotify=false
Firefox 3.6.x + language pack
$ sudo pkg_add firefox-i18n-fr
(here for the french language, adapt to your case)
media player plugin for Firefox (uses mplayer)
$ sudo pkg_add gecko-mediaplayer
(verify your plugins with about:plugins in firefox)
There’s no native flash player support in *BSD (hopefully this crappy piece of software will be rendered obsolete by HTML5 video support)
So we have some workarounds with Firefox 3.6 (Firefox 4.0 supports HTML5 videos, but is not available as a package in OpenBSD release 4.9…)
Youtube without flash for Firefox :
* Install the Greasemonkey add-on
* Install the following script for Greasemonkey : “Youtube without Flash Auto”
http://userscripts.org/scripts/show/50771
NOTE : doesn’t work for me right now!
Another work-around :
Youtube-dl for downloading videos
$ sudo pkg_add -v youtube-dl
$ youtube-dl <URL_of_youtube_video>
Then use mplayer to replay the video.
Email client Thunderbird
$ sudo pkg_add mozilla-thunderbird
If you prefer a lighter client, sylpheed / claws-mail are also available.
FTP client FileZilla
$ sudo pkg_add filezilla
IM client, Empathy (warning, many gnome dependencies!)
$ sudo pkg_add empathy
xchat for a much lighter, IRC client only.
$ sudo pkg_add xchat
Multimedia apps
VLC media player (warning, qt4-dependant!)
$ sudo pkg_add vlc
Lightweight audio player : Audacious
$ sudo pkg_add audacious-plugins
To have sound output in Audacious, be sure to select “Sndio output plugin” in preferences/audio.
Office apps
Lightweight text editor : mousepad
$ sudo pkg_add mousepad
LibreOffice suite (Warning, heavy!)
$ sudo pkg_add libreoffice-i18n-fr libreoffice-java
(adapt to your own language)
To define default language in LibreOffice, start it then go to the Tools menu > Options > Language settings.
PDF viewer
$ sudo pkg_add -v epdfview-0.1.7p7
Image processing : GIMP
$ sudo pkg_add gimp
Image displayer : eog (again, heavy gnome-dependencies!)
$ sudo pkg_add eog-plugins
Updated 07/22/2011 : Mike suggests Ristretto which is an XFCE app (so much lighter)
Some more useful utilities (archive manager, calc, …)
$ sudo pkg_add thunar-archive galculator
Now we want to add support for .rar archives, rar/unrar isn’t available as a package, but is present in OpenBSD’s ports.
Installing the ports tree
$ cd /tmp
$ ftp ftp://ftp.fr.openbsd.org/pub/OpenBSD/4.9/ports.tar.gz
$ cd /usr
$ sudo tar xzf /tmp/ports.tar.gz
Compiling and installing unrar :
$ cd /usr/ports/archivers/unrar
$ sudo make install
NOTE : the OpenBSD developers strongly suggest to use binary packages whenever possible.
THE END!
As always, feedback is welcome
OpenBSD optimizations
Disk optimization : add the softdep and noatime options for your partitions in /etc/fstab
# nano -w /etc/fstab
/dev/wd0a / ffs rw,softdep,noatime 1 1
/dev/wd0g /home ffs rw,nodev,nosuid,softdep,noatime 1 2
/dev/wd0e /tmp ffs rw,nodev,nosuid,softdep,noatime 1 2
/dev/wd0d /usr ffs rw,nodev,softdep,noatime 1 2
/dev/wd0f /var ffs rw,nodev,nosuid,softdep,noatime 1 2
TIPS
# man afterboot
# man intro
# man 8 intro
# man hier
Manually update the files database so we can use the locate command to look for a file
# /usr/libexec/locate.updatedb
# locate <name>
List installed packages
# pkg_info |more
Search for packages in repository (provided by PKG_PATH)
# pkg_info -Q <search string>
Update all packages on the system
# pkg_add -v -u
------end-------