You are not logged in.

#1 2016-01-27 12:09:55

andrekp
Member
Registered: 2013-01-06
Posts: 38

How to install packer

Could someone please give me a step-by-step of how to install packer on a new system.  All of the directions I have been able to find are no longer valid and frankly, I just can't figure it out with any useful clarity.

Pretend that I am stupid, give it to me step by step.

Thanks,
Andre

Offline

#2 2016-01-27 17:14:40

oliver
Administrator
Registered: 2010-11-04
Posts: 2,209

Re: How to install packer

$ cd
$ sudo pacman -S --needed base-devel git
$ git clone https://aur.archlinux.org/packer.git
$ cd packer
$ makepkg -is

The steps mean:
1) Go to your home directory
2) Install any missing pkgs that might be required in order to compile apps from AUR
3) Clone the packer code
4) Change to the newly created packer directory
5) Create a packer pkg, install any dependencies (from the repo) and install the packer pkg

Optionally:

$ cd 
$ rm -rf ./packer.git

6) back to your home dir
7) remove the source

Be aware that AUR packages will not be placed in /var/cache/pacman/pkg so you will be removing the actual "pkg" file by running step 7 (but this does not mean uninstalling it)

Offline

#3 2016-01-28 00:27:56

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,831

Re: How to install packer

Have made topic sticky as this information may help other archbang users.


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#4 2016-01-28 08:16:15

andrekp
Member
Registered: 2013-01-06
Posts: 38

Re: How to install packer

Thanks Oliver.  It was the "git clone" part that I needed (I don't usually work with git and nothing else I saw had that part).

FYI: I can't say that any of this works, as I gave up on the whole process after numerous issues both during (for example, it took fully five attempts  to get the unstable installer to actually run mkinitcpio and leave me a booted system!), and post install, left me of the opinion it was just easier to install arch manually (which I've done many times), or via Antergos (which is what I did - and it gave me yaourt by default).

Seriously, I used to love AB, but I think it is just too striped out in its current form.  Not to at LEAST have packer just seems ridiculous.  It's just easier now to install "the Arch way," which isn't that hard, or chose another Arch-based distro that gives a fully usable system if that's what you want.  At least with "the Arch way" you know the installer IS doing things like running mkinitcpio, because the installer is YOU.

Sorry if this sounds negative, it's 100% meant to be a constructive comment.

Thanks.

Offline

#5 2016-01-28 10:22:52

oliver
Administrator
Registered: 2010-11-04
Posts: 2,209

Re: How to install packer

A lot of the guides are probably out-of-date since the move to AUR4

I don't think anyone is opposed to adding packer but it's useless without base-devel.  Adding base-devel would add 250mb (at a guess) to the ISO size (mainly gcc)

Offline

#6 2016-01-29 01:22:14

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,831

Re: How to install packer

We used to ship ArchBang with packer but you need to install base-devel (live) for it to be of any real use. The way I went around that was too install script post install and then user would simply install base-devel on a working system. Have stripped out quite a few things but what do really need live? The whole point of pacman is to allow you to install what you want.

Would prefer not to ship with an installer as it is not that difficult to install Arch anyway...

Arch-install-scripts are included if a user wishes to do a real install.

There are many other arch distros out there, we are a small team who run ArchBang in our spare time to try to help people get started with Arch.


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#7 2016-01-30 03:52:02

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,831

Re: How to install packer

@oliver maybe adding a small script (post install)?

#!/bin/bash
# simple packer install script
# based on code by oliver 
# by Mr Green
# Beer license

# create a drirectory in /tmp
cd $(mktemp -d)

# install base-devel and git
pacman -S --needed base-devel git --noconfirm

# grab PKGBUILD from aur
git clone https://aur.archlinux.org/packer.git

# Build and install packer
cd packer
makepkg -is

Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#8 2016-01-30 08:07:57

oliver
Administrator
Registered: 2010-11-04
Posts: 2,209

Re: How to install packer

Could so it as a script but I think the person wanting to compile from AUR probably shouldn't have it obfuscated.  One compromise which may be overkill would be to do something like this:

echo 'Creating a temporary directory in /tmp using "cd $(mktemp -d)"'
cd $(mktemp -d)
sleep 3
echo 'Installing any missing packages needed for compilation using 'pacman -S --needed base-devel git --noconfirm'"
pacman -S --needed base-devel git --noconfirm

