How to completely remove Xserver from OpenBSD? - xorg

I just installed OpenBSD 6.9 to study how it works.
I wanted to get the most minimal config possible, because I want to use it as a server.
During instalation I chose the option to not install Xserver, but I still have the /usr/X11R6 and /etc/X11 directories with X config and commands like startx. The only difference is that now, startx doesn't work. I tried installing on VirtualBox and on bare metal and both were the same.
What do I have to do in order to completely remove X from OpenBSD? And why is it still being installed in my machine even if I explicitly write "no" when prompted during installation?
My system:
OpenBSD 6.9
Intel Pentium G5400
Nvidia 1050 ti.

OpenBSD installation uses different file sets => see OpenBSD FAQ / File Sets
X11 installation is split into 4 file sets :
xbase71.tgz : Base libraries and utilities for X11 (requires xshare71.tgz)
xfont71.tgz : Fonts used by X11
xserv71.tgz : X11's X servers
xshare71.tgz : X11's man pages, locale settings and includes
During installation, you chose not to install xserv71.tgz (X servers) but you still have installed xbase71.tgz (startx command and others directories).
If you want to completely remove X from OpenBSD, during installation, remove every file set for X. But you should keep xbase71.tgz because some programs needs it to run correctly even if it's a non-X program.

I'm not a OpenBSD developer, so I cannot give a clear answer. But some specific packages which you can add with the package command from OpenBSD (pkg_add), needs some X libraries or binaries.
As example when you want to add vim for the first time, then you have eight flavors:
$ pkg_info -d vim-8.2.3456-no_x11
Information for inst:vim-8.2.3456-no_x11
[REMOVED]
Flavors:
gtk2 - build using the Gtk+2 toolkit
gtk3 - build using the Gtk+3 toolkit (default)
no_x11 - build without X11 support
lua - build with Lua support
perl - build with Perl support
python - build with Python support
python3 - build with Python3 support
ruby - build with Ruby support
It's depends on the packages what you need. Also when you want install something from the port collections.
You can try the quick and dirty way and simple remove your mentioned directories. But I could be possible that some programs from the base system no longer works, because of missing dependencies.

Related

R FAQ for package tcltk mentions "teacup". What is this and how can I use it?

In the R FAQ section 4.6 (Package TclTk does not work) I found the following sentence:
... although they [missing Tcl/tk packages] may be downloaded via the Teacup facility
What is "teacup"? How can I install and use it?
I am using RStudio running on Ubuntu Linux and Windows 7.
Teacup is a program that ships as part of ActiveTcl, a commercial zero-cost distribution of Tcl (and Tk and many other packages) for various platforms. It does package management, looking after the key part that is download, installation and upgrading of packages from a remote repository. It is not open source, though Tcl itself is (as are the majority of packages that aren't single-company-specific).
If you've got it installed, you use these commands from a shell:
teacup update-self
teacup update
Depending on where your Tcl installation is, you might need to elevate privileges to make these command calls work. How you do this is platform-dependent; on Unix it's usually simplest to use sudo for each of the commands, whereas on Windows it is probably easier to create an elevated command shell and run inside that.
Depending on your site, you might need to configure a web proxy with teacup proxy. Try without first.
If you're using a non-ActiveTcl installation but you have an ActiveTcl installation present, you can still use teacup. You just need to use teacup link to connect that Tcl installation to the teacup local repository. This is slightly more complex because you can have multiple repositories on the one system (though I've never needed that).
First, you find where the repository is:
teacup default
Then you need to link the shell to the repository:
teacup link make $PATH_FROM_TEACUP_DEFAULT $LOCATION_OF_TCLSH_TO_LINK
Making this work with R Studio will be a matter of determining which Tcl installation it is using. If it's already an ActiveTcl, you just need the first part of this answer. Otherwise, you need the second part as well. Also note that pretty much requires that you be using either Tcl 8.5 or 8.6; there are no guarantees for older, unsupported versions.

Problems around Gtk and PyGtk

