How to use autoyast to install an external package while installing Suse unattended? - suse

Recently I'm learning how to use autoyast to install SUSE unattendly via network with pxe.
My target is --
Unattended install Suse12.4 with pxe -- I have made it successfully with autoyast.xml and pxe
The install not only install Suse only, but also need to install some external packages -- eg. rlwrap and puppet client...
Follow the steps in https://documentation.suse.com/sles/12-SP4/html/SLES-all/configuration.html#CreateProfile-Software -- in Section 4.9.2
So I made a test with rlwrap package only, here are my steps--
Since my repository was http://192.168.95.77/12.4, so I copied rlwrap-0.43-lp152.3.8.x86_64.rpm to http://192.168.95.77/12.4/suse/x86_64 and make sure it's available from http.
Then I modified my autoyast.xml add this at the file end--
<add-on>
<add_on_products config:type="list">
<listentry>
<media_url>http://192.168.95.77/12.4/suse/x86_64/rlwrap-0.43-lp152.3.8.x86_64.rpm</media_url>
<product>rlwrap</product>
<alias>rlwrap</alias>
<product_dir></product_dir>
<priority config:type="integer">99</priority>
<ask_on_error config:type="boolean">false</ask_on_error>
<confirm_license config:type="boolean">false</confirm_license>
<name>eisen-repo-12.4</name>
</listentry>
</add_on_products>
</add-on>
Then I tested with a new VM, -- then I found this VM was successfully installed Suse12.4 again, But that rlwrap package was not installed and there's no error message found in installation.

Find the solution -- the init.sh part in the autoyast.xml can do it.
I wrote it like this --
<scripts>
<init-scripts config:type="list">
<script>
<debug config:type="boolean">true</debug>
<feedback config:type="boolean">false</feedback>
<filename>init.sh</filename>
<interpreter>shell</interpreter>
<location><![CDATA[]]></location>
<notification>customer initialization</notification>
<source><![CDATA[
#!/bin/bash
touch /tmp/flag
rpm --import http://192.168.95.77/puppet7/repodata/repomd.xml.key 2>&1 >> /tmp/flag
zypper addrepo -f http://192.168.95.77/puppet7 eisen-repo-puppet7 2>&1 >> /tmp/flag
zypper install -y rlwrap 2>&1 >> /tmp/flag
zypper install -y puppet-agent 2>&1 >> /tmp/flag
]]></source>
</script>
</init-scripts>
</scripts>
Then the 3rd party packages are installed successfully.

Related

Installing MySQL and MySQLWorkbench In Offline Red Hat 7 Machine

I am trying to install mysql workbench on a system without network. I downloaded the mysql-workbench-community, mysql-community-{server, client, common, libs} which were noted in the "Installing RPM Packages" section of MySQL Install Manual. It states that these are the standard rpm packages needed for a basic functional install of mysql community. So with that I downloaded all the rpm packages and attempted to manually install each using:
sudo rpm -ivh mysql-community-package-name.rpm
Unfortunately I keep getting dependency errors. I found this link to obtain all the dependencies for a package. So on my second attempt I ran the following:
Repoquery -R --resolve --recursive mysql-community-server | xargs -r yumdownloader
Which gave me about 100 rpm packages. I transferred them onto my machine and unfortunately more dependencies like mysql-connectors-community and mysql-=tools-community came up which were never documented or mentioned as dependencies with the script.
What am i doing wrong? Is there a way to download all the rpms and bundle them together as a custom RPM in the future? I see ubuntu has a apt-offline command mentioned here. Is there a similar method I can apply for redhat?
Update1:
I have an idea to create a container rhel7 instance, mounting /root/tmpkg and running this example. But is there another way I should consider?

NaCl helper process running without a sandbox! error when running npm tests