And so on... just so people know what's happening and can understand the procedure

Offline

#9 2016-01-30 08:17:53

eric
Member
Registered: 2015-07-10
Posts: 231
Website

Re: How to install packer

an idea : make it as module like arch hook (in philosophy i mean). downloaded and install it directly following oliver post.
If you create a general script with functions for adding at the system some features more, you can applicate it for want do you want or need in the future.
like this schema.

functions build structure (){} #directory needed for the scripts and package
functions pacman install (){} #check and install needed thing for processing
functions fetch source(){} #fecth the source for every app needed, so git .db .tar.xz and so one
functions compilation(){} #compile the source
functions install package # install package with pacman or packer yoaurt and so one

all this functions have necessary log output on screen or can be call by a shell menu

then people can download the modules like pkgbuild and install it smile
just an idea smile

Last edited by eric (2016-01-30 08:24:44)


Obarun : free to control your system

Offline

#10 2016-01-30 09:01:45

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,831

Re: How to install packer

@oliver certainly can do it that way, do have to write command twice? better would be to output command run too terminal...

@eric need to think about it and see how it would work for us.


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#11 2016-01-30 09:57:38

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,831

Re: How to install packer

cho "Create a directory for build in /tmp"
echo "cd $(mktemp -d)"
cd $(mktemp -d)

echo "Install required packages and git"
echo "pacman -S --needed base-devel git --noconfirm"
pacman -S --needed base-devel git --noconfirm 

echo "Fetch PKGBUILD for packer from Aur"
git clone https://aur.archlinux.org/packer.git

echo "Build and install packer"
cd packer
makepkg -is

Must be a better way?

Maybe commands in a array or loop.... like to echo command to terminal before running it....


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#12 2016-02-01 11:53:03

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,831

Re: How to install packer

Version 2

#!/bin/bash
# simple packer install script
# based on code by oliver 
# by Mr Green
# Beer license

echo "Create a directory for build in /tmp"
echo "cd $(mktemp -d)"
cd $(mktemp -d)

echo "Install required packages and git"
echo "pacman -S --needed base-devel git --noconfirm"
pacman -S --needed base-devel git --noconfirm

echo "Fetch PKGBUILD for packer from Aur"
echo "git clone https://aur.archlinux.org/packer.git"
git clone https://aur.archlinux.org/packer.git

echo "Build and install packer"
echo "makepkg -is"
cd packer
makepkg -is

Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#13 2016-02-01 22:38:30

eric
Member
Registered: 2015-07-10
Posts: 231
Website

Re: How to install packer

suggestion smile

#!/bin/bash
# simple packer install script
# based on code by oliver 
# by Mr Green
# Beer license

if (( EUID == 0 )); then
     echo " You must be run this script with user privilegies" # build a package with root privilegies is not allowed
     exit 1
fi

echo "Create a directory for build in /tmp"
echo "mkdir /tmp/packer"
mkdir -p ~/tmp/packer
cd ~/tmp/packer

echo "Install required packages and git"
echo "pacman -S --needed base-devel git --noconfirm"
pacman -S --needed base-devel git --noconfirm

echo "Fetch PKGBUILD for packer from Aur"
echo "git clone https://aur.archlinux.org/packer.git"
git clone https://aur.archlinux.org/packer.git

echo "Build and install packer"
echo "makepkg -is"
cd packer
makepkg -is

echo "Removing the tmp directory" # clean installation before stopping scripts
rm -r ~/tmp/packer

Last edited by eric (2016-02-01 22:40:30)


Obarun : free to control your system

Offline

#14 2016-04-06 01:49:21

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,831

Re: How to install packer

Problem I have with script now is that although I can install required packages, making the package fails, makepkg does not work as root!


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#15 2016-04-06 02:47:28

eric
Member
Registered: 2015-07-10
Posts: 231
Website

Re: How to install packer

that is why my scripts create a tempory user. if i want install package with pacman the scripts use root user, if i want to install from AUR the scripts use a tempory user. If your installer is only  used with your iso, you know the user (ablive), so you can change permissions with sudo like this

sudo -u ablive packer blablabla

or

sudo -u ablive makepkg -is