In the code file i have to link just one library (from gi.repository import Gtk).
But when i run it it replies me:
Gtk-WARNING **: Unknown property: GtkTextView.input-purpose
ERROR --file: collega_GUI --riga: 160, 'Grid' object has no attribute
'get_child_at'
So i tried to find missing libraries:
$ dpkg -l libgtk[0-9]* | grep ^i
ii libgtk2.0-0 2.24.10-0ubuntu6 GTK+ graphical user interface library
ii libgtk2.0-bin 2.24.10-0ubuntu6 programs for the GTK+ graphical user interface library
ii libgtk2.0-common 2.24.10-0ubuntu6 common files for the GTK+ graphical user interface library
ii libgtk2.0-dev 2.24.10-0ubuntu6 development files for the GTK+ library
and Grid object needs gtk3+, so let's install it:
$ sudo apt-get install libgtk-3-0 libgtk-3-common libgtk-3-dev libgtk-3-doc
0 updated, 0 installed, 0 removed and 0 not upgraded
So it's all fine with libraries and:
gtk-grid-get-child-at exists
GtkTextView--input-purpose exists
that "input-purpose" problem is strange, because on the previous OS (ubuntu 13.10, now i'm on 12.04) i didn't get that problem.
The UI is built by Glade, but i never get that error previously: on the same project files, but on a different OS version.
I still think i need to install some libraries.
EDIT :: ged_child_at function call
griglia = self.__builder.get_object('grid3')
for i in range(0, 3):
area = griglia.get_child_at(i, 0)
self.__builder.get_object(Gtk.Buildable.get_name(area)).connect("draw", self.draw)
The tag Since 3.6 for that property which means in Gtk+ 3.4 (which is the default of ubuntu 12.04 if I recall correctly).
So you either work around it or you go the thorny way of upgrading to Gtk+ 3.6 - which I - with all respect - do strongly disrecommend - especially since Unity needs various patches being incorporated into Gtk+ to work at all.
I just checked in gtk+-3.10.x the python bindings are fine and include get_child_at(..).
This question contains an answer that in fact this is a bug in the python bindings of gtk+ 3.4.
Solutions: Backport the git commit that fixes this (should be very tiny git commit) recompile/create deb package (significant knowledge required).
An alternate route would be to locally fix the binding specification and recreate the python introspection bindings locally - not sure if that is possible though - never did that.

How to install ESS on Mac OS X

I am trying to use Emacs instead of R on my Mac machine. I've been looking online how to install ESS so that I can use R in Emacs. But I am really confused by the installation manual which says,
Extract all the files from ess-VERSION.tgz into the directory PREFIX/site-lisp where
PREFIX is appropriate for GNU Emacs on your system; PREFIX will most likely be
either /usr/share/emacs or /usr/local/share/emacs (on Mac OS X, PREFIX will
most likely be something like /Applications/Emacs.app/Contents/Resources):
Where do I find this: /Applications/Emacs.app/Contents/Resources. I looked at Applications folder and it only contains the application file emacs.
Mac applications are bundled in folders with the .app extension. These folders are handled in a special manner by the finder which hides their contents. (See https://superuser.com/questions/78176/how-do-mac-app-execution-files-work for info). Specifically in you case /Applications/Emacs.app is really a folder. To get to its contents right click on it and choose "Show package contents". You will be able to get to /Applications/Emacs.app/Contents/Resources from there.
The ESS documentation recommends using a modified version of Emacs, which includes ESS and a few other packages. It is available for Windows and Mac.

Compiling haskell module Network on win32/cygwin

I am trying to compile Network.HTTP (http://hackage.haskell.org/package/network) on win32/cygwin. However, it does fail with following message:
Setup.hs: Missing dependency on a foreign library:
* Missing (or bad) header file: HsNet.h
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
If the header file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
Unfortuntely it does not give more clues. The HsNet.h includes sys/uio.h which, actually should not be included, and should be configurered correctly.
Don't use cygwin, instead follow Johan Tibells way
Installing MSYS
Install the latest Haskell Platform. Use the default settings.
Download version 1.0.11 of MSYS. You'll need the following files:
MSYS-1.0.11.exe
msysDTK-1.0.1.exe
msysCORE-1.0.11-bin.tar.gz
The files are all hosted on haskell.org as they're quite hard to find in the official MinGW/MSYS repo.
Run MSYS-1.0.11.exe followed by msysDTK-1.0.1.exe. The former asks you if you want to run a normalization step. You can skip that.
Unpack msysCORE-1.0.11-bin.tar.gz into C:\msys\1.0. Note that you can't do that using an MSYS shell, because you can't overwrite the files in use, so make a copy of C:\msys\1.0, unpack it there, and then rename the copy back to C:\msys\1.0.
Add C:\Program Files\Haskell Platform\VERSION\mingw\bin to your PATH. This is neccesary if you ever want to build packages that use a configure script, like network, as configure scripts need access to a C compiler.
These steps are what Tibell uses to compile the Network package for win and I have used this myself successfully several times on most of the haskell platform releases.
It is possible to build network on win32/cygwin. And the above steps, though useful (by Jonke) may not be necessary.
While doing the configuration step, specify
runghc Setup.hs configure --configure-option="--build=mingw32"
So that the library is configured for mingw32, else you will get link or "undefined references" if you try to link or use network library.
This combined with #Yogesh Sajanikar's answer made it work for me (on win64/cygwin):
Make sure the gcc on your path is NOT the Mingw/Cygwin one, but the
C:\ghc\ghc-6.12.1\mingw\bin\gcc.exe
(Run
export PATH="/cygdrive/.../ghc-7.8.2/mingw/bin:$PATH"
before running cabal install network in the Cygwin shell)

Install packages and libraries in a local directory on server

I have accession to universities server: Red Hat Enterprise Linux release 6.2.
My work is to test various scientific analysis programs.
I have no problem untar'ing and running them in my local directory. But most of them have lots of dependencies (perl libraries, RE2, GNU SL, glibc.i686 ) - whenever I try to install those dependencies I come up with the permission problem.
All of those packages require root to install.
Is there a way how can I install various different packages only in my local directory without asking root to install them system wide?
Yes, but the procedure varies per package. Many modern Unix packages have a configure script that you must run, which takes a --prefix option + argument specifying where the package should be installed. A directory such as $HOME/pkg would be a good options for these. Other configuration/building/installation scripts have similar options.
When building a package with dependencies, make sure you have $HOME/pkg/bin in your PATH, $HOME/pkg/lib in your LD_LIBRARY_PATH and pass -I$HOME/pkg/include and -L$HOME/pkg/lib to the compiler and linker, respectively. E.g., put the following in your shell startup file (.bashrc for Bash):
PATH=$HOME/pkg/bin:$PATH
CFLAGS=-I$HOME/pkg/include
LDFLAGS=-L$HOME/pkg/lib
LD_LIBRARY_PATH=$HOME/pkg/lib
(You shouldn't have to install glibc, ever.)

Resources