LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (http://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   package management (new to solaris) (http://www.linuxquestions.org/questions/solaris-opensolaris-20/package-management-new-to-solaris-320482/)

xushi 05-05-2005 04:17 PM

package management (new to solaris)
 
Hi all, I've been a slackware user for a few years, so the recent move to Solaris is quite interesting for me =). I've recently bought an Ultra 60, just installed Solaris 10 on it today.

I do have some issues i'm trying to resolve..

1) Package Management: I noticed Solaris uses 'pkgadd' to install packages. I found a nice repository at http://www.sunfreeware.com and i can just download the packages, gunzip, and
pkgadd -d mypackage. If there are other better ways, then do tell =)

Are there ways to
- View a list of the packages and their versions of what i have currently installed? (like pkgtool in slackware)

- upgrade/remove a package? eg: If i have Apache 2.0.53 installed, i would want to upgrade or remove it before installing 2.0.54. (similar to upgradepkg and removepkg in slack)

2) How the heck can i sort out my PATH properly? Its currently set to /usr/sbin:/usr/bin, I know it should be more than this.. wget works when adding /usr/local/bin as a path, make works when i add /usr/ccs/bin to the path, but is there anything more? And how do i make this permanent?

3) The default shell is /bin/sh, and i don't like it =/, i prefer bash.. Is there any way to make bash the default one? And is there anyway to set the bashrc file? /etc/profile looks different here.. (scary)

Thanks alot all =)

jlliagre 05-05-2005 07:01 PM

Quote:

- View a list of the packages and their versions of what i have currently installed? (like pkgtool in slackware)
pkginfo
prodreg
Quote:

- upgrade/remove a package? eg: If i have Apache 2.0.53 installed, i would want to upgrade or remove it before installing 2.0.54. (similar to upgradepkg and removepkg in slack)
pkgrm then pkgadd

You can also use the wrapper pkg-get that is handling version checking, update and dependancies.
See blastwave.org for details.
Quote:

2) How the heck can i sort out my PATH properly? Its currently set to /usr/sbin:/usr/bin,
Meaning you're logged as root, regular users' PATH is just /usr/bin by default.
Quote:

I know it should be more than this.. wget works when adding /usr/local/bin as a path
It shouldn't, /usr/local/bin is not an allowed directory for freewares under SVR4/Solaris standards.
wget is normally in /usr/sfw/bin.
Quote:

, make works when i add /usr/ccs/bin to the path, but is there anything more? And how do i make this permanent?
You can add directories to the default PATH in /etc/default/ if you want the setting to be global.
Here's my PATH:
/usr/bin:/usr/sfw/bin:/opt/csw/bin:/usr/ccs/bin:/usr/dt/bin:/usr/openwin/bin:/usr/openwin/demo:/usr/sbin:/usr/ucb:
Quote:

3) The default shell is /bin/sh, and i don't like it =/, i prefer bash.. Is there any way to make bash the default one? And is there anyway to set the bashrc file? /etc/profile looks different here.. (scary)
You can change user's shells (as root) by using the "passwd -e [userid]" command.
What scares you in /etc/profile ?
I wouldn't advice you to set root's shell as bash, create an alias account instead.
Also, beware not breaking /etc/profile with bash specific constructions as you may mess you system.

xushi 05-06-2005 03:34 AM

Thanks alot for the reply,

Quote:

Originally posted by jlliagre
pkginfo
prodreg
pkgrm then pkgadd

That works, thanks, and i'll give pkg-get a look soon

Quote:

Meaning you're logged as root, regular users' PATH is just /usr/bin by default.
It shouldn't, /usr/local/bin is not an allowed directory for freewares under SVR4/Solaris standards.
wget is normally in /usr/sfw/bin.
I found alot of the programs i was looking for in /usr/sfw/bin, thanks. Shall i avoid using packages from sunfreeware.com then? because it installs them to /usr/local/

Quote:

What scares you in /etc/profile ?
breaking it with bash specific constructions :)
I'm just put off with the fact with
- I can't press backspace to delete, it displays ^H. The delete button displays ^[[3~ (also up/down arrows)
- I can't use the tab button to complete my command name
- i can't display the current dir i'm in before the #
- i miss the good ol' colors =/

I mean i know how to sort these out in bash, but like you said, i don't want to break the /etc/profile.

EDIT:
=======
The default PATH, that's in /etc/default/login, right?
Thanks alot for your help.

jlliagre 05-06-2005 05:10 AM

Quote:

Shall i avoid using packages from sunfreeware.com then? because it installs them to /usr/local/
From "man filesystem":
/usr/local
Not part of the SVR4-based Solaris distribution. The
/usr directory is exclusively for software bundled
with the Solaris operating system. If needed for stor-
ing machine-local add-on software, create the direc-
tory /opt/local and make /usr/local a symbolic link to
/opt/local. The /opt directory or filesystem is for
storing add-on software to the system.
Quote:

I'm just put off with the fact with
- I can't press backspace to delete, it displays ^H. The delete button displays ^[[3~ (also up/down arrows)
??
in what context ?
I do not experience that while running bash under Solaris 10, backspace sends ^H, which is right, and delete sends ascii 127, which also the right code.
Quote:

- I can't use the tab button to complete my command name
Yep, that's a bash feature.
Quote:

- i can't display the current dir i'm in before the #
You can do that with ksh too.
Quote:

- i miss the good ol' colors =/
Colors have nothing to do with the shell, but with the terminal. I do have colors with sh, ksh and bash.
Quote:

The default PATH, that's in /etc/default/login, right?
yes. There's another for shell launched by "su" in /etc/default/su

xushi 05-06-2005 12:18 PM

Quote:

Originally posted by jlliagre
From "man filesystem":
/usr/local
Not part of the SVR4-based Solaris distribution. The
/usr directory is exclusively for software bundled
with the Solaris operating system. If needed for stor-
ing machine-local add-on software, create the direc-
tory /opt/local and make /usr/local a symbolic link to
/opt/local. The /opt directory or filesystem is for
storing add-on software to the system.
Thank you for that,

Quote:

??
in what context ?
I do not experience that while running bash under Solaris 10, backspace sends ^H, which is right, and delete sends ascii 127, which also the right code.
When i open a terminal in Solaris, or even when i SSH from my laptop into the server, it starts with /bin/sh, and not bash shell. That's why i was asking if i can just automatically use bash instead, but nevermind, i don't mind typing 'bash' everytime i login.


Quote:

Colors have nothing to do with the shell, but with the terminal. I do have colors with sh, ksh and bash.
If i decide to create a .bashrc file for root, where would i stick it? in the / folder?

Quote:

yes. There's another for shell launched by "su" in /etc/default/su
I had to also do the same thing with SUPATH too. Thanks =)

I'm slowly getting there =) i appreciate all your help.

jlliagre 05-06-2005 01:24 PM

Quote:

When i open a terminal in Solaris, or even when i SSH from my laptop into the server, it starts with /bin/sh, and not bash shell.
This is not a property of the system, but an attribute of the user account you use (last field in /etc/passwd for that user).
Quote:

That's why i was asking if i can just automatically use bash instead, but nevermind, i don't mind typing 'bash' everytime i login.
As I told you already, feel free to set non root account's shell to whatever is wanted with the "passwd -e" command.
Leave root shell as is, and create an alternate root accout like this should you want it:
Code:

bashroot:x:0:1:Super-User with bash shell and a home directory:/export/home/root:/bin/bash
Then create its home dir and give it a password:
Code:

mkdir /export/home/root
pwconv
passwd bashroot

and you are set.

Quote:

If i decide to create a .bashrc file for root, where would i stick it? in the / folder?
That's correct, and somewhat controversial. My "bashroot" suggestion would overcome this.

However, I must say it is a bad habit to customize the root account, and use it as general purpose login name.
Better sticking to a non privileged user, and use only the root account (or better zsudo/RBAC) only for
tasks really needing it.

jlliagre 05-09-2005 07:21 AM

Backspace & delete problem fixed !
 
Quote:

I'm just put off with the fact with
- I can't press backspace to delete, it displays ^H. The delete button displays ^[[3~ (also up/down arrows)
I just experienced the same issue not with JDS, but with a previous release of gnome.

In fact, this has nothing to do with Solaris but is a "feature" of the terminal emulator (gnome-terminal).

To fix it, go to "Edit/Current Profile/ Compatibity" and set backspace to send backspace (^H) and delete to send ascii DEL, and you're set.

xushi 05-10-2005 01:01 PM

Sorry for the late reply, i was busy with my finals.

Thanks alot for the help, you've made my move into solaris even easier than what i anticipated in the beginning. I probably might have a fwe more questions now and then, but i'll do my research before asking first.. =)

As for the CLI, it turns out this was all happening because i was using Eterm on my laptop when ssh-ing into the server.

xushi 05-10-2005 01:45 PM

Alright, i must ask :)

I'm becoming quite interested with pkg-get, but there are a few things that are worrying me about it..

- The FTP/HTTP sites its downloading the packages from, its downloading it form a folder called 5.8. Does that mean solaris os 5.8?

pkg-get doesn't seem to see the programs i already have installed.. I told it to install mysql4, and it went on to download and install openSSL, Perl and a few more packages..

Originally, i have
Perl 5.8.4 -> SUNWperl584core, but it installed perl > CSWperl
same with openSSL
I already have SUNWopensslr, and it installed CSWossl.

Is it normal? Can i trust it with the programs its installing to /opt/csw ? Shall i remove the SUNW ones ? or am i starting to mess up my system here?

jlliagre 05-11-2005 03:55 AM

Quote:

- The FTP/HTTP sites its downloading the packages from, its downloading it form a folder called 5.8. Does that mean solaris os 5.8?
It does. But nevermind, Solaris is maintaining, in fact guaranteeing, upward compatibility from version 7, 8, and 9 upward, so there's no risk with it.

Quote:

pkg-get doesn't seem to see the programs i already have installed.. I told it to install mysql4, and it went on to download and install openSSL, Perl and a few more packages..

Originally, i have
Perl 5.8.4 -> SUNWperl584core, but it installed perl > CSWperl
same with openSSL
I already have SUNWopensslr, and it installed CSWossl.

Is it normal?
It is probably subject to discussion, but is the way blastwave maintainers have designed their project.
http://www.blastwave.org/standards/layout.php
They try to avoid version conflicts by building an isolated "freeware ecosystem" under /opt/csw and ignoring other freewares that may have been installed elsewhere.
One other side effect of this way of doing is that /opt/csw can be NFS shared easily.
Quote:

Can i trust it with the programs its installing to /opt/csw ?
As much as you trust other open source projects.
Quote:

Shall i remove the SUNW ones ?
You're free to do so, but need not if your are not disk space constrained.
Quote:

or am i starting to mess up my system here?
You aren't.

xushi 05-11-2005 06:17 PM

Hmm, i;m probably going to end up doing a minimal installation of Solaris. Installing Gaim wants me to also install some 30 programs, and i from what i see pkg-get provides more up to date software, and looks good enough to use for all my apps.

jlliagre 05-12-2005 02:49 AM

What's that ?
Quote:

Naqql fu2aduka 7aithu shi2ta minal hawa. Wamal 7obbu illa lil 7abib el awwali.

xushi 05-12-2005 03:15 AM

Heh, first to ask.. It's an arabian quote. I'm not that good in translation, but it means something like
Quote:

Move around your heart between whichever loves you choose. But what's true love except first love.

dav_y2k 10-02-2006 10:52 PM

creating .bashrc
 
Hi all,
I am new to SunOS and my version is SunOS 5.8 Generic_117000-03 sun4u sparc SUNW,UltraAX-i2, but I'm used to Linux environment (RedHat) so I use the bash shell.

I'm trying to use tcpdump (no root access but permmision has been granted):

host# ls -l /opt/sfw/sbin/tcpdump
-rwxr-xr-x 1 root sys 401176 Nov 28 2001 /opt/sfw/sbin/tcpdump

but in my working directory when I type tcpdump:

bash-2.03$ tcpdump
bash: tcpdump: command not found
What I want to achieve is to add tcpdump's location to my PATH: /opt/sfw/sbin

also I do not have .bashrc file in my directory, do I create a new .bashrc file? cos I tried to add this path in .cshrc but did not work. what do I do so that when I do this:

bash-2.03$ tcpdump

it works? :scratch:

Thanks in advance

mackdav 10-04-2006 08:55 AM

jlliagre: I am curious, why not just modify the root shell?


All times are GMT -5. The time now is 08:49 AM.