depends of your purpose
if your installer is used onto an arch system, it's a little more complex because you don't know the name of classic user. Well, you have two choice : Asking for the user name (the simplier way) used for the scripts or create a tempory user deleted at the end of the scripts for example :

## 		Create temporary users for yaourt

user_tmp(){
	if ! [[ $(awk -F':' '{ print $1}' /etc/passwd | grep usertmp) ]]; then ### check if user exist or not
		echo_display " Create a temporary user needed for the scripts"
			if [[ -e /etc/sudoers ]]; then ##### a little paranoid here, make sure sudo exist on system
				useradd -m -g users -G "wheel,disk,storage,optical,floppy,adm,network" -s /bin/bash usertmp || die " Impossible to create user : usertmp" #### create the user
				echo "%usertmp ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers ### permit to use all command without asking for password
			 else
				echo "${bred}==>> The file /etc/sudoers doesn't exists,"
				echo_notvalid " Installing sudo package"
				pacman -S sudo #### install sudo if doesn't exist then relaunch the functions to create user
				user_tmp
			fi
	fi
}

then when i exit of the scripts i remove the user

rem_usertmp(){
	echo_display " Removing user : usertmp"
	userdel -r usertmp
	sed -i '/usertmp/d' /etc/sudoers
}

i have a special functions called when the scripts exit or crash or stopped by user. in this functions i do all the stuff to clean the installation properly e.g removing the tempory user

clean_install(){
	
	doing stuff

	if [[ $(awk -F':' '{ print $1}' /etc/passwd | grep usertmp) >/dev/null ]]; then ### check if user exist or not
		echo_valid " Removing user usertmp"
		rem_usertmp &>/dev/null #### remove it
	fi
	doing another stuff

	exit
}

the functions clean_install is called by the command "trap" (a very useful command) like this

trap "clean_install" EXIT ERR QUIT KILL STOP INT #### if the scripts receive a EXIT ERR QUIT KILL STOP INT signal the script call the clean_install functions, it's mean if the user type CTRL+C the command trap launch the clean install functions :)

Sorry if all this stuff is useless for you

Last edited by eric (2016-04-06 02:56:54)


Obarun : free to control your system

Offline

#16 2016-04-06 03:07:59

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,831

Re: How to install packer

Might be better to run as user then simply add 'sudo' to allow install of base-devel (not the best option) this will mean that makepkg will run as normal user. Testing now

!/bin/bash
# simple packer install script
# based on code by oliver 
# by Mr Green
# Beer license


echo "Create a directory for build in /tmp"
echo "cd $(mktemp -d)"
cd $(mktemp -d)

echo "Install required packages and git"
echo "pacman -S --needed base-devel git --noconfirm"
sudo pacman -S --needed base-devel git --noconfirm

echo "Fetch PKGBUILD for packer from Aur"
echo "git clone https://aur.archlinux.org/packer.git"
git clone https://aur.archlinux.org/packer.git

echo "Build and install packer"
echo "makepkg -is"
cd packer
makepkg -is

This does work, as we are only using pacman to install required packages. .. . . . .

@eric I like your code wink x


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#17 2016-05-18 11:21:25

igorka
Member
From: italy
Registered: 2012-05-21
Posts: 85

Re: How to install packer

Does it work also for openrc?

Offline

#18 2016-05-18 14:58:09

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,831

Re: How to install packer

Do not see why not....


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#19 2016-05-19 09:59:20

igorka
Member
From: italy
Registered: 2012-05-21
Posts: 85

Re: How to install packer

I too...

 [igor@archbang ~]$ ./packer_install 
Create a directory for build in /tmp
cd /tmp/tmp.zQNQlXFQfy
Install required packages and git
pacman -S --needed base-devel git --noconfirm
:: There are 26 members in group base-devel:
:: Repository core
   1) autoconf  2) automake  3) binutils  4) bison  5) fakeroot  6) file
   7) findutils  8) flex  9) gawk  10) gcc  11) gettext  12) grep  13) groff
   14) gzip  15) libtool  16) m4  17) make  18) pacman  19) patch
   20) pkg-config  21) sed  22) sudo  23) texinfo  24) util-linux  25) which
:: Repository openrc-eudev
   26) util-linux-nosystemd

