LowEndBox - Cheap VPS, Hosting and Dedicated Server Deals

Fast And Easy Install Of Plan 9 From Bell Labs On Any Linux Distribution!

Tags: , , Date/Time: May 31, 2022 @ 6:00 pm, by Not_Oles

Editorial Comment: Grrrrr…thanks a lot, TOM! Now you’ve given me yet another useless hobby.  — raindog308


Glenda, the Plan 9 bunny

Almost everybody knows that Unix was developed at Bell Labs and that Linux and many other contemporary operating systems descend from Unix.

But, do you know about Plan 9? Plan 9 from Bell Labs is a distributed operating system which the Unix team at Bell Labs created as a successor to Unix.

Plan 9 never became anywhere near as popular as Unix. However, the Plan 9 Wikipedia page says that Plan 9 code became, unlike Unix, free and open-source in 2000 and that Plan 9’s Fourth Edition was released in 2002. The open source license, the open availability of the Plan 9 distribution, and the friendliness of the Plan 9 community led me to use it back then.

These days, for a lot of people, there is no longer much reason to run the Plan 9 kernel. However, there still are people who run the Plan 9 userland on Linux and other contemporary operating systems. I no longer remember exactly when it started, but, at some point, one of the most active Plan 9 guys ported many items from the Plan 9 userland to BSD and Linux. This porting project was named Plan 9 from Userspace a/k/a plan9port.

Plan9port has a home page, a Github repository, and an active Google Groups development discussion list.

I heard that several of the guys from the original Unix and Plan 9 teams moved to Google and used plan9port there at Google.

For those who want many of the features of plan9port, here are some startup configuration files. As for me, I just enjoy using the plan9port versions of a few of the older Unix command line utilities, such as the ed editor. It’s also very interesting to compare the source code of the Unix and Plan 9 utilities to other implementations of the same utilities. Often the Unix and Plan 9 versions are amazingly simpler and shorter.

Okay, enough introduction. Let’s install plan9port! The install is simple and easy, thanks to all the work done by the plan9port developers!

Install

The install instructions are at plan9port’s install(1) man page. The initial command to install with git is shown in the plan9port home page.

Enable Revert

We’re going to be installing within /usr/local. Let’s make an archive of /usr/local so we can revert if something goes wrong.

root@darkstar:/usr# tar cvzf local-revert.tgz local
[ . . . ]
root@darkstar:/usr#

Clone the source

Next we’re going to clone the plan9port sources from their Github repository.

root@darkstar:/usr# cd local
root@darkstar:/usr/local# git clone https://github.com/9fans/plan9port plan9
Cloning into 'plan9'...
remote: Enumerating objects: 36924, done.
remote: Counting objects: 100% (151/151), done.
remote: Compressing objects: 100% (98/98), done.
remote: Total 36924 (delta 69), reused 103 (delta 53), pack-reused 36773
Receiving objects: 100% (36924/36924), 25.79 MiB | 19.45 MiB/s, done.
Resolving deltas: 100% (25786/25786), done.
root@darkstar:/usr/local#

Let’s take a look at what’s inside the newly cloned plan9 directory.

root@darkstar:/usr/local# cd plan9/
root@darkstar:/usr/local/plan9# ls
CHANGES Makefile dict/ install.txt man/ proto/ troff/
CONTRIBUTING.md README.md dist/ lib/ ndb/ rcmain unix/
CONTRIBUTORS acid/ face/ lp/ news/ sky/
INSTALL* bin/ font/ mac/ plumb/ src/
LICENSE configure* include/ mail/ postscript/ tmac/
root@darkstar:/usr/local/plan9#

Build

Now we’re going to run the INSTALL script, which builds and installs plan9port.

root@darkstar:/usr/local/plan9# ./INSTALL

[ . . . ]

[ . . . ]

* Cleaning up…
* Renaming hard-coded /usr/local/plan9 paths…
* Building web manual…
* Done.

* Add these to your profile environment.
PLAN9=/usr/local/plan9 export PLAN9
PATH=$PATH:$PLAN9/bin export PATH
root@darkstar:/usr/local/plan9#

Whoa! Looks like it worked! Let’s see what’s there now!

root@darkstar:/usr/local/plan9# ls
CHANGES Makefile configure* include/ lp/ news/ sky/
CONTRIBUTING.md README.md dict/ install.log mac/ plumb/ src/
CONTRIBUTORS acid/ dist/ install.sum mail/ postscript/ tmac/
INSTALL* bin/ face/ install.txt man/ proto/ troff/
LICENSE config font/ lib/ ndb/ rcmain unix/
root@darkstar:/usr/local/plan9#

Mmmm! Let’s peek into the sources!

root@darkstar:/usr/local/plan9# cd src/cmd
root@darkstar:/usr/local/plan9/src/cmd# wc ed.c
1639 3665 23093 ed.c
root@darkstar:/usr/local/plan9/src/cmd#

Yep! ed is there! :)

Test

But, does it work? :)

root@darkstar:/usr/local/plan9# cd
root@darkstar:~# PLAN9=/usr/local/plan9 export PLAN9
root@darkstar:~# PATH=$PATH:$PLAN9/bin export PATH
root@darkstar:~# ls foo
/bin/ls: cannot access 'foo': No such file or directory
root@darkstar:~# 9 ed foo
?foo
a
bar
.
wq
4
root@darkstar:~# cat foo
bar
root@darkstar:~#

Yaaay! It works! :)



No Comments

    Leave a Reply

    Some notes on commenting on LowEndBox:

    • Do not use LowEndBox for support issues. Go to your hosting provider and issue a ticket there. Coming here saying "my VPS is down, what do I do?!" will only have your comments removed.
    • Akismet is used for spam detection. Some comments may be held temporarily for manual approval.
    • Use <pre>...</pre> to quote the output from your terminal/console, or consider using a pastebin service.

    Your email address will not be published.