Pacman acting up
[ryan@Archbox ~]$ sudo pacman -Syu
:: Synchronizing package databases...
core is up to date
extra is up to date
community is up to date
will stay like that for a long time....sometimes hitting enter, or actually ctrl+C will snap it out of it.....or sometimes just quit.
Pacman.conf
# /etc/pacman.conf
# See the pacman manpage for option directives
# GENERAL OPTIONS
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir = /
#DBPath = /var/lib/pacman/
#CacheDir = /var/cache/pacman/pkg/
#LogFile = /var/log/pacman.log
HoldPkg = pacman glibc
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
# REPOSITORIES
# - can be defined here or included from another file
# - pacman will search repositories in the order defined here
# - local/custom mirrors can be added here or in separate files
# - repositories listed first will take precedence when packages
# have identical names, regardless of version number
#[testing]
#Include = /etc/pacman.d/mirrorlist
[core]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist
[extra]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist
[community]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist
#[unstable]
# Add your preferred servers here, they will be used first
#Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#Server = file:///home/custompkgs
[gnustep]
Server = ftp://blkwidow.lerp.com/pub/mirror/arch/gnustep
#[archlinuxfr]
#Server = http://repo.archlinux.fr/i686
Last edited by rdking (2008-01-31 15:56:45)
sorry ,
close that.....just a misplaced # to cancel out the GNUSTEP repo, that no longer exists....sorry.
Similar Messages
-
Translating pacman for the 4.2 release
Hi everyone!
I plan to make the next pacman release during the week of the 8th of December.
One thing that we need help with is translating all the strings into lots of languages. We have a good teams for many languages, but there are quite a few that have been started and never finished and some potential omissions.
If you would like to help, take a look at our transifex page. https://www.transifex.com/projects/p/archlinux-pacman/ The languages with at least 88% translated will probably get done by the current team, but if you want to help with any less complete language or add a missing one, just apply on the site.
Let me know if you have any questions.That is a really awful string...
In pacman-4.2 you can do "pacman -Syu --assume-installed perl-5.20" and that will make pacman act as if perl-5.20 is already installed. So that is when the "assume installed" entry is passed to the backend.
I'd guess the "assume installed" should really be joint by a hyphen and not translated... I'll change that next release. -
last week i lent my sister my eee 900, running arch. after about an hour of using it she asked me if i would install arch linux on her 2gb surf. set up exactly as mine is, which is openbox , fbpanel, conky, wicd, emesene, xpdf, vlc, gimp, openofffice and pcmanfm.
she is pleased with it , and happily uses it as her main computer. for what typical teen agers do (msn,facebook, and some coursework(even thou she usualy does that on her desktop), etc), i didnt even try to pursuade her or anything like that, she used it for a while, and arch sold it self.
she is pretty hopeless with computers, she knows how to use them, but not how to set up or anything like that (usualy why she ends up geting a virus of sorts) , so now i have set it up as she likes, there is no reason for her to do any tweaks or anything like that.
i have an xp install disk handy if she changes her mind about it .
Last edited by markp1989 (2009-05-24 14:12:08)markp1989 wrote:
Ramses de Norre wrote:Does she update the machine herself?
the install has only been on for a week or so now
im gona avoid updates, unless there is a bug fix that i really need, or a new feature.
also, the surf model she has is only 2gb root drive, which has bout 300mb free, and i dont know how pacman acts if it runs out of space during an update?
You might be better off simply flagging the potential system/soul destroying packages from updating (eg xorg, hal, kernel, drivers etc), while letting the rest update. At the very least, you'll be notified of when there IS an update available, or be let known when another package requires a certain version. As Mr. Elindig said, Pandora's box almost always opens when you leave an update for too long. But of course, up to you mate -
Pacman -Qm no longer working correctly [solved]
I can't get pacman -Qm to work right anymore, when I use it, it just displays pretty much every package I have, like so:
$ pacman -Qm
acl 2.2.39-1
alsa-lib 1.0.13-1
alsa-oss 1.0.12-1
alsa-utils 1.0.13-1
apache 2.2.4-2
apr 1.2.8-1
apr-util 1.2.8-2
aspell 0.60.5-1
asunder 0.1.0-2
aterm 1.0.0-2
atk 1.18.0-2
attr 2.4.32-2
audiofile 0.2.6-3
autoconf 2.61-1
automake 1.10-1
bash 3.2-1
bigreqsproto 1.0.2-1
bin86 0.16.17-1
binutils 2.17-2
bison 2.3-2
bzip2 1.0.4-1
cairo 1.4.2-1
cdparanoia 9.8-4
cdrdao 1.2.2-1
cdrkit 1.1.2-1
clisp 2.41-1
cmake 2.4.6-1
codecs 20061022-1
compositeproto 0.3.1-1
coreutils 6.9-1
cpio 2.7-2
cracklib 2.8.10-3
cups 1.2.10-1
curl 7.15.5-1
cvsup 16.1h-3
cyrus-sasl 2.1.22-3
cyrus-sasl-plugins 2.1.22-4
damageproto 1.1.0-1
db 4.5.20-1
dbus 1.0.2-4
dbus-glib 0.73-1
dcron 3.2-1
desktop-file-utils 0.12-1
dhcpcd 1.3.22pl4-4
dialog 1.0_20060221-1
diffutils 2.8.1-2
divx4linux 6.1.1-1
dmxproto 2.2.2-1
docbook-xml 4.1.2-2
docbook-xsl 1.71.1-2
doom3 1.3.1302-4
dosfstools 2.11-1
e2fsprogs 1.39-2
ed 0.4-1
enchant 1.3.0-1
esd 0.2.37-2
expat 2.0.0-1
faad2 2.5-2
fakeroot 1.5.10-1
fam 2.7.0-9
fbset 2.1-1
file 4.20-1
filesystem 0.8-1
findutils 4.2.30-1
fixesproto 4.0-2
flac 1.1.4-1
flex 2.5.33-1
fontcacheproto 0.1.2-1
fontconfig 2.4.2-1
fontsproto 2.0.2-1
freetype1 1.3.1-3
freetype2 2.3.1-1
fribidi 0.10.7-1
gawk 3.1.5-3
gc 6.8-1
gcc 4.1.2-3
gd 2.0.34-1
gdb 6.6-1
gdbm 1.8.3-3
gen-init-cpio 2.6.17-1
gettext 0.16.1-1
gftp 2.0.18-2
ghostscript 8.15.4-1
gimp 2.2.13-3
glib 1.2.10-6
glib2 2.12.11-1
glibc 2.5-6
glproto 1.4.8-1
gmp 4.2.1-1
gnome-icon-theme 2.18.0-1
gnutls 1.6.1-1
gpm 1.20.1-6
gpodder 0.8.0-1
grep 2.5.1a-2
groff 1.19.2-1
grub 0.97-7
gsfonts 8.11-4
gtk 1.2.10-7
gtk-engines 2.10.0-1
gtk2 2.10.11-2
gtkspell 2.0.11-2
gutenprint 5.0.0-2
gvim 7.0.219-1
gzip 1.3.9-1
heimdal 0.7.2-6
hicolor-icon-theme 0.10-1
icon-naming-utils 0.8.2-1
imagemagick 6.3.2.8-1
imlib2 1.2.2-1
initscripts 0.8-6
inputproto 1.4-1
intltool 0.35.5-1
iptables 1.3.7-2
iputils 021109-5
kbd 1.12-6
kbproto 1.0.3-1
kernel-headers 2.6.20-1
kernel26 2.6.20.4-1
kernel26emission 2.6.17.emission8-1
klibc 1.5-1
klibc-extras 2.2-2
klibc-udev 107-2
lame 3.97-1
latexmk 307a-1
lcms 1.16-1
less 394-1
lesstif 0.95.0-2
libao 0.8.6-2
libarchive 1.3.1-2
libart-lgpl 2.3.19-1
libcap 1.10-2
libcroco 0.6.1-1
libcups 1.2.10-1
libdmx 1.0.2-1
libdownload 1.1-1
libdrm 2.3.0-1
libelf 0.8.6-1
libevent 1.1a-2
libexif 0.6.13-1
libfontenc 1.0.3-1
libgcrypt 1.2.4-1
libglade 2.6.0-1
libgnomecanvas 2.14.0-1
libgnomecups 0.2.2-4
libgnomeprint 2.18.0-1
libgnomeprintui 2.18.0-1
libgpg-error 1.5-1
libgsf 1.14.3-2
libice 1.0.2-1
libid3tag 0.15.1b-2
libidl2 0.8.8-1
libjpeg 6b-4
liblbxutil 1.0.1-1
libldap 2.3.33-3
libmad 0.15.1b-2
libmng 1.0.9-1
libmp4v2 1.5.0.1-1
libmysqlclient 5.0.37-1
libogg 1.1.3-1
libpcap 0.9.5-1
libpng 1.2.16-1
librsvg 2.16.1-1
libsasl 2.1.22-3
libsm 1.0.2-1
libsndfile 1.0.17-1
libstdc++5 3.3.6-1
libtasn1 0.3.9-1
libtheora 1.0alpha7-1
libtiff 3.8.2-3
libtool 1.5.22-1
libungif 4.1.4-1
libusb 0.1.12-1
libvorbis 1.1.2-1
libwmf 0.2.8.4-4
libx11 1.1.1-3
libxau 1.0.2-1
libxaw 1.0.3-1
libxcb 1.0-2
libxcomposite 0.3.1-1
libxcursor 1.1.8-1
libxdamage 1.1-1
libxdmcp 1.0.2-1
libxext 1.0.3-1
libxfixes 4.0.3-1
libxfont 1.2.7-1
libxfontcache 1.0.3-1
libxft 2.1.11-2
libxi 1.1.0-1
libxinerama 1.0.0-1
libxkbfile 1.0.4-1
libxkbui 1.0.2-1
libxml2 2.6.27-2
libxmu 1.0.3-1
libxp 1.0.0-1
libxpm 3.5.6-1
libxrandr 1.2.1-1
libxrender 0.9.2-1
libxres 1.0.2-1
libxslt 1.1.20-2
libxss 1.1.1-1
libxt 1.0.5-1
libxtrap 1.0.0-1
libxtst 1.0.1-1
libxv 1.0.2-1
libxvmc 1.0.3-1
libxxf86dga 1.0.1-1
libxxf86misc 1.0.1-1
libxxf86vm 1.0.1-1
licenses 1.0.1-1
linkage-svn 118-1
logrotate 3.7.1-3
lshwd 1.1.3-5
lzo2 2.02-1
m4 1.4.8-1
mailx 8.1.1-3
make 3.81-1
man 1.6e-1
man-pages 2.43-1
mcpp 2.6-1
mdadm 2.6.1-1
mesa 6.5.2-1
mkinitcpio 0.5.13-1
mktemp 1.5-1
module-init-tools 3.2.2-3
mozilla-common 1.1-1
mpg321 0.2.10-2
ncurses 5.6-1
net-tools 1.60-10
nspr 4.6.6-1
nss 3.11.5-1
ntp 4.2.4-2
nvidia-emission 1.0.9629-1
opencdk 0.5.13-1
openldap 2.3.33-2
openslp 1.2.1-1
openssh 4.6p1-1
openssl 0.9.8e-1
pallavi-svn 94-1
pam 0.81-4
pango 1.16.1-2
parted 1.8.6-1
patch 2.5.4-2
pciutils 2.2.4-2
pcmciautils 014-1
pcre 7.0-1
perl 5.8.8-5
perl-xml-simple 2.16-1
perlxml 2.34-4
pida 0.4.4-2
pkgconfig 0.21-1
popt 1.7-3
portmap 5beta-9
postgresql-libs 8.2.3-1
printproto 1.0.3-1
procinfo 18-3
procps 3.2.7-1
psmisc 22.3-1
pycairo 1.2.2-2
pygobject 2.12.3-2
pygtk 2.10.4-1
python 2.5-4
python-numeric 24.2-2
randrproto 1.2.1-1
rapidsvn 0.9.4-1
rb_libtorrent 0.11-1
readline 5.2-1
recordproto 1.13.2-1
reiserfsprogs 3.6.20-1
renderproto 0.9.2-1
ruby 1.8.5_p12-2
scrnsaverproto 1.1.0-1
scrollkeeper 0.3.14-5
sdl 1.2.11-1
sed 4.1.5-1
shadow 4.0.18.1-3
slocate 3.1-2
smbclient 3.0.24-2
soundmixer 0.1-1
startup-notification 0.9-1
sudo 1.6.8-10
swiftfox-amd 2.0.0.3-1
sysfsutils 2.1.0-1
syslog-ng 2.0.0-2
sysvinit 2.86-2
tar 1.16.1-1
tcl 8.4.14-1
tcp_wrappers 7.6-6
tk 8.4.14-1
transmission-svn 1516-1
trapproto 3.4.3-1
trash 0.2-1
ttf-bitstream-vera 1.10-5
udev 107-3
unrar 3.7.3-1
unzip 5.52-2
usbutils 0.72-1
util-linux 2.12-10
videoproto 2.2.2-1
vim 7.0.219-1
vorbis-tools 1.1.1-3
weatherget 0.2-2
wget 1.10.2-2
which 2.16-1
wmctrl 1.07-1
xcb-proto 1.0-1
xcursor-themes 1.0.1-1
xdg-utils 1.0.1-1
xextproto 7.0.2-1
xf86-input-keyboard 1.1.0-1
xf86-input-mouse 1.1.1-1
xf86-video-vesa 1.2.1-2
xf86dgaproto 2.0.2-1
xf86miscproto 0.9.2-1
xf86vidmodeproto 2.2.2-1
xine-lib 1.1.4-2
xineramaproto 1.1.2-1
xkeyboard-config 0.9-1
xorg 11R7.0-1
xorg-font-utils 1.0.3-1
xorg-fonts-alias 1.0.1-1
xorg-fonts-encodings 1.0.2-1
xorg-fonts-misc 1.0.0-3
xorg-server 1.2.0-3
xorg-server-utils 1.0.3-2
xorg-utils 1.0.2-1
xorg-xauth 1.0.1-1
xorg-xinit 1.0.3-1
xorg-xkb-utils 1.0.2-1
xorg-xsm 1.0.1-2
xproto 7.0.9-2
xterm 223-1
xvidcore 1.1.2-1
zip 2.32-1
zlib 1.2.3-1
I know for a fact that all of these packages aren't foreign. Any Ideas why this is acting like this?
Edit: I suppose I should mention that It worked fine last week. I can't remember if I've used it since I upgraded to pacman 3 from testing, but I have used it with pacman 3 ( I was using the rc before it went to testing).
Last edited by barebones (2007-04-03 18:43:51)For future reference, I got this fixed. I was looking around in /var/lib/pacman and I realized that the current folder was empty. Why this happened I do not know. I used pacman to reinstall a package from current (I used bash) and when it was installed, the current directory was regenerated.
-
Slow and insecure but feature-rich pacman wrapper in bash
This project of mine started because I want to compile my packages in a way that lets me delete gnome apps. Here's the problem: I see that evince depends on gnome-keyring, gnome-keyring depends on gconf and alltray depends on gconf. This leads me to think that if I recompile evince to not use gnome-keyring and recompile alltray to not use gconf, I can delete gconf.
NO!
I have to recompile evince to not use gconf as well because little do I know from pacman's dependency handling... gconf is a direct (but second level) dependency of evince as it's compiled as well.
This is a pretty standard problem. It's the reason why debian dependency lists are so damn long. I don't want Arch to move to a system like that... well sort of. Here's what I did. I made a script that acts just like pacman but when you tell it to download and install a package, it tells pacman to only download that package into a separate cache, then it extracts the package, finds all dynamic executables in the package, uses ldd to determine their library dependencies, uses pacman -Qo to find packages that own these dependencies (and caches them in a file so they can be looked up more quickly in the future), applies some other enhancements that should be visible in the script, then adds the new dependencies to the depends array and makes sure that none are duplicated. It also formats the array so that it goes (original clean dependency list) kernel26 (new list). That way it can parse queries as well so -Qi will omit all the dependencies after kernel26 and the Required By section while -Qii shows everything. This is the perfect compromise for me. Not sure if it will be for you.
Other things it does:
* Checks if AUR packages need updating (but doesn't update them)
* Takes out docs and gconf schemas
* Cleans up man pages so there's no /usr/man and just /usr/share/man/man*
* Convers /usr/share/man/locale/man1/whatever.1.gz to /usr/share/man/man1/whatever-locale.1.gz
* Converts info pages to man pages with info2man and puts them in man9
* Gzips all man pages
* Allows replacing packages with -U
* Package specific stuff like disabling the firefox error console.
Regretably I had to make it play around with the md5sums. This essentially makes them useless but if I don't do this reinstalling a package that is in the main cache because this script put it there fails due to corruption. So you might want to get rid of this "feature" and probably the firefox / uvesafb /gstreamer / info2man stuff but this is cool so tell me what you think of it.
#!/bin/bash
function aur_check {
STARTDIR=`pwd`
cd /var/cache/pacman
for r in `pacman -Qmq`; do
wget "http://aur.archlinux.org/packages/$r/$r/PKGBUILD" >/dev/null 2>&1
if [ $? -eq 0 ]; then
LOCAL_VERSION_REL=`'pacman' -Q $r | awk '{print $2}'`
LOCAL_VERSION=`echo $LOCAL_VERSION_REL| sed -e 's/-.*//g'`
REMOTE_VERSION=`cat PKGBUILD | grep -E '^pkgver=' | sed -e 's/pkgver=//g' | sed -e 's/[ ]*//g'`
REMOTE_REL=`cat PKGBUILD | grep -E '^pkgrel=' | sed -e 's/pkgrel=//g'`
if [[ "$LOCAL_VERSION" < "$REMOTE_VERSION" ]]; then
printf "warning: $r: ignoring package upgrade ($LOCAL_VERSION_REL => ${REMOTE_VERSION}-${REMOTE_REL})\n"
fi
rm PKGBUILD
fi
done
cd $STARTDIR
function sync_check {
STARTDIR=`pwd`
cd /var/cache/pacman
IGNORED_PACKAGES=`cat /etc/pacman.conf | grep -E '^IgnorePkg' | sed -e 's/IgnorePkg[ ]*=[ ]*//g'`
for s in $IGNORED_PACKAGES; do
REMOTE_VERSION_STRING=`'pacman' -Si $s 2>/dev/null | grep -E '^Version'`
if [ $? -eq 0 ]; then
REMOTE_VERSION_REL=`echo $REMOTE_VERSION_STRING | awk '{print $3}'`
LOCAL_VERSION_STRING=`'pacman' -Q $s 2>/dev/null`
if [ $? -eq 0 ]; then
LOCAL_VERSION_REL=`echo $LOCAL_VERSION_STRING | awk '{print $2}'`
printf "warning: $s: ignoring package upgrade ($LOCAL_VERSION_REL => $REMOTE_VERSION_REL)\n"
fi
fi
done
cd $STARTDIR
function remove_crap {
# No docs or schemas.
rm -rf 2>/dev/null ./usr/share/doc
rm -rf 2>/dev/null ./usr/share/gtk-doc
rm -rf 2>/dev/null ./etc/gconf
# Please delete this file. It is not necessary for linking the library.
find . -name "*.la" -exec rm {} \;
# Only one man directory please.
if [ -d ./usr/man ]; then
if [ ! -d ./usr/share ]; then
mkdir ./usr/share
fi
mv ./usr/man ./usr/share/man
fi
if [ -d ./usr/share/man ]; then
cd ./usr/share/man
ls | grep 'cat' | xargs rm -rf
if [ -d ./man ]; then
mv ./man/* .
rm -rf ./man
fi
# Imposes what I consider to be a better naming convention for some reason.
for t in `ls`; do
if [ $t != 'man0' ] && [ $t != 'man1' ] && [ $t != 'man2' ] && [ $t != 'man3' ] && [ $t != 'man4' ] && [ $t != 'man5' ] && [ $t != 'man6' ] && [ $t != 'man7' ] && [ $t != 'man8' ] && [ $t != 'man9' ] && [ $t != 'mann' ] && [ $t != 'manm' ]; then
cd $t
for u in `ls`; do
cd $u
for v in `ls`; do
SECOND_LAST_EXTENSION=`echo $v | sed -e 's/\.gz$//g' | rev | sed -e 's/\..*//g' | rev`
PREFIX=`echo $v | sed -e 's/\.gz$//g' | sed -e "s/\.${SECOND_LAST_EXTENSION}//g"`
SUFFIX=`echo $v | sed -e "s/$PREFIX//g"`
if [ ! -h $v ]; then
install -D $v ../../${u}/${PREFIX}-${t}${SUFFIX}
else
TARGET=`readlink $v`
TARGET_SECOND_LAST_EXTENSION=`echo $TARGET | sed -e 's/\.gz$//g' | rev | sed -e 's/\..*//g' | rev`
TARGET_PREFIX=`echo $TARGET | sed -e 's/\.gz$//g' | sed -e "s/\.${TARGET_SECOND_LAST_EXTENSION}//g"`
TARGET_SUFFIX=`echo $TARGET | sed -e "s/${TARGET_PREFIX}//g"`
install -d ../../${u}
ln -s ${TARGET_PREFIX}-${t}${TARGET_SUFFIX} ../../${u}/${PREFIX}-${t}${SUFFIX}
fi
done
cd ..
done
cd ..
rm -rf $t
fi
done
# Now that it is nicely organized we can gzip everything and add symlinks.
for x in `ls`; do
cd $x
for y in `ls`; do
echo $y | grep -q -E '\.gz$'
if [ $? -ne 0 ]; then
gzip $y >/dev/null 2>&1
SECOND_LAST_EXTENSION=`echo $y | rev | sed -e 's/\..*//g' | rev`
PREFIX=`echo $y | sed -e "s/\.${SECOND_LAST_EXTENSION}//g"`
NEW_NAME=`echo $PREFIX | sed -e 's/\./-/g'`
if [ $NEW_NAME != $PREFIX ]; then
ln -s ${y}.gz ${NEW_NAME}.${SECOND_LAST_EXTENSION}.gz
fi
else
SECOND_LAST_EXTENSION=`echo $y | sed -e 's/\.gz$//g' | rev | sed -e 's/\..*//g' | rev`
PREFIX=`echo $y | sed -e 's/\.gz//g' | sed -e "s/\.${SECOND_LAST_EXTENSION}//g"`
NEW_NAME=`echo $PREFIX | sed -e 's/\./-/g'`
if [ $NEW_NAME != $PREFIX ]; then
ln -s ${y} ${NEW_NAME}.${SECOND_LAST_EXTENSION}.gz
fi
fi
done
cd ..
done
cd ../../..
fi
# Converts info pages to man pages in the man9 directory
if [ -d ./usr/share/info ]; then
if [ -d ./usr/share/man ]; then
mkdir ./usr/share/man/man9
else
mkdir ./usr/share/man
mkdir ./usr/share/man/man9
fi
cd ./usr/share/info
for z in `ls`; do
echo $z | grep -q -E '\.gz$'
if [ $? -eq 0 ]; then
NAME=`echo $z | sed -e 's/\.gz$//g'`
NEWNAME=`echo $NAME | sed -e 's/\./-/g'`
gunzip $z
info2man $NAME > ../man/man9/${NEWNAME}
gzip ../man/man9/${NEWNAME} >/dev/null 2>&1
else
NEWNAME=`echo $z | sed -e 's/\./-/g'`
info2man $z > ../man/man9/${NEWNAME}
gzip ../man/man9/${NEWNAME} >/dev/null 2>&1
fi
done
cd ../../..
rm -rf ./usr/share/info
fi
function install_with_u {
ULTIMATE_ANSWER="y"
# Checks if there are package conflicts
CONFLICTS=`cat .PKGINFO | grep 'conflict = ' | awk '{print $3}'`
ACTUAL_CONFLICTS=""
for p in $CONFLICTS; do
VERSION_CHECK=0
CONFLICTING_PACKAGE=`echo $p | sed -r 's/(>|=|<).*//g'`
# Checks if these conflicts actually affect packages on the system
'pacman' -Q $CONFLICTING_PACKAGE >/dev/null 2>&1
if [ $? -eq 0 ]; then
AFFECTED=1
if [ ${#p} -gt ${#CONFLICTING_PACKAGE} ]; then
AFFECTED=0
# If a version is specified, finds it out and sees if we're affected
CONFLICTING_VERSION_STRING=${p:${#CONFLICTING_PACKAGE}:${#p}-${#CONFLICTING_PACKAGE}}
RELATION=${CONFLICTING_VERSION_STRING:1:2}
if [ "$RELATION" = "=" ]; then
RELATION=${CONFLICTING_VERSION_STRING:0:1}${RELATION}
CONFLICTING_VERSION=${CONFLICTING_VERSION_STRING:2:${#CONFLICTING_VERSION_STRING}-2}
else
RELATION=${CONFLICTING_VERSION_STRING:0:1}
CONFLICTING_VERSION=${CONFLICTING_VERSION_STRING:1:${#CONFLICTING_VERSION_STRING}-1}
fi
ACTUAL_VERSION=`pacman -Q $CONFLICTING_PACKAGE | awk '{print $2}'`
if [ "$RELATION" = ">" ]; then
if [[ "$ACTUAL_VERSION" > "$CONFLICTING_VERSION" ]]; then
AFFECTED=1
fi
elif [ "$RELATION" = "<" ]; then
if [[ "$ACTUAL_VERSION" < "$CONFLICTING_VERSION" ]]; then
AFFECTED=1
fi
elif [ "$RELATION" = ">=" ]; then
if [ "$ACTUAL_VERSION" >= "$CONFLICTING_VERSION" ]; then
AFFECTED=1
fi
elif [ "$RELATION" = "<=" ]; then
if [ "$ACTUAL_VERSION" <= "$CONFLICTING_VERSION" ]; then
AFFECTED=1
fi
else
if [ "$ACTUAL_VERSION" = "$CONFLICTING_VERSION" ]; then
AFFECTED=1
fi
fi
fi
if [ $AFFECTED -ne 0 ]; then
ACTUAL_CONFLICTS="$ACTUAL_CONFLICTS $CONFLICTING_PACKAGE"
printf ":: ${1} conflicts with ${CONFLICTING_PACKAGE}. Remove ${CONFLICTING_PACKAGE}? [Y/n] "
read ANSWER
if [ $ANSWER != "Y" ] && [ $ANSWER != "y" ]; then
ULTIMATE_ANSWER="n"
break
fi
fi
fi
done
if [ $ULTIMATE_ANSWER = "y" ]; then
for q in $ACTUAL_CONFLICTS; do
'pacman' -Rd ${q}
done
return 0
fi
return 1
function get_deps {
PACKAGE_NAME=`cat .PKGINFO | grep 'pkgname = ' | sed -e 's/pkgname = //g'`
# Does a few package specific things
if [ $PACKAGE_NAME = "kernel26" ]; then
ln -s /etc/uvesafb.conf /etc/uvesafb
elif [ $PACKAGE_NAME = "firefox" ]; then
cd ./usr/lib
FIREFOX_DIR=`ls | grep 'firefox'`
if [ $? -eq 0 ]; then
cd $FIREFOX_DIR/chrome
jar -xf ./browser.jar
rm ./browser.jar
sed -i -e '/console.xul/s/^/\/\//g' ./content/browser/browser.js
jar -cf browser.jar content
rm -r content
cd ../..
fi
cd ../..
elif [ $PACKAGE_NAME = "gstreamer0.10-good-plugins" ]; then
rm ./usr/lib/gstreamer0.10/libgstesd.so
fi
POSSIBLE_LIBS=`find . -type f | grep -E '(\.so\.|\.so$)'`
POSSIBLE_BINS=`find . -type f | grep -v 'PKGINFO' | grep -v -E '\/.*\.[a-zA-Z0-9]+$' | grep -v 'LICENSE'`
POSSIBLE_ELFS="$POSSIBLE_LIBS $POSSIBLE_BINS"
DEPS=""
# Makes a list of all the direct dependencies
for i in $POSSIBLE_ELFS; do
#echo "SCANNING: $i"
ldd $i >/dev/null 2>&1
if [ $? -eq 0 ]; then
# Caches the shared libraries in a file to make it easier for everything else to look them up
DIRNAME=`dirname ${i:1:${#i}}`
echo "$i" | grep -q ".so"
if [ $? -eq 0 ]; then
if [ "$DIRNAME" = "/lib" ] || [ "$DIRNAME" = "/usr/lib" ]; then
grep -q "${i:1:${#i}} $PACKAGE_NAME" /var/cache/pacman/quicklookup
# If this package's library assigned to this package was not found...
if [ $? -ne 0 ]; then
grep -q "${i:1:${#i}}" /var/cache/pacman/quicklookup
# It may have been assigned to another package so we change that
if [ $? -eq 0 ]; then
sed -i -e "/${i:1:${#i}}/d" /var/cache/pacman/quicklookup
fi
# Otherwise we just assign it to this package
echo "${i:1:${#i}} $PACKAGE_NAME" >> /var/cache/pacman/quicklookup
fi
fi
fi
# Figures out what packages own the library dependencies
POSSIBLE_DEPS=`ldd $i 2>/dev/null | grep '=> ' | grep -v '=> ' | sed -e 's/.* => //g' | sed -e 's/ (.*//g'`
for j in $POSSIBLE_DEPS; do
DIRNAME=`dirname $j`
if [ "$DIRNAME" = "/lib" ] || [ "$DIRNAME" = "/usr/lib" ]; then
OWNER=`grep "$j" /var/cache/pacman/quicklookup`
# The owner of the dep is either already in the quicklookup file
if [ $? -eq 0 ]; then
OWNER=`echo $OWNER | awk '{print $2}'`
DEPS="$DEPS $OWNER"
else
# Or it's part of the current package
BASENAME=`basename $j`
find . -name ${BASENAME} | grep -q "${BASENAME}"
if [ $? -eq 0 ]; then
echo "$j $PACKAGE_NAME" >> /var/cache/pacman/quicklookup
else
# Or we figure out its owner with pacman and put it in the quicklookup file
OWNER=`'pacman' -Qoq $j 2>/dev/null`
if [ $? -eq 0 ]; then
echo "$j $OWNER" >> /var/cache/pacman/quicklookup
DEPS="$DEPS $OWNER"
fi
fi
fi
fi
done
fi
done
# Sticks a "kernel26" between the old dependencies and the new dependencies
CURRENT_DEPS=`cat .PKGINFO | grep -E '^depend = ' | sed -e 's/depend = //g'`
DEPS="$CURRENT_DEPS kernel26a $DEPS"
# Puts them into the PKGINFO file so that all depend lines are contiguous
grep -q -E '^depend = ' .PKGINFO
if [ $? -eq 0 ]; then
FIRST_DEPEND_LINE_NUMBER=`grep -n -E '^depend = ' .PKGINFO | head -1 | sed -e 's/:.*//g'`
LAST_DEPEND_LINE_NUMBER=`grep -n -E '^depend = ' .PKGINFO | tail -1 | sed -e 's/:.*//g'`
LAST_LINE_NUMBER=`wc -l .PKGINFO | awk '{print $1}'`
(( DIFFERENCE=$LAST_LINE_NUMBER-$LAST_DEPEND_LINE_NUMBER ))
cat .PKGINFO | tail -${DIFFERENCE} > .PKGINFO-3
touch .PKGINFO-2
(( FIRST_DEPEND_LINE_NUMBER-- ))
cat .PKGINFO | head -${FIRST_DEPEND_LINE_NUMBER} > .PKGINFO-1
else
cp .PKGINFO .PKGINFO-1
touch .PKGINFO-2
touch .PKGINFO-3
fi
for k in $DEPS; do
echo "depend = $k" >> .PKGINFO-2
done
# This is all so we don't get mesa and mesa=7.5 in the same dep array
cat .PKGINFO-2 | awk '{print $3}' | sed -r 's/(>=|>|=|<|<=)/ \1/g' > .RAW-DEPS
cat .RAW-DEPS | awk '{print $1}' > .COL-1
cat .RAW-DEPS | awk '{print $2}' > .COL-2
# Got this from sed1line.txt... it removes duplicate lines
sed -i -n 'G; s/\n/&&/; /^\([ -~]*\n\).*\n\1/d; s/\n//; h; P' .COL-1
paste --delimiter="" .COL-1 .COL-2 > .RAW-DEPS
sed -i -e "/${PACKAGE_NAME}/d" .RAW-DEPS
sed -i -e 's/kernel26a/kernel26/g' .RAW-DEPS
sed -e 's/^/depend = /g' .RAW-DEPS > .PKGINFO-2
sed -i -e "/depend =[ ]*$/d" .PKGINFO-2
cat .PKGINFO-1 .PKGINFO-2 .PKGINFO-3 > .PKGINFO
rm .PKGINFO-1 .PKGINFO-2 .PKGINFO-3 .RAW-DEPS .COL-1 .COL-2
function do_install {
STARTDIR=`pwd`
cd /var/cache/pacman/tmp
for l in `ls -tr`; do
TEMP_DIR=`echo $l | sed -r 's/(-i686|-x86_64|-any|)\.pkg\.tar\.gz//g'`
# Extracts the package and makes the necessary modifications to it
mkdir $TEMP_DIR
mv $l $TEMP_DIR
cd $TEMP_DIR
tar -xf $l >/dev/null 2>&1
rm $l
remove_crap
get_deps
# Retars the package and installs it
if [ -e .INSTALL ]; then
tar -cf $l .INSTALL .PKGINFO * >/dev/null 2>&1
else
tar -cf $l .PKGINFO * >/dev/null 2>&1
fi
# Installs it and puts it in the cache
install_with_u $l
if [ $? -eq 0 ]; then
'pacman' -Udf $l
else
mv $l ../../pkg
cd ..
rm -r $TEMP_DIR
break;
fi
mv $l ../../pkg
cd ..
rm -r $TEMP_DIR
done
cd $STARTDIR
function get_answer {
read ANSWER
echo $ANSWER > /var/cache/pacman/answer
echo $ANSWER
if [ "$1" = "-Syu" ]; then
sync_check
aur_check
'pacman' --cachedir /var/cache/pacman/tmp -Syuw
do_install
elif [ "$1" = "-Su" ]; then
sync_check
aur_check
'pacman' --cachedir /var/cache/pacman/tmp -Suw
do_install
elif [ "$1" = "-S" ]; then
shift
PACKAGE_ARRAY=""
# If something we're installing is in the cache... move it to the temporary cache
for n in $@; do
if [ ${n:0:1} != "-" ]; then
NUM_MATCHES=`ls -1 /var/cache/pacman/pkg | grep -E "^${n}-" | wc -l`
for o in `seq 1 $NUM_MATCHES`; do
POSSIBLE_MATCH=`ls /var/cache/pacman/pkg | grep -E "^${n}-" -m${o} | tail -1`
HYPHENS=`echo $POSSIBLE_MATCH | sed -e "s/${n}//g" | grep -o "-" | wc -l`
if [ $HYPHENS -le 3 ]; then
mv /var/cache/pacman/pkg/${POSSIBLE_MATCH} /var/cache/pacman/tmp
# Changes the stored md5sum temporarily - I don't know a better way to do this
TEMP_DIR=`echo ${POSSIBLE_MATCH} | sed -r 's/(-i686|-x86_64|-any|)\.pkg\.tar\.gz//g'`
find /var/lib/pacman/sync -name $TEMP_DIR | grep -q $TEMP_DIR
if [ $? -eq 0 ]; then
MD5SUM=`md5sum /var/cache/pacman/tmp/${POSSIBLE_MATCH} | awk '{print $1}'`
REPOS=`find /var/lib/pacman/sync -name $TEMP_DIR | sed -e 's/\// /g' | awk '{print $5}'`
sed -i '/%MD5SUM%/G' /var/lib/pacman/sync/$REPOS/$TEMP_DIR/desc
MD5_LINE_NUMBER=`grep -n '%MD5SUM%' /var/lib/pacman/sync/$REPOS/$TEMP_DIR/desc | sed -e 's/:.*//g'`
(( MD5_LINE_NUMBER++ ))
sed -i -e "${MD5_LINE_NUMBER}s/.*/${MD5SUM}/" /var/lib/pacman/sync/$REPOS/$TEMP_DIR/desc
PACKAGE_ARRAY="${PACKAGE_ARRAY} ${REPOS}/${TEMP_DIR}"
fi
break;
fi
done
fi
done
# Pacman is run and then a function reads a y or an n from stdin and passes it to pacman's stdin
get_answer | 'pacman' --cachedir /var/cache/pacman/tmp -Sw $@
# The function also saves it in a file so we know whether to proceed or cancel because pacman was cancelled
LETTER=`cat /var/cache/pacman/answer`
if [ "$LETTER" != "y" ] || [ "$LETTER" != "Y" ]; then
do_install
else
# If anything got moved to the temporary cache for this it is sent back to the main one
FILES_IN_CACHE=`ls /var/cache/pacman/tmp | wc -l`
if [ $FILES_IN_CACHE -ne 0 ]; then
mv /var/cache/pacman/tmp/* /var/cache/pacman/pkg
fi
fi
# Changes all the md5sums back
for w in $PACKAGE_ARRAY; do
MD5_LINE_NUMBER=`grep -n '%MD5SUM%' /var/lib/pacman/sync/$w/desc | sed -e 's/:.*//g'`
(( MD5_LINE_NUMBER++ ))
sed -i -e "${MD5_LINE_NUMBER}d" /var/lib/pacman/sync/$w/desc
done
elif [ "$1" = "-U" ]; then
STARTDIR=`pwd`
TEMP_DIR=`echo $2 | sed -r 's/(-i686|-x86_64|-any|)\.pkg\.tar\.gz//g'`
mkdir /var/cache/pacman/$TEMP_DIR
cp "$2" /var/cache/pacman/$TEMP_DIR
cd /var/cache/pacman/$TEMP_DIR
tar -xf $2 >/dev/null 2>&1
rm $2
get_deps
# Retars the package and installs it
if [ -e .INSTALL ]; then
tar -cf $2 .INSTALL .PKGINFO * >/dev/null 2>&1
else
tar -cf $2 .PKGINFO * >/dev/null 2>&1
fi
install_with_u $2
if [ $? -eq 0 ]; then
'pacman' -U $2
fi
cd ..
rm -r $TEMP_DIR
cd $STARTDIR
elif [ "$1" = "-Qi" ] || [ "$1" = "-Qii" ]; then
INITIAL_ARG=$1
shift
if [ "$INITIAL_ARG" = "-Qi" ]; then
'pacman' -Qi $@ > /var/cache/pacman/tempquery
else
'pacman' -Qii $@ > /var/cache/pacman/tempquery
fi
if [ $? -ne 0 ] || [ ! -e /var/cache/pacman/tempquery ]; then
exit 1
fi
# Filters out all deps after kernel26 for a regular query
# Filters out all deps before kernel26 for a verbose query
if [ $? -eq 0 ]; then
START_LINE_NUMBER=`cat /var/cache/pacman/tempquery | grep -n 'Depends On' | sed -e 's/:.*//g'`
LINE_NUMBER=$START_LINE_NUMBER
(( LINE_NUMBER=$LINE_NUMBER+1 ))
cat /var/cache/pacman/tempquery | head -${LINE_NUMBER} | tail -1 | grep ':'>/dev/null 2>&1
while [ $? -ne 0 ]; do
(( LINE_NUMBER=$LINE_NUMBER+1 ))
cat /var/cache/pacman/tempquery | head -${LINE_NUMBER} | tail -1 | grep ':'>/dev/null 2>&1
done
(( END_LINE_NUMBER=$LINE_NUMBER-1 ))
(( DIFFERENCE=$LINE_NUMBER-$START_LINE_NUMBER ))
OLD_DEP_LIST=`cat /var/cache/pacman/tempquery | head -${END_LINE_NUMBER} | tail -${DIFFERENCE} | sed -e 's/.* : //g' | sed -e 's/ //g'`
for k in $OLD_DEP_LIST; do
if [ "$INITIAL_ARG" = "-Qi" ]; then
if [ "$k" != "kernel26" ]; then
NEW_DEP_LIST="$NEW_DEP_LIST $k"
else
break
fi
else
if [ "$k" != "kernel26" ]; then
NEW_DEP_LIST="$NEW_DEP_LIST $k"
fi
fi
done
fi
# Removes the old deps array and replaces it with the new one
sed -i -e "${START_LINE_NUMBER},${END_LINE_NUMBER}d" /var/cache/pacman/tempquery
(( START_LINE_NUMBER=$START_LINE_NUMBER-1 ))
END_LINE_NUMBER=`wc -l /var/cache/pacman/tempquery | awk '{print $1}'`
(( DIFFERENCE=$END_LINE_NUMBER-$START_LINE_NUMBER ))
cat /var/cache/pacman/tempquery | head -${START_LINE_NUMBER} > /var/cache/pacman/tempquery-1
cat /var/cache/pacman/tempquery | tail -${DIFFERENCE} > /var/cache/pacman/tempquery-3
CURRENT_LINE=""
CURRENT_LINE_NUMBER=1
for m in $NEW_DEP_LIST; do
if (( ${#CURRENT_LINE}+${#m}+1<=63 )); then
CURRENT_LINE="$CURRENT_LINE $m"
else
if [ $CURRENT_LINE_NUMBER -eq 1 ]; then
printf "Depends On :$CURRENT_LINE\n" >> /var/cache/pacman/tempquery-2
else
printf "\t\t$CURRENT_LINE\n" >> /var/cache/pacman/tempquery-2
fi
CURRENT_LINE=" $m"
CURRENT_LINE_NUMBER=0
fi
done
if [ $CURRENT_LINE_NUMBER -eq 1 ]; then
printf "Depends On :$CURRENT_LINE\n" >> /var/cache/pacman/tempquery-2
else
printf "\t\t$CURRENT_LINE\n" >> /var/cache/pacman/tempquery-2
fi
cat /var/cache/pacman/tempquery-1 /var/cache/pacman/tempquery-2 /var/cache/pacman/tempquery-3 > /var/cache/pacman/tempquery
# Removes the requirements array for a regular query
if [ "$INITIAL_ARG" = "-Qi" ]; then
START_LINE_NUMBER=`cat /var/cache/pacman/tempquery | grep -n 'Required By' | sed -e 's/:.*//g'`
LINE_NUMBER=$START_LINE_NUMBER
(( LINE_NUMBER=$LINE_NUMBER+1 ))
cat /var/cache/pacman/tempquery | head -${LINE_NUMBER} | tail -1 | grep ':'>/dev/null 2>&1
while [ $? -ne 0 ]; do
(( LINE_NUMBER++ ))
cat /var/cache/pacman/tempquery | head -${LINE_NUMBER} | tail -1 | grep ':'>/dev/null 2>&1
done
(( END_LINE_NUMBER=$LINE_NUMBER-1 ))
sed -i -e "${START_LINE_NUMBER},${END_LINE_NUMBER}d" /var/cache/pacman/tempquery
fi
cat /var/cache/pacman/tempquery
rm /var/cache/pacman/tempquery /var/cache/pacman/tempquery-1 /var/cache/pacman/tempquery-2 /var/cache/pacman/tempquery-3
elif [ "$1" = "-Scc" ]; then
LINE_NUMBER=0
for z in `cat /var/cache/pacman/quicklookup | awk '{print $1}'`; do
(( LINE_NUMBER++ ))
if [ ! -e $z ]; then
sed -i -e "${LINE_NUMBER}d" /var/cache/pacman/quicklookup
(( LINE_NUMBER-- ))
fi
done
'pacman' -Scc
else
'pacman' $@
fi
Last edited by ConnorBehan (2009-09-19 00:42:48)rls wrote:ABS is fine, but unless I am mistaken, it does nothing to ensure the configure and make stages go smoothly. It is a good way to integrate "home-rolled" packages into the Arch system.
hmmmm... I could be wrong because I've never used Gentoo, but if you make a package that doesn't already exist for Gentoo, does it do anything to make sure the compilation goes smoothly? If the package exists, then there is a way to build the package that has been tested by somebody else. This is how ABS works too; if a PKGBUILD exists, you can be reasonably sure it will work.
I can't imagine a program that can automatically fix or recover from compiler or Makefile errors. If it does, then... wow.
I assume that Gentoo has a larger package base than Arch, but let's not get into that discussiong again!
Xentacs script is basically designed to allow you to choose whether you are going to install from source or binary. Assuming the PKGBUILDS are in order (which for arch repository programs they are, because the binaries were built from them!), this should work as flawlessly as installing from binaries.
Dusty -
[Solved] Pacman.log no longer logging maybe systemd
Hi, I upgraded a couple of days ago on the 11th to systemd system, I am using 86_64 awesome DE, I ran Syu yesterday and this morning I found mplayer was acting poorly so I went to check pacman.log to see what was updated. Pacman.log hadn't logged since the 11th when I upgraded, although I would like to figure out mplayer, I am more interested in the log files. I also found that my boot log file is not recording boot information from the same time although the errors.log has information in it.
thanks in advance for any help you may give.
--jerry
Last edited by jk121960 (2012-11-14 21:15:45)bernarcher wrote:
To be more precise, did you follow this: Journald in conjunction with syslog
pacman.log is working here.
Yes and here is the status
syslog-ng.service - System Logger Daemon
Loaded: loaded (/usr/lib/systemd/system/syslog-ng.service; enabled)
Active: active (running) since Wed, 2012-11-14 00:58:57 CST; 14h ago
Docs: man:syslog-ng(8)
Main PID: 591 (syslog-ng)
CGroup: name=systemd:/system/syslog-ng.service
└ 591 /usr/sbin/syslog-ng -F
thanks for your help
--jerry -
Request for a "NeverUpgrade" option for pacman.
Yesterday something very serious happened, pacman moved my grub menu.lst file to menu.lst.pacsave. If I wouldn't have spotted this, my system would have become unbootable. This can be fixed by putting it in NoUpgrade (pacman.conf) by default, but there is an underlying problem here.
Pacman will always move your modified files (excluding the ones in NoUpgrade) to .pacsave and use a default file instead. Imagine this would happen on the httpd.conf (apache), my.cnf (mysql), php.ini (php),... files on a production server! It shouldn't, the server admin should have seen that pacman moved them, or he should have put them in the NoUpgrade line. But we're all human and these things happen. And a human error like this already happened with the grub file.
I've always been concerned with the actions of pacman. As Gyroplast said on irc: "Don't f*cking touch any already exiting config files until I explicitly tell you to!".
I've also noticed that a lot of times, these 'new' files are just the same as the original (unmodified) file, or are not worth the upgrade. It only costs time moving the old file back to its original position.
Newbies, people who didn't see that pacman moved their old file (on big updates, the console can even be to small to show this), people that do a "pacman -Syu" through cron,.. will never notice that their system can become unbootable, that apache's config file has been moved, so all their client's sites will be down after a reboot or apache restart,...
This is a very serious issue!
I have a very simpel solution though. I'm sure there are some people that are used to the old way and want to keep it, so we should give people the choice. Either use the old system, or the new. Let's say there is a "NeverUpdate" = yes/no option in pacman.conf. (default: YES!)
If you say no, everything will be back to 'normal'.
If you say yes, things will be different. We will now work with a whitelist instead of a blacklist as Gyroplast proposed. So instead of the "NoUpgrade" option, we will have an "Upgrade" option. All files will be protected by default (and use the .pacnew system), only the files in "Upgrade" can be overwritten, and moved to a .pacsave version. This is all VERY easy (and fast) to implement, if I knew C I would do it myself
I think it's important that this happens as soon as possible, to prevent things like the grub fiasco to happen again.
We can go further however: when a packager creates a new package with config files, he can tell pacman what has been changed (with a new option in PKGBUILD). If I upgrade that package, pacman will tell me exactly what has been added/changed so I can upgrade my file really quickly. Much faster than doing a 'diff' or just comparing it line by line. More work for 1 packager, but less work for hundreds of users. (and that 1 packager will also benefit from this, because he will save time updating packages from other packagers, so a win-win situation 8)). I realize that this will be much more work to implement, but would be a very nice feature in some future version of pacman.
I'm sure there will be some discussion about this, new ideas, people that hate me,..
I hope the Arch developers (particulary apeiro) will join this discussion, and also explain to us why the current pacman is so radical.FreeBSDs mergemaster really only is a frontend for sdiff, no black magic, so it'd probably be well possible to port it to arch, especially as it's only a shell script.
I think I've given enough examples of how someone can miss this
Yeah, and I could easily construct a dozen more, but there's no excuse for not paying attention to the output of a crucial program if you cannot risk your system going haywire. If you _can_ risk it, though, your point is moot.
The inherent problem is that you cannot fully automate the process, thus always requiring manual interaction if a new config file differs from the original file and the current file has been modified. There is no way around that. You will shredder your system if you do not pay attention when this scenario happens, with the proposed change a little less often, but still. Since problems are not totally ruled out, you still have to check just as often as before, because you cannot know in advance how basic the config file changes are. If you still have to do the same amount of work, I don't see a reason to change anything.
I do not believe in "some security". Either pacman is able to do the job of upgrading reliably and automatically, or it is my sole duty to ensure configuration integrity. All pacman has to (and already can) do in that case is telling me that my interaction is required, and where. It does that now already (if I leave the NoUpgrade misbehaviour aside).
The mergemaster tool would be a very helpful _additional_ tool that could be offered, I have nothing against that, but it's not part of pacman. As I wrote it's just a frontend to sdiff, a fancy tool that may or may not be used. One job - one tool. Pacman's job is installing packages, not solving impossible dilemmas, therefore I'd vote against this extra functionality and would rather discuss how to improve administrator notification to reduce the chance of changes going unnoticed.
A solution to this underlying core problem would be "statistics" at the end of an upgrade process, stating if and what files have been replaced with newer versions. That's legible, it's easy to implement, and it does the job. If you're running pacman unattended, you're acting irresponsible. No matter if your config is replaced or not, you risk your system's integrity, the former risks it a bit more, the latter a bit less, but it's nevertheless risked, which is per se inacceptable, thus leaving the difference in reliability being merely a moot point.
I'll rephrase that:
Yes, the system will probably break more often if the current implementation is kept, but only if the administrator does not do his job and check pacman's warnings. There are no superfluous warnings being generated by pacman that would cause an admin to disregard the output, the only (documented) case of a pacsave being generated is when default config parameters have been changed in the package, which needs interaction _every time_. You're not winning anything by the change, you just gain a "safety net" that is not sufficient for the situation you are constantly referring to; A server system that simply must work. Therefore the safety measure is useless by concept. You cannot reliably help an admin who does not care, and if an admin does not care, it's by defintion not important enough to be considered, so why should a function be implemented that would solve (some, but not all) cases that are considered as unimportant by the admin anyway?
Whoa, evil topic here, so I say "Port mergemaster, make pacman a bit more verbose, be done with it." to keep it short.
Greets,
Dennis -
[SOLVED] pacman -Syu on 10/17/2012, systemd can't load kernel modules
Ok, I did a [pacman -Syu] on my laptop, and everything went well. So I decided to upgrade my PC as well, did a reboot and then couldn't ssh into it.
Had to access the machine, and found
# systemctl --failed
UNIT LOAD ACTIVE SUB JOB DESCRIPTION
[email protected] loaded failed failed dhcpcd on eth0
httpd.service loaded failed failed Apache Web Server
systemd-modules-load.service loaded failed failed Load Kernel Modules
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.
JOB = Pending job for the unit.
3 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
so it failed to load kernel modules...
# systemctl status systemd-modules-load.service
systemd-modules-load.service - Load Kernel Modules
Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static)
Active: failed (Result: exit-code) since Wed, 17 Oct 2012 18:27:11 -0400; 45min ago
Docs: man:systemd-modules-load.service(8)
man:modules-load.d(5)
Process: 102 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=1/FAILURE)
CGroup: name=systemd:/system/systemd-modules-load.service
Oct 17 18:27:11 MyHost systemd[1]: Failed to start Load Kernel Modules.
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
... then I checked network devices
# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
# ip addr show dev eth0
Device "eth0" does not exist.
... then the modules; and I saw that none appeared for the Ethernet...
# lspci -v | grep Ethernet -A8
00:07.0 Bridge: NVIDIA Corporation MCP61 Ethernet (rev a2)
Subsystem: Hewlett-Packard Company Device 2a6c
Flags: bus master, 66MHz, fast devsel, latency 0, IRQ 5
Memory at fe02d000 (32-bit, non-prefetchable) [size=4K]
I/O ports at fc00 [size=8]
Capabilities: [44] Power Management version 2
Capabilities: [50] MSI: Enable- Count=1/8 Maskable+ 64bit+
Capabilities: [6c] HyperTransport: MSI Mapping Enable- Fixed+
... whereas they did for other devices
# lspci -v | grep Kernel
Kernel driver in use: ohci_hcd
Kernel driver in use: ehci_hcd
Kernel driver in use: sata_nv
Kernel driver in use: sata_nv
Kernel driver in use: pcieport
Kernel driver in use: pcieport
Kernel driver in use: pcieport
Kernel driver in use: nouveau
I'm guessing it's probably something with the new image after the pgrade, but I don't know which module to load nor do I
understand why systemd isn't loading the modules when it was working stable enough to act as a headless server before. However, I've only been a week or so with systemd and might have overlooked something in the configs. Any help or insight would be greatly appreciated. Please. I'm desperate.
Last edited by confusion-is-my-sedative (2012-10-26 21:30:01)Yep, I got that far, and tried the same advice from a different user with a 'tee' command which did the same thing, but unfortunately the forcedeth module can't be loaded because its in a different directory than the 'uname -r' specification allows modprobe to search for. I posted my attempts here: https://bbs.archlinux.org/viewtopic.php?pid=1181940
-
Arch Linux Pacman Proxy Script
Since my Arch box has no internet connection (yes, I'm that much of a masochist), I wrote a bash script to act as a proxy of sorts for pacman, at least as regards downloading. It took a while to get it working (intermittent web access and all) but here it finally is, as promised.
It works well for me, and I only hope that it will help anyone else in the same situation (if there is anyone else in the same situation).
The script has various options to explain everything you need to know, but here's a quick word of warning: it only works on POSIX-compatible computers (i.e. no Wintendows, usually) and the proxy box needs to have bash, wget, tar, grep and sed installed. I don't see this as being a problem, but if I'm wrong, tell me all about it.
#!/bin/bash
readonly VER="2.1"
readonly wgetVER=`wget -V|sed '1!d'`
# DEBUG levels:
# Set to 0 for ALERT-level messages only
# Set to 1 for INFO-level messages (I prefer this)
# Set to 2 for DEBUG-level messages
# Set to 3 for all messages
readonly DEBUG=0
# Set DEBUGLOG=1 to print ALERT, INFO and DEBUG messages to DEBUG.log
readonly DEBUGLOG=0
readonly COLOUR=true
if [[ $COLOUR == true ]] ; then
readonly red='\e[31m'
readonly warn='\e[31;7m '
readonly green='\e[32m'
readonly lgreen='\e[32;1m'
readonly yellow='\e[33;1m'
readonly lblue='\e[34;1m'
readonly dull='\e[0m' ; fi
# Sticky details:
# tar seems very slow (vfat? transform? USB?)
function bugspray {
[[ -z $2 ]] && verbosity=1 || verbosity=$2
if (( DEBUG >= verbosity )) ; then
(( $2 == 0 )) && intro="${warn}ALERT${dull} | "
(( $2 == 1 )) && intro=" INFO | "
(( $2 > 1 )) && intro=" ${yellow}DEBUG${dull} | "
echo -e "$intro$1"
(( DEBUGLOG == 1 )) && echo "`date +%F_%T` | $1">>log-alpps/DEBUG.log ; fi ; }
function compare_versions {
# Requires two ordinary, untweaked version strings, first local, second distant
if [[ -z $2 ]] ; then
bugspray "compare_versions didn't receive two variables." 2 ; fi
update='no'
[[ -z $2 ]] && return
local localversion=(`echo $1|sed -r 's/([[:alpha:]]+)/ \1 /g;s/[\.:~_-]/ /g'`)
local distantversion=(`echo $2|sed -r 's/([[:alpha:]]+)/ \1 /g;s/[\.:~_-]/ /g'`)
local max=$((${#distantversion[*]}))
bugspray "localversion: ${localversion[*]}; distantversion: ${distantversion[*]}" 2
for (( x=0 ; (( x < $max )) ; $((x++)) )) ; do
bugspray "local version part: `echo ${localversion[$x]}` | distant version part: `echo ${distantversion[$x]}`" 2
if [[ `echo ${localversion[$x]}|grep -E '^[0-9]*$'` && `echo ${distantversion[$x]}|grep -E '^[0-9]*$'` ]] ; then
bugspray "Numerical comparison" 2
bugspray "localver (${localversion[$x]}) less than distantver (${distantversion[$x]}): $(( 10#${localversion[$x]} < 10#${distantversion[$x]} ))" 3
# Different compare methods for numbers, single letters and multiple letters.
if (( 10#${localversion[$x]} < 10#${distantversion[$x]} )) ; then
update='yes'
break ; fi ; fi
if [[ `echo ${localversion[$x]}|grep -E '^[[:alpha:]]$'` && `echo ${distantversion[$x]}|grep -E '^[[:alpha:]]$'` ]] ; then # single letter -> compare
bugspray "Lexicographical comparison" 2
bugspray "localver (${localversion[$x]}) less than distantver (${distantversion[$x]}): [[ ${localversion[$x]} < ${distantversion[$x]} ]]" 3
if [[ ${localversion[$x]} < ${distantversion[$x]} ]] ; then
update='yes'
break ; fi ; fi
if [[ `echo ${localversion[$x]}|grep -E '^[[:alpha:]]+$'` && `echo ${distantversion[$x]}|grep -E '^[[:alpha:]]+$'` ]] ; then # string -> drop
# cvs / git / beta -> what are the rules?
bugspray "Sequence of letters. Not treating as version number." 2 ; fi
done ; }
function find_dependencies {
# Determine existence via unique path
bugspray "+ ${lgreen}Building download list for package \"$1\"${dull}" 1
local packagename
local dlfile
local package_found=no
if [[ `ls .temp-alpps/*.db/$1-* 2>/dev/null` ]] ; then
bugspray "Analogous package-name file(s) found" 2
for x in `ls .temp-alpps/*.db/$1-*/desc` ; do
bugspray "Checking $x" 2
packagename=`sed -r '/%NAME%/,+1!d;/%NAME%/d' $x`
if [[ j$packagename == j$1 ]] ; then
bugspray "Exact match found: $packagename = $1" 2
dlfile=`sed '/%FILENAME%/,+1!d;/%FILENAME%/d' $x`
local distantversion=`sed '/%VERSION%/,+1!d;/%VERSION%/d' $x`
local package_full=$packagename-$distantversion
local the_repo=`echo $x|sed -r 's/.temp-alpps\/(.*)\.db.*/\1/'`
local the_path=`echo $x|sed -r 's/desc//'`
unplus=`echo $packagename|sed 's/\+/\\\+/g'`
local local_version=`sed -r '/^'$unplus' /!d;s/.* //' .temp-alpps/snapshot.state`
package_found=yes
break ; fi ; done ; fi
if [[ -z $dlfile ]] ; then
bugspray "Exact match not found -> looking for replacements." 2
if ! [[ -z `grep $1 .temp-alpps/*.db/*/depends` ]] ; then
local provisional=`grep $1 .temp-alpps/*.db/*/depends|sed -r 's/\/depends.*//'`
for package in $provisional ; do
local providence=`sed -r '/%PROVIDES%/,/^$/!d;/%PROVIDES%/d;/^$/d;s/>.*//;s/=.*//' $package/depends`
for y in $providence ; do
if [[ j$y == j$1 ]] ; then
# But what about when several packages provide the same thing and ALPPS picks the wrong one? Can it happen?
local newdep=`sed -r '/%NAME%/,+1!d;/%NAME%/d' $package/desc`
bugspray " -> Package \"$newdep\" provides \"$1\"." 1
find_dependencies $newdep
break 2 ; fi ; done ; done
if [[ -z $newdep ]] ; then
bugspray "${warn}Warning:${dull} package \"$1\" not found in database." 0 ; fi ; fi ; fi
bugspray "package: $1 | package_found = $package_found" 2
# Add file to download_list if not up to date and if not already present
if [[ j$package_found == jyes ]] ; then
local already_got_one=no
unplus=`echo $dlfile|sed 's/\+/\\\+/g'`
[[ `echo $download_files|grep $unplus` ]] && already_got_one="yes" && bugspray "${green}Package in queue${dull}" 1
[[ `ls downloads/$dlfile 2>/dev/null` ]] && already_got_one="yes" && bugspray "${green}Package proxied${dull}" 1
compare_versions $local_version $distantversion
bugspray "compare_versions says: $update" 2
! [[ -z $local_version || $update == yes ]] && already_got_one="yes" && bugspray "${green}Package already installed and up-to-date${dull}" 1
if [[ j$already_got_one != jyes ]] ; then
bugspray "${green}Confirm downloading${dull}" 1
download_files+="$dlfile "
download_array[${dlfile}]=$the_repo
bugspray "Checking for further dependencies" 2
if [[ -a $the_path/depends && `grep -E '^%DEPENDS%$' $the_path/depends` ]] ; then
local dependency=`sed -r '/%DEPENDS%/d;/^$/q' $the_path/depends`
bugspray "Dependencies of \"$packagename\":$dependency" 3
for x in $dependency ; do
# Is this dependency already installed? Sort-of the same as higher up; it just saves time here.
local depname=`echo $x|sed -r 's/>.*//;s/=.*//'`
local depminver=`echo $x|sed -r 's/.*>//'`
bugspray "Dependency name: \"$depname\"" 2
if ! [[ `grep -E '^$depname ' .temp-alpps/snapshot.state` ]] ; then
find_dependencies $depname ; fi ; done
else
bugspray "${lblue}End of the line${dull}: package \"$packagename\" has no dependencies." 2
true ; fi ; fi ; fi ; }
function failover_fetch {
echo "Downloading `echo $1|sed 's/.*\///'`"
[[ -d log-alpps/ ]] || mkdir log-alpps/
[[ -z $success ]] || unset success
for mirror in $(<.temp-alpps/snapshot.mirrorlist) ; do
# If DEBUG>0, shouldn't redirect output
url=`echo $mirror|sed 's/$arch/'$arch'/;s/$repo/'${download_array[$1]}'/'`/$1
bugspray "Connecting to $url" 2
wget -o .temp-alpps/very-temp-log -U "Arch Linux Pacman Proxy Script version $VER / $wgetVER" -P downloads/ $url && success=true
cat .temp-alpps/very-temp-log>>log-alpps/download.log
rm -f .temp-alpps/very-temp-log
if [[ -n $success ]] ; then
bugspray "Download: \$success = true" 2
break ; fi ; done
if [[ -z $success ]] ; then
bugspray "${warn}FAIL:${dull} $1 not accessible on known mirrors." 0 ; fi ; }
case $1 in
warranty)
echo
echo -e " ${green}Warranty${dull}"
echo -e " ${green}========${dull}"
echo " This program is free software. It comes without any warranty, to"
echo " the extent permitted by applicable law. You can redistribute it"
echo " and/or modify it under the terms of the Do What The Fuck You Want"
echo " To Public License, Version 2, as published by Sam Hocevar. See"
echo " http://sam.zoy.org/wtfpl/COPYING for more details."
echo
howto)
echo
echo -e " ${green}How to use ALPPS${dull}"
echo -e " ${green}================${dull}"
echo -e " ${yellow}+ Step 0${dull}: prime the engine"
echo " On your offline box, copy the ALPPS script onto a removable medium, cd into"
echo " it's directory, then run it with the \"init\" option. This essentially"
echo " takes a snapshot of your system, package-wise. Your removable medium is"
echo " now ready for use!"
echo -e " ${yellow}+ Step 1${dull}:"
echo " On the proxy box the first order of business is to download and decompress"
echo " the current package lists. You can do this with the \"fetchdb\" option."
echo -e " ${yellow}+ Step 1 alt${dull}:"
echo " If you want to download the package lists without decompressing them,"
echo " \"fetchdb simple\" will do this. It's a lot quicker, but please keep"
echo " in mind that you cannot then do anything in step 2."
echo -e " ${yellow}+ Step 2${dull}:"
echo " If you want to download packages (and why wouldn't you?), the easiest way"
echo " is to prepare a simple text file containing the names of the packages you"
echo " want, one on each line. Run ALPPS with the option \"fetch <filename>\" and"
echo " sit back and wait until it's done. Don't worry about dependencies: ALPPS"
echo " handles them automatically."
echo -e " ${yellow}+ Step 2 alt${dull}:"
echo " As a convenience, \"fetch full\" will download all the packages needed to"
echo " update the offline box."
echo -e " ${yellow}+ Step 3${dull}:"
echo " Finally, back on your offline box, run ALPPS again with the \"install\""
echo " option. This will update the package list and copy the package files into"
echo " local cache. You can now run \"pacman -S <package names>\" to finish"
echo " installing the packages."
# ALPPS no longer installs the packages, just caches them locally.
# Not entirely sure why; it just felt too klutzy.
echo -e " ${yellow}+ Step 4${dull}:"
echo " You will now probably want to delete all the stuff you no longer need. Run"
echo " ALPPS with the option \"clean\". This won't touch your request file(s). It"
echo -e " ${red}WILL${dull} delete log files, so if you want to keep them, back them up first."
echo " Next time you do this, don't forget to run ALPPS with \"init\" again."
echo
bugs)
echo
echo -e " ${green}Where this goes wrong${dull}"
echo -e " ${green}=====================${dull}"
echo " + ALPPS is a bit slow when packages have many dependencies. It's a recursive"
echo " shell script: what did you expect?"
echo " + It only uses the settings in /etc/pacman.conf. If your conf file is"
echo " elsewhere, you're SOL. Similarly, the repositories are all taken from"
echo " /etc/pacman.d/mirrorlist. If you added any custom repositories in"
echo " /etc/pacman.conf (or any other file), ALPPS ignores them."
echo " + As it stands, ALPPS only works when the proxy box has bash, wget, sed,"
echo " grep and tar installed. The offline box needs bash, pacman and sed (in"
echo " theory, this shouldn't be a problem...)."
echo " + There is as yet no way of handling package groups, short of listing every"
echo " member of the group."
echo " + I don't think ALPPS will ever be able to handle AUR packages. Of course, if"
echo " you're compiling AUR packages, you probably won't need something like this!"
echo
faq)
echo
echo -e " ${green}Frequently Asked Questions${dull}"
echo -e " ${green}==========================${dull}"
echo
echo -e " ${red}Q:${dull} Can I run the whole thing off a USB stick?"
echo -e " ${lblue}A:${dull} Certainly."
echo
echo -e " ${red}Q:${dull} Can I use a non-POSIX computer as a proxy (e.g. Windows)?"
echo -e " ${lblue}A:${dull} Probably not, unless that computer has a POSIX-compatibility layer"
echo " installed (such as Cygwin) with bash, wget, tar, sed and grep."
echo
echo -e " ${red}Q:${dull} Do I need to download the package list, waste time updating my computer,"
echo " then go back again to download the packages I want?"
echo -e " ${lblue}A:${dull} Nope! You can update the packagelist database and download piping-hot"
echo " fresh packages, all in one sitting."
echo -e " ${red}Q:${dull} You mean I won't have to futz around with package lists that keep updating"
echo " ten minutes after I download them?"
echo -e " ${lblue}A:${dull} Exactly. Nice, isn't it?"
echo
echo -e " ${red}Q:${dull} Does this thing handle SSL and signed packages?"
echo -e " ${lblue}A:${dull} ALPPS uses SSL if:"
echo " - the mirror has an https address (at present, none do), and"
echo " - wget on the proxy box is compiled with SSL support"
echo " Concerning signed packages: no, but then again, it doesn't need to. ALPPS"
echo " downloads packages; it's pacman's responsibility to verify them. Your"
echo " system remains safe (or as safe as it ever was, at any rate)."
echo -e " ${red}Q:${dull} What about gpg keys? I need to get them."
echo -e " ${lblue}A:${dull} ...maybe later, say, in version 3."
echo
echo -e " ${red}Q:${dull} ALPPS says it \`prepares databases´. Can pacman still use them after this?"
echo -e " ${lblue}A:${dull} Yes, it can. In fact, what ALPPS does is extract the databases into a"
echo " temp directory, without altering the original .db files."
echo
echo -e " ${red}Q:${dull} Where can I contact you?"
echo -e " ${lblue}A:${dull} For constructive, useful questions and comments: [email protected] and"
echo " be sure to mention Arch Linux in the subject."
echo " For flames, trolling, spam and the like, visit your local bitbucket."
echo
todo)
echo
echo -e " ${green}What's next?${dull}"
echo -e " ${green}============${dull}"
echo -e " + I ${red}might${dull} be able to extend the reach of this thing to the AUR."
echo " Yes, I know I said ALPPS couldn't (in \"bugs\"), but I've learned"
echo " something new since then. It'll be tricky, though, since the AUR web"
echo " interface delivers results in python. While this should be a Good Thing,"
echo " bash isn't very good at handling python-format lists and dicts."
echo
-v|ver|version|--ver|--version)
echo -e "${lgreen}Arch Linux pacman proxy script${dull} | ${yellow}version $VER${dull}"
dl_list) # Debugging
(( DEBUG == 0 )) && echo "the \"dl_list\" option is only for debugging" && exit 0
arch=$(<.temp-alpps/snapshot.architecture)
unset download_files
unset download_array
declare -A download_array
find_dependencies $2
bugspray "Download list: $download_files" 3
echo "Download list v2:"
for x in $download_files ; do
bugspray " File \"$x\" from repo \"${download_array[$x]}\"" 3
echo " Full URL: http://mirror.archlinux.org/${download_array[$x]}/os/$arch/$x" ; done
verint) # Debugging
(( DEBUG == 0 )) && echo "the \"verint\" option is only for debugging" && exit 0
for x in `ls .temp-alpps/*/$2-*/desc` ; do
packagename=`sed -r '/%NAME%/,+1!d;/%NAME%/d' $x`
if [[ j$packagename == j$2 ]] ; then
bugspray "Unique package-name file found: $packagename=$2" 2
distantversion=`sed '/%VERSION%/,+1!d;/%VERSION%/d' $x`
dlfile=`sed '/%FILENAME%/,+1!d;/%FILENAME%/d' $x`
package_full=$packagename-$distantversion
the_repo=`echo $x|sed -r 's/.temp-alpps\/(.*)\.db.*/\1/'`
the_path=`echo $x|sed -r 's/desc//'`
local_version=`sed -r '/^'$packagename' /!d;s/.* //' .temp-alpps/snapshot.state`
break ; fi ; done
echo "full package filename: $dlfile"
echo "Comparing local ($local_version) and distant ($distantversion) versions of $2..."
compare_versions $local_version $distantversion
#compare_versions 2.5beta3-2 2.5cvs4-1
echo "...and the verdict is: $update"
init)
x=`uname -m`
if [[ -x /usr/bin/pacman ]] ; then
[[ -d .temp-alpps ]] || mkdir .temp-alpps/
pacman -Q>.temp-alpps/snapshot.state
sed -r '/^Se/!d;s/Server = //' /etc/pacman.d/mirrorlist>.temp-alpps/snapshot.mirrorlist
sed -r '/^\[/!d;/options/d;s/\[(.*)\]/\1/' /etc/pacman.conf>.temp-alpps/snapshot.repositories
sed -r '/^Architecture/!d;s/^.*= //' /etc/pacman.conf>.temp-alpps/snapshot.architecture
[[ ! -s .temp-alpps/snapshot.architecture || auto == $(<.temp-alpps/snapshot.architecture) ]] && $x>.temp-alpps/snapshot.architecture
sed -r '/^SyncFirst/!d;s/.*= //;s/ /\n/g' /etc/pacman.conf>.temp-alpps/snapshot.prioritypackages
echo "Current state recorded."
else
echo "You seem to be running ALPPs on an unsupported system."
echo "ALPPS is the ${lgreen}Arch Linux Pacman Proxy Script${dull} and simply"
echo "won't run properly on a non-pacman OS (except when proxying)."
echo "Aborting. Sorry."
exit 1 ; fi
fetchdb)
[[ -d downloads ]] || mkdir downloads
arch=$(<.temp-alpps/snapshot.architecture)
declare -A download_array
for repo in $(<.temp-alpps/snapshot.repositories) ; do
download_array[${repo}.db]=$repo
location="${repo}.db"
failover_fetch $location ; done
if [[ j$2 != jsimple ]] ; then
[[ -d log-alpps ]] || mkdir log-alpps
[[ -a syncfirst ]] && rm -f syncfirst
echo "Preparing databases for local processing. This might take a while."
for x in $(<.temp-alpps/snapshot.repositories) ; do
echo "Preparing $x.db"
if [[ -a downloads/$x.db ]] ; then
[[ -d .temp-alpps/$x.db ]] || mkdir .temp-alpps/$x.db/
tar -xzC .temp-alpps/$x.db/ -f downloads/$x.db --transform 's/:/§/' --no-same-owner && echo "$x database ready for use."
else
echo -e "Database $x.db is missing. Skipping. This will probably cause problems." ; fi ; done
# SyncFirst package warning
[[ -z $download_list ]] || unset download_list
[[ -a syncfirst ]] && rm -f syncfirst
for x in $(<.temp-alpps/snapshot.prioritypackages) ; do
find_dependencies $x ; done
bugspray "download_files: $download_files" 2
if [[ ! -z $download_files ]] ; then
echo "New version(s) of SyncFirst package(s):"
for x in $(<.temp-alpps/snapshot.prioritypackages) ; do
[[ ! -z `echo $download_files|grep $x` ]] && echo "- $x" && echo $x>>syncfirst ; done
echo "Package names placed in 'syncfirst'. Don't forget to download them!" ; fi ; fi
fetch)
for x in $(<.temp-alpps/snapshot.repositories) ; do
if ! [[ -d .temp-alpps/$x.db/ ]] ; then
bugspray "You must first download a fresh database with the \"fetchdb\" option" 0
exit 1 ; fi ; done
arch=$(<.temp-alpps/snapshot.architecture)
unset download_array
declare -A download_array
unset download_files
if [[ $2 == full ]] ; then
echo " Building full upgrade list. This will almost certainly take a while."
echo " Please wait..."
for y in `sed -r 's/^(.*) .*/\1/' .temp-alpps/snapshot.state` ; do
bugspray "Examining $y" 1
find_dependencies $y ; done
elif [[ -a $2 ]] ; then
echo " Determining dependencies. This might take a while. Please wait."
for y in $(<$2) ; do
bugspray "Examining $y" 1
find_dependencies $y ; done
else
echo " Error: you should provide a list-file or the keyword \"full\"."
echo " (see 'alpps.sh howto', step 2)"
exit 1 ; fi
if [[ -z $download_files ]] ; then
echo " No files to download: either none found, or all found are up to date."
else
[[ -d downloads ]] || mkdir downloads
for x in $download_files ; do
failover_fetch $x ; done ; fi
install)
dbpath=`sed -r '/^DBPath/!d;s/^.*= //' /etc/pacman.conf`
[[ -z $dbpath ]] && dbpath="/var/lib/pacman/"
bugspray "dbpath: $dbpath" 2
echo " Updating databases"
cp -ft ${dbpath}sync/ downloads/*.db
cachedir=`sed -r '/^CacheDir/!d;s/^.*= //' /etc/pacman.conf`
[[ -z $cachedir ]] && cachedir="/var/cache/pacman/pkg/"
echo " Caching packages"
cp -f downloads/*.pkg.tar.xz $cachedir
echo
echo " Don't forget to install/update your packages."
echo " Exercise proper caution."
echo " Have fun!"
clean)
echo "Cleaning up. This might take a while."
rm -fr .temp-alpps/ && echo "Buffer directory deleted" || echo "Problem deleting buffer directory '.temp-alpps/'"
rm -fr log-alpps/ && echo "Log directory deleted" || echo "Problem deleting 'log-alpps/'"
rm -fr downloads/ && echo "Downloaded packages deleted" || echo "Problem deleting 'downloads/'"
echo
echo -e " ${lgreen}Arch Linux pacman proxy script${dull}"
echo
echo -e " ${green}Description${dull}"
echo -e " ${green}===========${dull}"
echo -e " This is a bash script to fetch and install packages for an offline Arch box"
echo " using another, online box as a proxy of sorts. So far, this only works if"
echo " the proxy box has bash, wget, tar, sed and grep installed."
echo " It's probably also entirely unsafe, incompatible and will destroy your box"
echo " in a fiery blaze if you try to use it (you know the drill)."
echo
echo -e " ${green}Options${dull}"
echo -e " ${green}=======${dull}"
echo " init Step 0 (as it were): take a snapshot of your system"
echo " fetchdb Step 1: download the packagelist database"
echo " fetch <file> Step 2: download requested packages"
echo " install Step 3: update your system"
echo " clean Step 4: delete any unneeded files"
echo
echo " howto More detailed instructions"
echo " bugs Problems and future plans"
echo " faq As it says"
echo " warranty (in case it ever becomes necessary)"
echo " version (to be honest, I wasn't expecting to go beyond v1-rc or so)"
echo " help You're reading it, doofus :^)"
echo
# dl_list Test the find_dependencies function"
# verint Test the compare_versions function"
esacAnimaInvicta wrote:
Since my Arch box has no internet connection (yes, I'm that much of a masochist), I wrote a bash script to act as a proxy of sorts for pacman, at least as regards downloading. It took a while to get it working (intermittent web access and all) but here it finally is, as promised.
It works well for me, and I only hope that it will help anyone else in the same situation (if there is anyone else in the same situation).
The script has various options to explain everything you need to know, but here's a quick word of warning: it only works on POSIX-compatible computers (i.e. no Wintendows, usually) and the proxy box needs to have bash, wget, tar, grep and sed installed. I don't see this as being a problem, but if I'm wrong, tell me all about it.
#!/bin/bash
readonly VER="2.1"
readonly wgetVER=`wget -V|sed '1!d'`
# DEBUG levels:
# Set to 0 for ALERT-level messages only
# Set to 1 for INFO-level messages (I prefer this)
# Set to 2 for DEBUG-level messages
# Set to 3 for all messages
readonly DEBUG=0
# Set DEBUGLOG=1 to print ALERT, INFO and DEBUG messages to DEBUG.log
readonly DEBUGLOG=0
readonly COLOUR=true
if [[ $COLOUR == true ]] ; then
readonly red='\e[31m'
readonly warn='\e[31;7m '
readonly green='\e[32m'
readonly lgreen='\e[32;1m'
readonly yellow='\e[33;1m'
readonly lblue='\e[34;1m'
readonly dull='\e[0m' ; fi
# Sticky details:
# tar seems very slow (vfat? transform? USB?)
function bugspray {
[[ -z $2 ]] && verbosity=1 || verbosity=$2
if (( DEBUG >= verbosity )) ; then
(( $2 == 0 )) && intro="${warn}ALERT${dull} | "
(( $2 == 1 )) && intro=" INFO | "
(( $2 > 1 )) && intro=" ${yellow}DEBUG${dull} | "
echo -e "$intro$1"
(( DEBUGLOG == 1 )) && echo "`date +%F_%T` | $1">>log-alpps/DEBUG.log ; fi ; }
function compare_versions {
# Requires two ordinary, untweaked version strings, first local, second distant
if [[ -z $2 ]] ; then
bugspray "compare_versions didn't receive two variables." 2 ; fi
update='no'
[[ -z $2 ]] && return
local localversion=(`echo $1|sed -r 's/([[:alpha:]]+)/ \1 /g;s/[\.:~_-]/ /g'`)
local distantversion=(`echo $2|sed -r 's/([[:alpha:]]+)/ \1 /g;s/[\.:~_-]/ /g'`)
local max=$((${#distantversion[*]}))
bugspray "localversion: ${localversion[*]}; distantversion: ${distantversion[*]}" 2
for (( x=0 ; (( x < $max )) ; $((x++)) )) ; do
bugspray "local version part: `echo ${localversion[$x]}` | distant version part: `echo ${distantversion[$x]}`" 2
if [[ `echo ${localversion[$x]}|grep -E '^[0-9]*$'` && `echo ${distantversion[$x]}|grep -E '^[0-9]*$'` ]] ; then
bugspray "Numerical comparison" 2
bugspray "localver (${localversion[$x]}) less than distantver (${distantversion[$x]}): $(( 10#${localversion[$x]} < 10#${distantversion[$x]} ))" 3
# Different compare methods for numbers, single letters and multiple letters.
if (( 10#${localversion[$x]} < 10#${distantversion[$x]} )) ; then
update='yes'
break ; fi ; fi
if [[ `echo ${localversion[$x]}|grep -E '^[[:alpha:]]$'` && `echo ${distantversion[$x]}|grep -E '^[[:alpha:]]$'` ]] ; then # single letter -> compare
bugspray "Lexicographical comparison" 2
bugspray "localver (${localversion[$x]}) less than distantver (${distantversion[$x]}): [[ ${localversion[$x]} < ${distantversion[$x]} ]]" 3
if [[ ${localversion[$x]} < ${distantversion[$x]} ]] ; then
update='yes'
break ; fi ; fi
if [[ `echo ${localversion[$x]}|grep -E '^[[:alpha:]]+$'` && `echo ${distantversion[$x]}|grep -E '^[[:alpha:]]+$'` ]] ; then # string -> drop
# cvs / git / beta -> what are the rules?
bugspray "Sequence of letters. Not treating as version number." 2 ; fi
done ; }
function find_dependencies {
# Determine existence via unique path
bugspray "+ ${lgreen}Building download list for package \"$1\"${dull}" 1
local packagename
local dlfile
local package_found=no
if [[ `ls .temp-alpps/*.db/$1-* 2>/dev/null` ]] ; then
bugspray "Analogous package-name file(s) found" 2
for x in `ls .temp-alpps/*.db/$1-*/desc` ; do
bugspray "Checking $x" 2
packagename=`sed -r '/%NAME%/,+1!d;/%NAME%/d' $x`
if [[ j$packagename == j$1 ]] ; then
bugspray "Exact match found: $packagename = $1" 2
dlfile=`sed '/%FILENAME%/,+1!d;/%FILENAME%/d' $x`
local distantversion=`sed '/%VERSION%/,+1!d;/%VERSION%/d' $x`
local package_full=$packagename-$distantversion
local the_repo=`echo $x|sed -r 's/.temp-alpps\/(.*)\.db.*/\1/'`
local the_path=`echo $x|sed -r 's/desc//'`
unplus=`echo $packagename|sed 's/\+/\\\+/g'`
local local_version=`sed -r '/^'$unplus' /!d;s/.* //' .temp-alpps/snapshot.state`
package_found=yes
break ; fi ; done ; fi
if [[ -z $dlfile ]] ; then
bugspray "Exact match not found -> looking for replacements." 2
if ! [[ -z `grep $1 .temp-alpps/*.db/*/depends` ]] ; then
local provisional=`grep $1 .temp-alpps/*.db/*/depends|sed -r 's/\/depends.*//'`
for package in $provisional ; do
local providence=`sed -r '/%PROVIDES%/,/^$/!d;/%PROVIDES%/d;/^$/d;s/>.*//;s/=.*//' $package/depends`
for y in $providence ; do
if [[ j$y == j$1 ]] ; then
# But what about when several packages provide the same thing and ALPPS picks the wrong one? Can it happen?
local newdep=`sed -r '/%NAME%/,+1!d;/%NAME%/d' $package/desc`
bugspray " -> Package \"$newdep\" provides \"$1\"." 1
find_dependencies $newdep
break 2 ; fi ; done ; done
if [[ -z $newdep ]] ; then
bugspray "${warn}Warning:${dull} package \"$1\" not found in database." 0 ; fi ; fi ; fi
bugspray "package: $1 | package_found = $package_found" 2
# Add file to download_list if not up to date and if not already present
if [[ j$package_found == jyes ]] ; then
local already_got_one=no
unplus=`echo $dlfile|sed 's/\+/\\\+/g'`
[[ `echo $download_files|grep $unplus` ]] && already_got_one="yes" && bugspray "${green}Package in queue${dull}" 1
[[ `ls downloads/$dlfile 2>/dev/null` ]] && already_got_one="yes" && bugspray "${green}Package proxied${dull}" 1
compare_versions $local_version $distantversion
bugspray "compare_versions says: $update" 2
! [[ -z $local_version || $update == yes ]] && already_got_one="yes" && bugspray "${green}Package already installed and up-to-date${dull}" 1
if [[ j$already_got_one != jyes ]] ; then
bugspray "${green}Confirm downloading${dull}" 1
download_files+="$dlfile "
download_array[${dlfile}]=$the_repo
bugspray "Checking for further dependencies" 2
if [[ -a $the_path/depends && `grep -E '^%DEPENDS%$' $the_path/depends` ]] ; then
local dependency=`sed -r '/%DEPENDS%/d;/^$/q' $the_path/depends`
bugspray "Dependencies of \"$packagename\":$dependency" 3
for x in $dependency ; do
# Is this dependency already installed? Sort-of the same as higher up; it just saves time here.
local depname=`echo $x|sed -r 's/>.*//;s/=.*//'`
local depminver=`echo $x|sed -r 's/.*>//'`
bugspray "Dependency name: \"$depname\"" 2
if ! [[ `grep -E '^$depname ' .temp-alpps/snapshot.state` ]] ; then
find_dependencies $depname ; fi ; done
else
bugspray "${lblue}End of the line${dull}: package \"$packagename\" has no dependencies." 2
true ; fi ; fi ; fi ; }
function failover_fetch {
echo "Downloading `echo $1|sed 's/.*\///'`"
[[ -d log-alpps/ ]] || mkdir log-alpps/
[[ -z $success ]] || unset success
for mirror in $(<.temp-alpps/snapshot.mirrorlist) ; do
# If DEBUG>0, shouldn't redirect output
url=`echo $mirror|sed 's/$arch/'$arch'/;s/$repo/'${download_array[$1]}'/'`/$1
bugspray "Connecting to $url" 2
wget -o .temp-alpps/very-temp-log -U "Arch Linux Pacman Proxy Script version $VER / $wgetVER" -P downloads/ $url && success=true
cat .temp-alpps/very-temp-log>>log-alpps/download.log
rm -f .temp-alpps/very-temp-log
if [[ -n $success ]] ; then
bugspray "Download: \$success = true" 2
break ; fi ; done
if [[ -z $success ]] ; then
bugspray "${warn}FAIL:${dull} $1 not accessible on known mirrors." 0 ; fi ; }
case $1 in
warranty)
echo
echo -e " ${green}Warranty${dull}"
echo -e " ${green}========${dull}"
echo " This program is free software. It comes without any warranty, to"
echo " the extent permitted by applicable law. You can redistribute it"
echo " and/or modify it under the terms of the Do What The Fuck You Want"
echo " To Public License, Version 2, as published by Sam Hocevar. See"
echo " http://sam.zoy.org/wtfpl/COPYING for more details."
echo
howto)
echo
echo -e " ${green}How to use ALPPS${dull}"
echo -e " ${green}================${dull}"
echo -e " ${yellow}+ Step 0${dull}: prime the engine"
echo " On your offline box, copy the ALPPS script onto a removable medium, cd into"
echo " it's directory, then run it with the \"init\" option. This essentially"
echo " takes a snapshot of your system, package-wise. Your removable medium is"
echo " now ready for use!"
echo -e " ${yellow}+ Step 1${dull}:"
echo " On the proxy box the first order of business is to download and decompress"
echo " the current package lists. You can do this with the \"fetchdb\" option."
echo -e " ${yellow}+ Step 1 alt${dull}:"
echo " If you want to download the package lists without decompressing them,"
echo " \"fetchdb simple\" will do this. It's a lot quicker, but please keep"
echo " in mind that you cannot then do anything in step 2."
echo -e " ${yellow}+ Step 2${dull}:"
echo " If you want to download packages (and why wouldn't you?), the easiest way"
echo " is to prepare a simple text file containing the names of the packages you"
echo " want, one on each line. Run ALPPS with the option \"fetch <filename>\" and"
echo " sit back and wait until it's done. Don't worry about dependencies: ALPPS"
echo " handles them automatically."
echo -e " ${yellow}+ Step 2 alt${dull}:"
echo " As a convenience, \"fetch full\" will download all the packages needed to"
echo " update the offline box."
echo -e " ${yellow}+ Step 3${dull}:"
echo " Finally, back on your offline box, run ALPPS again with the \"install\""
echo " option. This will update the package list and copy the package files into"
echo " local cache. You can now run \"pacman -S <package names>\" to finish"
echo " installing the packages."
# ALPPS no longer installs the packages, just caches them locally.
# Not entirely sure why; it just felt too klutzy.
echo -e " ${yellow}+ Step 4${dull}:"
echo " You will now probably want to delete all the stuff you no longer need. Run"
echo " ALPPS with the option \"clean\". This won't touch your request file(s). It"
echo -e " ${red}WILL${dull} delete log files, so if you want to keep them, back them up first."
echo " Next time you do this, don't forget to run ALPPS with \"init\" again."
echo
bugs)
echo
echo -e " ${green}Where this goes wrong${dull}"
echo -e " ${green}=====================${dull}"
echo " + ALPPS is a bit slow when packages have many dependencies. It's a recursive"
echo " shell script: what did you expect?"
echo " + It only uses the settings in /etc/pacman.conf. If your conf file is"
echo " elsewhere, you're SOL. Similarly, the repositories are all taken from"
echo " /etc/pacman.d/mirrorlist. If you added any custom repositories in"
echo " /etc/pacman.conf (or any other file), ALPPS ignores them."
echo " + As it stands, ALPPS only works when the proxy box has bash, wget, sed,"
echo " grep and tar installed. The offline box needs bash, pacman and sed (in"
echo " theory, this shouldn't be a problem...)."
echo " + There is as yet no way of handling package groups, short of listing every"
echo " member of the group."
echo " + I don't think ALPPS will ever be able to handle AUR packages. Of course, if"
echo " you're compiling AUR packages, you probably won't need something like this!"
echo
faq)
echo
echo -e " ${green}Frequently Asked Questions${dull}"
echo -e " ${green}==========================${dull}"
echo
echo -e " ${red}Q:${dull} Can I run the whole thing off a USB stick?"
echo -e " ${lblue}A:${dull} Certainly."
echo
echo -e " ${red}Q:${dull} Can I use a non-POSIX computer as a proxy (e.g. Windows)?"
echo -e " ${lblue}A:${dull} Probably not, unless that computer has a POSIX-compatibility layer"
echo " installed (such as Cygwin) with bash, wget, tar, sed and grep."
echo
echo -e " ${red}Q:${dull} Do I need to download the package list, waste time updating my computer,"
echo " then go back again to download the packages I want?"
echo -e " ${lblue}A:${dull} Nope! You can update the packagelist database and download piping-hot"
echo " fresh packages, all in one sitting."
echo -e " ${red}Q:${dull} You mean I won't have to futz around with package lists that keep updating"
echo " ten minutes after I download them?"
echo -e " ${lblue}A:${dull} Exactly. Nice, isn't it?"
echo
echo -e " ${red}Q:${dull} Does this thing handle SSL and signed packages?"
echo -e " ${lblue}A:${dull} ALPPS uses SSL if:"
echo " - the mirror has an https address (at present, none do), and"
echo " - wget on the proxy box is compiled with SSL support"
echo " Concerning signed packages: no, but then again, it doesn't need to. ALPPS"
echo " downloads packages; it's pacman's responsibility to verify them. Your"
echo " system remains safe (or as safe as it ever was, at any rate)."
echo -e " ${red}Q:${dull} What about gpg keys? I need to get them."
echo -e " ${lblue}A:${dull} ...maybe later, say, in version 3."
echo
echo -e " ${red}Q:${dull} ALPPS says it \`prepares databases´. Can pacman still use them after this?"
echo -e " ${lblue}A:${dull} Yes, it can. In fact, what ALPPS does is extract the databases into a"
echo " temp directory, without altering the original .db files."
echo
echo -e " ${red}Q:${dull} Where can I contact you?"
echo -e " ${lblue}A:${dull} For constructive, useful questions and comments: [email protected] and"
echo " be sure to mention Arch Linux in the subject."
echo " For flames, trolling, spam and the like, visit your local bitbucket."
echo
todo)
echo
echo -e " ${green}What's next?${dull}"
echo -e " ${green}============${dull}"
echo -e " + I ${red}might${dull} be able to extend the reach of this thing to the AUR."
echo " Yes, I know I said ALPPS couldn't (in \"bugs\"), but I've learned"
echo " something new since then. It'll be tricky, though, since the AUR web"
echo " interface delivers results in python. While this should be a Good Thing,"
echo " bash isn't very good at handling python-format lists and dicts."
echo
-v|ver|version|--ver|--version)
echo -e "${lgreen}Arch Linux pacman proxy script${dull} | ${yellow}version $VER${dull}"
dl_list) # Debugging
(( DEBUG == 0 )) && echo "the \"dl_list\" option is only for debugging" && exit 0
arch=$(<.temp-alpps/snapshot.architecture)
unset download_files
unset download_array
declare -A download_array
find_dependencies $2
bugspray "Download list: $download_files" 3
echo "Download list v2:"
for x in $download_files ; do
bugspray " File \"$x\" from repo \"${download_array[$x]}\"" 3
echo " Full URL: http://mirror.archlinux.org/${download_array[$x]}/os/$arch/$x" ; done
verint) # Debugging
(( DEBUG == 0 )) && echo "the \"verint\" option is only for debugging" && exit 0
for x in `ls .temp-alpps/*/$2-*/desc` ; do
packagename=`sed -r '/%NAME%/,+1!d;/%NAME%/d' $x`
if [[ j$packagename == j$2 ]] ; then
bugspray "Unique package-name file found: $packagename=$2" 2
distantversion=`sed '/%VERSION%/,+1!d;/%VERSION%/d' $x`
dlfile=`sed '/%FILENAME%/,+1!d;/%FILENAME%/d' $x`
package_full=$packagename-$distantversion
the_repo=`echo $x|sed -r 's/.temp-alpps\/(.*)\.db.*/\1/'`
the_path=`echo $x|sed -r 's/desc//'`
local_version=`sed -r '/^'$packagename' /!d;s/.* //' .temp-alpps/snapshot.state`
break ; fi ; done
echo "full package filename: $dlfile"
echo "Comparing local ($local_version) and distant ($distantversion) versions of $2..."
compare_versions $local_version $distantversion
#compare_versions 2.5beta3-2 2.5cvs4-1
echo "...and the verdict is: $update"
init)
x=`uname -m`
if [[ -x /usr/bin/pacman ]] ; then
[[ -d .temp-alpps ]] || mkdir .temp-alpps/
pacman -Q>.temp-alpps/snapshot.state
sed -r '/^Se/!d;s/Server = //' /etc/pacman.d/mirrorlist>.temp-alpps/snapshot.mirrorlist
sed -r '/^\[/!d;/options/d;s/\[(.*)\]/\1/' /etc/pacman.conf>.temp-alpps/snapshot.repositories
sed -r '/^Architecture/!d;s/^.*= //' /etc/pacman.conf>.temp-alpps/snapshot.architecture
[[ ! -s .temp-alpps/snapshot.architecture || auto == $(<.temp-alpps/snapshot.architecture) ]] && $x>.temp-alpps/snapshot.architecture
sed -r '/^SyncFirst/!d;s/.*= //;s/ /\n/g' /etc/pacman.conf>.temp-alpps/snapshot.prioritypackages
echo "Current state recorded."
else
echo "You seem to be running ALPPs on an unsupported system."
echo "ALPPS is the ${lgreen}Arch Linux Pacman Proxy Script${dull} and simply"
echo "won't run properly on a non-pacman OS (except when proxying)."
echo "Aborting. Sorry."
exit 1 ; fi
fetchdb)
[[ -d downloads ]] || mkdir downloads
arch=$(<.temp-alpps/snapshot.architecture)
declare -A download_array
for repo in $(<.temp-alpps/snapshot.repositories) ; do
download_array[${repo}.db]=$repo
location="${repo}.db"
failover_fetch $location ; done
if [[ j$2 != jsimple ]] ; then
[[ -d log-alpps ]] || mkdir log-alpps
[[ -a syncfirst ]] && rm -f syncfirst
echo "Preparing databases for local processing. This might take a while."
for x in $(<.temp-alpps/snapshot.repositories) ; do
echo "Preparing $x.db"
if [[ -a downloads/$x.db ]] ; then
[[ -d .temp-alpps/$x.db ]] || mkdir .temp-alpps/$x.db/
tar -xzC .temp-alpps/$x.db/ -f downloads/$x.db --transform 's/:/§/' --no-same-owner && echo "$x database ready for use."
else
echo -e "Database $x.db is missing. Skipping. This will probably cause problems." ; fi ; done
# SyncFirst package warning
[[ -z $download_list ]] || unset download_list
[[ -a syncfirst ]] && rm -f syncfirst
for x in $(<.temp-alpps/snapshot.prioritypackages) ; do
find_dependencies $x ; done
bugspray "download_files: $download_files" 2
if [[ ! -z $download_files ]] ; then
echo "New version(s) of SyncFirst package(s):"
for x in $(<.temp-alpps/snapshot.prioritypackages) ; do
[[ ! -z `echo $download_files|grep $x` ]] && echo "- $x" && echo $x>>syncfirst ; done
echo "Package names placed in 'syncfirst'. Don't forget to download them!" ; fi ; fi
fetch)
for x in $(<.temp-alpps/snapshot.repositories) ; do
if ! [[ -d .temp-alpps/$x.db/ ]] ; then
bugspray "You must first download a fresh database with the \"fetchdb\" option" 0
exit 1 ; fi ; done
arch=$(<.temp-alpps/snapshot.architecture)
unset download_array
declare -A download_array
unset download_files
if [[ $2 == full ]] ; then
echo " Building full upgrade list. This will almost certainly take a while."
echo " Please wait..."
for y in `sed -r 's/^(.*) .*/\1/' .temp-alpps/snapshot.state` ; do
bugspray "Examining $y" 1
find_dependencies $y ; done
elif [[ -a $2 ]] ; then
echo " Determining dependencies. This might take a while. Please wait."
for y in $(<$2) ; do
bugspray "Examining $y" 1
find_dependencies $y ; done
else
echo " Error: you should provide a list-file or the keyword \"full\"."
echo " (see 'alpps.sh howto', step 2)"
exit 1 ; fi
if [[ -z $download_files ]] ; then
echo " No files to download: either none found, or all found are up to date."
else
[[ -d downloads ]] || mkdir downloads
for x in $download_files ; do
failover_fetch $x ; done ; fi
install)
dbpath=`sed -r '/^DBPath/!d;s/^.*= //' /etc/pacman.conf`
[[ -z $dbpath ]] && dbpath="/var/lib/pacman/"
bugspray "dbpath: $dbpath" 2
echo " Updating databases"
cp -ft ${dbpath}sync/ downloads/*.db
cachedir=`sed -r '/^CacheDir/!d;s/^.*= //' /etc/pacman.conf`
[[ -z $cachedir ]] && cachedir="/var/cache/pacman/pkg/"
echo " Caching packages"
cp -f downloads/*.pkg.tar.xz $cachedir
echo
echo " Don't forget to install/update your packages."
echo " Exercise proper caution."
echo " Have fun!"
clean)
echo "Cleaning up. This might take a while."
rm -fr .temp-alpps/ && echo "Buffer directory deleted" || echo "Problem deleting buffer directory '.temp-alpps/'"
rm -fr log-alpps/ && echo "Log directory deleted" || echo "Problem deleting 'log-alpps/'"
rm -fr downloads/ && echo "Downloaded packages deleted" || echo "Problem deleting 'downloads/'"
echo
echo -e " ${lgreen}Arch Linux pacman proxy script${dull}"
echo
echo -e " ${green}Description${dull}"
echo -e " ${green}===========${dull}"
echo -e " This is a bash script to fetch and install packages for an offline Arch box"
echo " using another, online box as a proxy of sorts. So far, this only works if"
echo " the proxy box has bash, wget, tar, sed and grep installed."
echo " It's probably also entirely unsafe, incompatible and will destroy your box"
echo " in a fiery blaze if you try to use it (you know the drill)."
echo
echo -e " ${green}Options${dull}"
echo -e " ${green}=======${dull}"
echo " init Step 0 (as it were): take a snapshot of your system"
echo " fetchdb Step 1: download the packagelist database"
echo " fetch <file> Step 2: download requested packages"
echo " install Step 3: update your system"
echo " clean Step 4: delete any unneeded files"
echo
echo " howto More detailed instructions"
echo " bugs Problems and future plans"
echo " faq As it says"
echo " warranty (in case it ever becomes necessary)"
echo " version (to be honest, I wasn't expecting to go beyond v1-rc or so)"
echo " help You're reading it, doofus :^)"
echo
# dl_list Test the find_dependencies function"
# verint Test the compare_versions function"
esac
I've always resorted to use VPN, then I started using cntlm, this looks very useful (and a lot of work on your part!) Thanks alot!
DoctorZeus -
Pacman all odd after a recent -Syu
Yes, pacman is acting all strange after I recently updated all packages. Now, every time I run pacman I get this:
error: /var/lib/pacman/local/kernel26-2.6.19.2-1/desc: No such file or directory
I tried creating the dir and but then it complains about 'depends' in the same directory. After creating that one, pacman seems to stop responding when trying to download something...
Also, it seems pacman is unaware of already installed packages as it wants to install a lot of stuff I already have.lilsirecho wrote:Had a similar case which required me to ...pacman -Scc and rebuild the sync base because the db got corrupted.
Doesn't seem to work either, unless I'm doing something wrong.
pacman -Scc and then
pacman -Sy -
Pacman wrapper to allow source builds (srcpac)
This is mostly just something that I did because I had never written a wrapper for pacman before and wanted to see if it worked with the current pacman feature set.
It's 1:30ish in the morning, so my eyes are a little blurry.
The wrapper is called srcpac. It's version 0.1 at this point
The code is quite ugly because I threw it together in the past 3 hours, but my inital tests have been successes.
Now, for the pitch. Imagine if you could use pacman to install binary packages as well as build those same packages from source (with your own optimizations). Not only that, but upgrades remembered which packages were precompiled and which were compiled on the spot.
Now, imagine that pacman didn't actually handle that, because the hard-core KISS people would complain too much and you wouldn't be able to think while you watch gcc output flash by. Imagine instead a wrapper around pacman that handled it for you.
Enter srcpac. Lights brighten, music comes to a peak, close up!
srcpac acts exactly the same as pacman (well, it should anyway), except you get this little extra flag -b (or --build) tacked on to -S (--sync) to build from source instead of install from a binary package.
Let's see an example:
srcpac -Sb w3m
will compile w3m, install it, and remember that it was compiled
srcpac -Sybu
will upgrade all the packages that need upgrading by building them and remember that they were compiled (be careful with this one, it will include packages that weren't previously compiled).
srcpac -Syu
will upgrade all binary packages by installing binaries and upgrade all source packages by compiling from source.
srcpac -Qi w3m adds an extra line too, "Source", with a simple yes or no.
Which packages are source and which aren't are stored in /var/lib/srcpac just as files. If the file exists, then the package was a source package (so it's easy to fix it if srcpac gets confused, also it doesn't touch anything pacman uses).
While I can guarantee that this wrapper won't break your packages (because it uses pacman and makepkg to do all of it's package related stuff), I can't guarantee it'll work 100% correctly (it's 1:45 now!).
If anyone is interested, the script is available here: http://xentac.net/svn/arch-tools/srcpac/tags/0.1/srcpac
Yes, it's in bash.
Feel free to tell me problems you run into using this tool. Remember, if you use pacman instead of using srcpac, then all the packages will continue installing as binary packages.
BEWARE: the -r option isn't fully implemented and may install to / in some cases, I'm pretty sure I don't ever write to / when -r is specified, but I can't be sure.
.:edit - changed title to show srcpac name - dibble:.rls wrote:ABS is fine, but unless I am mistaken, it does nothing to ensure the configure and make stages go smoothly. It is a good way to integrate "home-rolled" packages into the Arch system.
hmmmm... I could be wrong because I've never used Gentoo, but if you make a package that doesn't already exist for Gentoo, does it do anything to make sure the compilation goes smoothly? If the package exists, then there is a way to build the package that has been tested by somebody else. This is how ABS works too; if a PKGBUILD exists, you can be reasonably sure it will work.
I can't imagine a program that can automatically fix or recover from compiler or Makefile errors. If it does, then... wow.
I assume that Gentoo has a larger package base than Arch, but let's not get into that discussiong again!
Xentacs script is basically designed to allow you to choose whether you are going to install from source or binary. Assuming the PKGBUILDS are in order (which for arch repository programs they are, because the binaries were built from them!), this should work as flawlessly as installing from binaries.
Dusty -
I used my Ipod while at the gym one day and now it's acting wacky. I have tunes that will not download due to an "unexpected error (-50). Anyone know what this is and how to fix it?
looks like the gtk theme is not the problem. didnt really think it was, but the documentation was worth posting. the guys over at ubuntu look as though they have dealt with this in great detail, and have produced a few solutions, which may or may not work. i have decided to post these for anyone else who may have these problems.
Solution 1 - new user creation:
https://bugs.launchpad.net/ubuntu/+bug/104521
Solution 2 - config file delete:
http://ge.ubuntuforums.com/showthread.php?t=724439
post number 6 here features the config file delete solution, as well as a link to another post which may be useful.
judging by a google search on this problem and the number of responses that came up, the bonobo/daemon error is quite a common curse for the users of gnome, although much more common in distros such as ubuntu or fedora.
i hope that this proves useful and if anyone has anything to add, please feel free. the more documentation the better.
EDIT:
another solution would be to remove gnome and reinstall it from scratch. (some please tell me if i am doing this correctly. thanks )
1. clean your catch:
pacman -Scc
2. remove gnome, gnome extras, and whatever other gnome files you might have installed
pacman -Rscn gnome gnome-extra etc...
3. reinstall gnome and gnome extras
pacman -Sy gnome gnome-extra
4. reconfigure your desktop the way you want.
Last edited by czechman86 (2008-05-28 23:42:43) -
Implications of new 'source' in pacman.conf
I apologize in advance for what seems to be a very basic and FAQ-ish question.
I've always wanted to know, what are the implications of adding new sources
to my pacman.conf (or in the case of Ubuntu/Debian, the /etc/apt/sources.list file?)
Let's say that you put some joker's site in your pacman.conf file, and they put
a malicious FOO version 2 software in their repository.
When I run pacman -Syu, does pacman say "Well, software FOO is at version 1 in
the official Arch repos, but it's at version 2 in Joker's repository, what do you want to do?"
Sorry for the basic question, but often think that if I was trying to proliferate some keylogger or
other malware, what I would do is write some good software FOO, or act as a mirror for some good software FOO,
and then provide updates for software BAR, and have BAR be a new version of some core-software
that takes data from your keyboard and forwards it to my e-mail account.
Is my question/concern valid, or am I totally off track? I recently thought about this when adding
a repository to my pacman.conf file so that I could get updates for the yaourt application. I'm not
accusing the author of yaourt of anything at all, and think the product is great. But I just want to know if
the author of yaourt issues an update to "readline", if Arch will accept this update as a valid update the next time
I run pacman -Syu?
Thanks very much, and links/RTFMs are appreciated.
--NateIn pacman.conf(8) (man pacman.conf), under "REPOSITORY SECTIONS":
The order of repositories in the configuration files matters;
repositories listed first will take precedence over those listed later
in the file when packages in two repositories have identical names,
regardless of version number.
I tested this with a local repo and it appears to work as documented; pacman didn't prompt me to upgrade 'bash' to the newer version I had put in my test repo which was below [core] in pacman.conf.
Last edited by foutrelis (2009-07-30 08:50:02) -
[FIXED-ish] Updating: Pacman wants to remove /usr/
error: cannot remove file '/usr/': Read-only file system
error: could not commit removal transaction
error failed to commit transaction (cannot remove all files for package)
Errors occurred, no packages were upgraded
Not sure why pacman wants to remove /usr... Also, /usr is not read-only, it's mounted as rw.
Last edited by Berticus (2009-02-08 20:15:45)Okay, so I managed to somehow fix it after rebooting a million times (both soft reboot and hard reboot). Ran into a few mounting problems, ran into a few kernel panics, finally fixed all of the problems, but I don't know how/why. I would really like to know why everything was acting up so I can prevent it. So I'm going to detail everything that happened.
I decided I would like to game again, but not have to reboot into Windows. So to get a quick fix of my gaming dose, I decided to install a few games on Linux, and I added the gaming repo to my pacman.conf. I also wanted to use sage instead of excel, matlab, maple, and mathematica [and magma]. However, installing a few of my games and sage filled both /opt, /usr and /var to 100%. I was able to increase /opt and /usr easily because they were jfs. /var required me to go into my rescue cd. Then /usr ran out of space again, so I had to increase that again (/usr is now really fragmented, which I am not happy about). After I installed sage and most of the games I wanted, I decided to upgrade my system.
That's when I ran into the issue of removing '/usr/'. I tried a couple of times, hoping that it would fix itself, and then posted here. I installed a few more games without a problem, tried upgrading again with no success. Then I rebooted, Reboot process was fine. Still ran into the issue though. Tried upgrading again, and some packages upgraded partially (complained about not being able to write), most ran into the removing '/usr/' issue. I tried to startx, but ran into configuration errors, and I couldn't use my keyboard or mouse, so I hard rebooted.
Reboot went fine, I tried upgrading again. Pacman complained about files already existing, so I backed those up, and removed them. Tried upgrading again, kernel upgrade warned about not being mounted. So I tried to mount /boot, and it complained that ext2 was not a recognized filesystem. So I rebooted, ran into some module errors. I booted into the rescue CD, put back the modules I had backed up, and rebooted into the system. It booted up just fine. I upgraded, and it worked, except /boot still had trouble mounting. I booted into the rescue CD again, mounted the root filesystem into /mnt and the /boot partition into /blah, and copied the contents of /mnt/boot to /blah. Unfortunately, I forgot that would also override my grub configurations. So it ran into a kernel panic. After a few more reboots, I finally fixed the problem by replacing menu.lst with menu.lst~, and linking grub.conf to menu.lst. Now everything is working fine.
The issues I want to prevent from happening again is /usr mounted as read-write, but recognized as read-only, ext2 not being recognized (I can now mount /boot just fine). I would also like to know if it's possible that some of the packages weren't fully upgraded. If so, how can I get pacman to find them and re-install those packages. -
PLEASE help me with my Pacman game
I have two files, one contains a class that creates pacman animation. The other file contains the maze. The problem is how can I add Pacman to the maze?
Thanks in advanceCreate another class to act as the game engine. Have it process moves so that it moves packman by checking to see if the location is fine by consulting the maze class and have packman draw itself on screen accordingly.
Maybe you are looking for
-
What is the best upgrade from 10.5.8 leopard.
i just bought a used macbook pro with 2.4GHz core 2 duo and 2 gb memory. what would be the best upgrade to OS. is that enough to run Mountain Lion? my wife has a new macbook with mountain lion and i prefer alot of the way it looks compared to leopa
-
Downloading from Itunes via Wifi & Syncing to 2 Macs
I want to download some music on my iphone via itunes. I have two mac computers an Imac and a Macbook. My question is that will my iphone sync the music I download via wifi itunes to both my mac computers when I connect my Iphone to Each of them? I j
-
Records Missed in PSA from R/3 for BI Content Data Sources
Hi Friends, I'm extracting the data for the data target "0CCA_C11" using the data sources 0CO_OM_CCA_9 & 0CO_OM_CCA_1, but for the data source 0CO_OM_CCA_1, it is showing 25000 records in R/3 while checking in RSA3 transaction,
-
Window("exit").windowType = 1 upgrade
window("exit").windowType = 1 this use to work but i just upgraded to 11.5 and now it will not work anyone know what the new code is?/post.jspa?container=2077&containerType=14&reply=false
-
HT1695 i cant connect to wifi after updating
i just updated my iphone to ios 6 and it cant connect to wifi i tried all the methods but it dosent work