I'n having a problem when running some npm test. The error I'm receiving is: "NaCl helper process running without a sandbox!", which is true, as I'm running the browser with the "--no-sandbox" option. I have to run this option due to the fact that the browser runs as root, and I don't have an option to run it a different user at all(it's a docker image).
Can anyone please help me to sort it out?
P.S I'm installing the browser in the following way:
RUN apt-get update
RUN apt-get install -y nodejs npm
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN sh -c 'echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
RUN apt-get install -y apt-transport-https
RUN apt-get update
RUN apt-get install -y google-chrome-stable
Thanks in advance!
This error message...
NaCl helper process running without a sandbox!
...implies that you have no setuid sandbox in your system, hence the program was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.
Solution
A quick solution will be, if you want to run Chrome and only use the namespace sandbox, you can set the flag:
--disable-setuid-sandbox
This flag will disable the setuid sandbox (Linux only). But if you do so on a host without appropriate kernel support for the namespace sandbox, Chrome will not spin up. As an alternative you can also use the flag:
--no-sandbox
This flag will disable the sandbox for all process types that are normally sandboxed.
Example:
chromeOptions: {
args: ['--disable-setuid-sandbox', '--no-sandbox']
},
You can find a detailed discussion in Security Considerations - ChromeDriver - Webdriver for Chrome
Deep dive
As per the documentation in Linux SUID Sandbox Development google-chrome needs a SUID helper binary to turn on the sandbox on Linux. In majority of the cases you can install the proper sandbox for you using the command:
build/update-linux-sandbox.sh
This program will install the proper sandbox for you in /usr/local/sbin and tell you to update your .bashrc if required.
However, there can be some exceptions as an example, if your setuid binary is out of date, you will get messages such as:
Running without the SUID sandbox!
Or
The setuid sandbox provides API version X, but you need Y
You are using a wrong version of the setuid binary!
In these cases, you need to:
Build chrome_sandbox whenever you build chrome (ninja -C xxx chrome chrome_sandbox instead of ninja -C xxx chrome)
After building, execute update-linux-sandbox.sh.
# needed if you build on NFS!
sudo cp out/Debug/chrome_sandbox /usr/local/sbin/chrome-devel-sandbox
sudo chown root:root /usr/local/sbin/chrome-devel-sandbox
sudo chmod 4755 /usr/local/sbin/chrome-devel-sandbox
Finally, you have to include the following line in your ~/.bashrc (or .zshenv):
export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox
If you are using karma to run your tests, make sure you are using ChromeHeadless as the browser on karma.conf.js

How to install expect and tcl on linux RHEL server 6.5

I am new to linux and i have few expect scripts to execute. I read few blogs on how to install expect and tcl. The command i am trying is
sudo yum install expect
sudo yum install tcl
I am getting
No package expect available
No package tcl available
It seems RHEL should have tcl and expect prebuilt but this is not the case in my version of linux.
How should i proceed from here ?
Help will be highly appreciated..Thanks :)
Install the development tools:
yum groupinstall "Development tools"
then
./configure
make
make install
should be good to go.
Have you tried this? In this way you will be able to compile from source.
1) Download the expect package from the below link
http://sourceforge.net/projects/expect/
2) Install the required dependecy packages "Tcl/Tk" language toolkit
# yum install tcl
3) Install the "expect" package using the below commands
# tar -zxvf expectx.xx.tar.gz
# ./configure
# make
# make install
I tried the following links and it worked for me. http://www.linuxfromscratch.org/blfs/view/svn/general/tcl.html http://www.linuxfromscratch.org/blfs/view/svn/general/expect.html
Try ActiveTcl from ActiveState:
http://downloads.activestate.com/ActiveTcl/releases/8.6.4.1/ActiveTcl8.6.4.1.299124-linux-x86_64-threaded.tar.gz
You can add EPEL Repo
On 32-Bit -
# rpm -Uvh http://epel.mirror.net.in/epel/6/i386/epel-release-6-8.noarch.rpm
On 64-Bit -
# rpm -Uvh http://epel.mirror.net.in/epel/6/x86_64/epel-release-6-8.noarch.rpm
and then you can use yum to install.
Also you can compile from source or get from ActiveState like in previous answers.

Deploy meanjs into cloud9 IDE

I'm starting to develop with the stack meanjs. I'm using Cloud9 as a cloud IDE (I need its team functionalities). I tried previously to install mean in my local machine successfully. My problem arise when I try to install it in my cloud9 workspace. Does anybody know how to do it? I tried this https://github.com/meanjs/mean/issues/4 but it's not working.
Thank you so much in advance.
What you need to do is just following the steps that I listed in command line. I found the solution from youtube.
https://www.youtube.com/watch?v=RQ1HqBjT890
First, you need to utilize mongoDB. Type following:
echo "export NODE_PATH=$NODE_PATH:/home/ubuntu/.nvm/v0.10.35/lib/node_modules" >> ~/.bashrc && source ~/.bashrc
mkdir data
echo 'mongod --bind_ip=$IP --dbpath=data --nojournal --rest "$#"' > mongod
chmod a+x mongod
./mongod
At this point, your mongoDB server is running. Then, you need to install node package manager, update it. Also, install yo generator.
npm install npm -g
npm update
npm install -g yo
npm install -g generator-meanjs
Then, create your project directory, create your mean app.
mkdir myMeanProject
cd myMeanProject
yo meanjs
Open a new terminal window, and run server.
cd myNewProject
grunt

Automatically install build dependencies prior to building an RPM package

I am trying to build a .rpm package. I have just followed the steps to do that. Till now all steps were gone fine but now i just stuck with this step. I just ran the following command and got this error:
rpmbuild -ba asterisk.spec
error: Failed build dependencies:
gtk2-devel is needed by asterisk-1.8.12.2-1.fc15.x86_64
libsrtp-devel is needed by asterisk-1.8.12.2-1.fc15.x86_64
[... more ...]
freetds-devel is needed by asterisk-1.8.12.2-1.fc15.x86_64
uw-imap-devel is needed by asterisk-1.8.12.2-1.fc15.x86_64
I am using fedora-15. How to resolve this error?
How I do install all depencencies during installation of src.rpm package. Is it possible?
You can use the yum-builddep command from the yum-utils package to install all the build dependencies for a package.
The arguments can either be paths to spec files, paths to source RPMs or the names of packages which exist as source RPMs in a configured repository, for example:
yum-builddep my-package.spec
or
yum-builddep my-package.src.rpm
The same thing can be achieved on newer versions of Fedora that use dnf as their package manager by making sure that dnf-plugins-core is installed and then doing:
dnf builddep my-package.spec
or
dnf builddep my-package.src.rpm
yum-builddep doesn't seem to work if the mirror you use doesn't serve source RPMs. This may not handle all cases, but it usually works for me:
sudo yum install -y $(<rpmbuild> | fgrep 'is needed by' | awk '{print $1}')
where <rpmbuild> is your rpmbuild command (e.g., rpmbuild -ba foo.spec).
On PHP building - especially phpbrew I used dnf builddep php, it worked.