0

I just copied a repository of the previous Ubuntu version (13, saucy). It contains both i386 and amd64 versions of the packages. I want to use this repository on a 64 bit PC. Is there a terminal command I can use to remove all of the i386 versions?

Edit: I am assuming that all packages have a amd64 version. Otherwise, if a package only has an i386 version, I want to retain it.

1 Answer 1

0

A two-stage method would be to create a script which, given a path to a package, checks for the existence of an amd64 version and if it finds such a version, deletes the i386 package.

Something like:

#! /bin/bash

for i
do
    PKG=${i/i386/amd64}
    if [[ -f $PKG ]]
    then
        rm $1
    fi
done

saved as script.sh, for example. And then:

find ${REPOSITORY_ROOT} -iname '*i386.deb' -exec ./script.sh {} +

The whole thing can perhaps be done using a single find command, but this should be enough.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .