Tag Archives: solaris

Unable to contact valid package repository Encountered the following error(s)

pkg refresh
pkg: 0/1 catalogs successfully updated:

Unable to contact valid package repository
Encountered the following error(s):
Unable to contact any configured publishers.
This is likely a network configuration problem.
1: Invalid contentpath dictionary update sequence element #1 has length 1; 2 is required: Unable to parse repository’s versions/0 response.
2: Invalid contentpath dictionary update sequence element #1 has length 1; 2 is required: Unable to parse repository’s versions/0 response.
3: Invalid contentpath dictionary update sequence element #1 has length 1; 2 is required: Unable to parse repository’s versions/0 response.
4: Invalid contentpath dictionary update sequence element #1 has length 1; 2 is required: Unable to parse repository’s versions/0 response.

You should check your default gateway, like this: netstat -nr, gateway should be reachable.

solaris ips

Image Packaging System (IPS)

pkg Packaging client
pkgrepo Repository management utility
pkgrecv Content retrieval utility
pkgsend Package creation and publication
pkgdiff Package manifest comparing utility
pkgmerge Package merging utility
pkgmogrify Package manifest transmogrifying utility
pkgfmt Package manifest formatting utility
pkgsign Package signing utility
pkglint Package linting utility

solaris create free like program

vim /usr/bin/free

#!/usr/bin/ksh

# Available memory
memory=`prtconf | grep Memory | head -1 | awk 'BEGIN {FS=" "} {print $3}'`
gb_memory=`echo "scale=2; $memory/1024" | bc -l`

# Free memory
pagesize=`pagesize`
kb_pagesize=`echo "scale=2; $pagesize/1024" | bc -l`
sar_freemem=`sar -r 1 1 | tail -1 | awk 'BEGIN {FS=" "} {print $2}'`
gb_freemem=`echo "scale=2; $kb_pagesize*$sar_freemem/1024/1024" | bc -l`

# Used Memory
gb_usedmem=`echo "scale=2; $gb_memory-$gb_freemem" | bc -l`

# Conclusion
echo "Avai Mem: $gb_memory GB"
echo "Free Mem: $gb_freemem GB"
echo "Used Mem: $gb_usedmem GB"
~

solaris free like

echo ::memstat | mdb -k

Page Summary Pages Bytes %Tot
----------------- ---------------- ---------------- ----
Kernel 86154 336.5M 22%
Guest 0 0 0%
ZFS Metadata 18383 71.8M 5%
ZFS File Data 121791 475.7M 31%
Anon 41885 163.6M 11%
Exec and libs 1225 4.7M 0%
Page cache 5807 22.6M 1%
Free (cachelist) 4619 18.0M 1%
Free (freelist) 113239 442.3M 29%
Total 393103 1.4G

solaris: top vs prstat

prstat -Z:

PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
2700 root 11M 3376K cpu0 59 0 0:00:00 0.1% prstat/1
2696 root 53M 43M stop 59 0 0:00:00 0.0% mdb/1
854 root 19M 4128K run 59 0 0:00:02 0.0% sshd/1
2531 root 13M 2840K sleep 59 0 0:00:00 0.0% nscd/36
855 root 10M 2344K run 49 0 0:00:00 0.0% bash/1
580 root 4132K 1976K sleep 59 0 0:00:00 0.0% hald-addon-acpi/1
543 daemon 3432K 1220K sleep 59 0 0:00:00 0.0% rpcbind/1
541 root 4180K 2032K sleep 59 0 0:00:00 0.0% hald-runner/1
289 netadm 12M 3904K sleep 59 0 0:00:00 0.0% nwamd/8
141 root 9892K 1324K sleep 59 0 0:00:00 0.0% syseventd/17
471 root 8828K 668K sleep 59 0 0:00:00 0.0% iscsid/2
298 root 3360K 1280K sleep 59 0 0:00:00 0.0% vbiosd/3
336 root 10M 2468K sleep 59 0 0:00:00 0.0% picld/40
308 root 2652K 1144K sleep 59 0 0:00:00 0.0% pfexecd/3
303 root 9520K 1104K sleep 59 0 0:00:00 0.0% dhcpagent/1
177 root 14M 5096K sleep 59 0 0:00:00 0.0% devfsadm/7
71 daemon 17M 5492K sleep 59 0 0:00:00 0.0% kcfd/3
67 netadm 4504K 2552K sleep 59 0 0:00:00 0.0% ipmgmtd/5
152 root 15M 2844K sleep 59 0 0:00:00 0.0% rad/4
588 root 4136K 2308K sleep 59 0 0:00:00 0.0% in.ndpd/1
116 daemon 2368K 672K sleep 59 0 0:00:00 0.0% utmpd/1
86 root 9764K 888K sleep 59 0 0:00:00 0.0% in.mpathd/1
49 root 4168K 2200K sleep 59 0 0:00:00 0.0% dlmgmtd/5
293 root 3584K 1380K sleep 59 0 0:00:00 0.0% dbus-daemon/1
39 netcfg 3696K 2360K sleep 59 0 0:00:00 0.0% netcfgd/4
305 root 2732K 1064K sleep 60 -20 0:00:00 0.0% zonestatd/5
15 root 21M 19M sleep 59 0 0:00:32 0.0% svc.configd/24
13 root 24M 16M sleep 59 0 0:00:06 0.0% svc.startd/12
500 root 8904K 832K sleep 59 0 0:00:00 0.0% cron/1
9 root 0K 0K sleep 99 -20 0:00:00 0.0% postwaittq/1
ZONEID NPROC SWAP RSS MEMORY TIME CPU ZONE
0 63 207M 157M 10% 0:00:46 0.1% global

Total: 63 processes, 435 lwps, load averages: 0.02, 0.03, 0.06

solaris 11 update

pkg update
Packages to update: 8
Create boot environment: No
Create backup boot environment: Yes
DOWNLOAD PKGS FILES XFER (MB) SPEED
Completed 8/8 52/52 3.1/3.1 319k/s

PHASE ITEMS
Removing old actions 36/36
Installing new actions 42/42
Updating modified actions 35/35
Updating package state database Done
Updating package cache 8/8
Updating image state Done
Creating fast lookup database Done
Reading search index Done
Updating search index 8/8
Updating package cache 1/1

—————————————————————————
NOTE: Please review release notes posted at:

http://www.oracle.com/pls/topic/lookup?ctx=solaris11&id=SERNS

solaris 11 enable root ssh

vi /etc/ssh/sshd_config
PermitRootLogin yes

vi /etc/default/login
#CONSOLE=/dev/console

#Remove ā€œ;type=roleā€ from the root entry in /etc/user_attr like this:
usermod -K type=normal root

svcadm restart svc:/network/ssh:default

Now we are in:

Last login: Tue Jun 16 11:05:14 2015
Oracle Corporation SunOS 5.11 11.2 June 2014