Enter a selection (default=all): 
warning: file-5.26-2 is up to date -- skipping
warning: findutils-4.6.0-1 is up to date -- skipping
warning: flex-2.6.0-3 is up to date -- skipping
warning: gawk-4.1.3-1 is up to date -- skipping
warning: gettext-0.19.7-1 is up to date -- skipping
warning: grep-2.25-1 is up to date -- skipping
warning: groff-1.22.3-6 is up to date -- skipping
warning: gzip-1.8-1 is up to date -- skipping
warning: m4-1.4.17-1 is up to date -- skipping
warning: pacman-5.0.1-3 is up to date -- skipping
warning: sed-4.2.2-3 is up to date -- skipping
warning: sudo-1.8.16-1 is up to date -- skipping
warning: texinfo-6.1-3 is up to date -- skipping
warning: which-2.21-1 is up to date -- skipping
warning: util-linux-nosystemd-2.27-1 is up to date -- skipping
warning: git-2.8.2-1 is up to date -- skipping
resolving dependencies...
looking for conflicting packages...
:: util-linux and util-linux-nosystemd are in conflict (util-linux-ng). Remove util-linux-nosystemd? [y/N] 
error: unresolvable package conflicts detected
error: failed to prepare transaction (conflicting dependencies)
:: util-linux and util-linux-nosystemd are in conflict
Fetch PKGBUILD for packer from Aur
git clone https://aur.archlinux.org/packer.git
Cloning into 'packer'...
remote: Counting objects: 9, done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 9 (delta 1), reused 9 (delta 1)
Unpacking objects: 100% (9/9), done.
Checking connectivity... done.
Build and install packer
makepkg -is
==> ERROR: Cannot find the strip binary required for object file stripping.

Offline

#20 2016-05-19 10:23:45

eric
Member
Registered: 2015-07-10
Posts: 231
Website

Re: How to install packer

a workaround, need mr green aprobation :

pacman -S --needed base-devel git --noconfirm --assume-installed systemd --assume-installed libsystemd

Obarun : free to control your system

Offline

#21 2016-05-19 11:55:05

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,831

Re: How to install packer

One of the problems with using arch without systemd is that at some point something is going to break. Maybe check nosystemd repo for base-devel?

Ok.... run

pacman -S base-devel

Follow instructions, then:

 curl aur.sh > aur

Make it executable

chmod +x aur

Then:

./aur packer

Now install packer once built:

cd packer
pacman -U packer-<blah blah>

Hope that helps...

@eric not sure they are vaild pacman options (if only!)


Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org

Offline

#22 2016-05-19 17:38:34

oliver
Administrator
Registered: 2010-11-04
Posts: 2,209

Re: How to install packer

igorka wrote:

pacman -S --needed base-devel git --noconfirm
:: There are 26 members in group base-devel:
:: Repository core
   1) autoconf  2) automake  3) binutils  4) bison  5) fakeroot  6) file
   7) findutils  8) flex  9) gawk  10) gcc  11) gettext  12) grep  13) groff
   14) gzip  15) libtool  16) m4  17) make  18) pacman  19) patch
   20) pkg-config  21) sed  22) sudo  23) texinfo  24) util-linux  25) which
:: Repository openrc-eudev
   26) util-linux-nosystemd

Enter a selection (default=all):

Looks like you hit <return> for all here but you have I think you need to select everything *but* #24 (which is provided by #26)

Offline

#23 2016-05-19 21:15:24

eric
Member
Registered: 2015-07-10
Posts: 231
Website

Re: How to install packer

@eric not sure they are vaild pacman options (if only!)

obarun@obarun ~ % pacman -S cups --a
option
--arch              -- Set an alternate architecture
--asdeps            -- Install packages as non-explicitly installed
--asexplicit        -- Install packages as explicitly installed
--assume-installed  -- Add virtual package to satisfy dependencies

the assume-installed options works very well mrgreen.

you can install util-linux-nosystemd first then relaunch the scripts, if util-linux declare provides, replaces, conflicts variable to util-linux, pacman do not complain.

Last edited by eric (2016-05-19 21:19:54)


Obarun : free to control your system

Offline

#24 2016-05-19 23:48:07

Mr Green
Administrator
Registered: 2010-11-07
Posts: 6,831

Re: How to install packer

alias pacman='pacman --assume-installed libsystemd --assume-installed systemd'

Comments, suggestions, donations please feel free to contact me mrgreen(at)archbang(dot)org

Offline

Board footer

Powered by FluxBB