How do I fix a "Unknown configuration key `foreign-architecture' found in your `dpkg' configuration files." error?

23,509

Solution 1

You say in the comments that you see:

$ ls /etc/dpkg/dpkg.cfg.d/
multiarch

Presumably that file, /etc/dpkg/dpkg.cfg.d/multiarch, contains a foreign-architecture key. So I suggest just deleting the file:

sudo rm /etc/dpkg/dpkg.cfg.d/multiarch

Solution 2

My /etc/dpkg/dpkg.cfg.d/multiarch contained:

foreign-architecture i386

I deleted the file. I then issued:

dpkg --add-architecture foreign-architecture
Share:
23,509

Related videos on Youtube

speedy-MACHO
Author by

speedy-MACHO

Updated on September 18, 2022

Comments

  • speedy-MACHO
    speedy-MACHO over 1 year

    Always when I install something, I get the following error multiple times:

    Unknown configuration key 'foreign-architecture' found in your 'dpkg' configuration files. This warning will become a hard error at a later date, so please remove the offending configuration options and replace them with 'dpkg --add-architecture' invocations at the command line.

    When I try dpkg --add-architecture I get:

    Unknown configuration key `foreign-architecture' found in your `dpkg'
    configuration files.  This warning will become a hard error at a later
    date, so please remove the offending configuration options and replace
    them with `dpkg --add-architecture' invocations at the command line.
    
    dpkg: error: --add-architecture takes one argument
    
    Type dpkg --help for help about installing and deinstalling packages [*];
    Use `dselect' or `aptitude' for user-friendly package management;
    Type dpkg -Dhelp for a list of dpkg debug flag values;
    Type dpkg --force-help for a list of forcing options;
    Type dpkg-deb --help for help about manipulating *.deb files;
    
    Options marked [*] produce a lot of output - pipe it through `less' or `more' !
    

    I've no problems yet, but since it says This warning will become a hard error at a later date I better do something about this. When I search 'foreign-architecture', I find an empty file, containing not a single byte. I somehow can't delete that file.

    Please help, it's a kind of creapy...

    I use Ubuntu version 12.10

    Updated the questions:

    cat /etc/dpkg/dpkg.cfg 
    no-debsig 
    log /var/log/dpkg.log
    
    ls /etc/dpkg/dpkg.cfg.d/
    multiarch 
    
    • Admin
      Admin over 11 years
      Post the results of cat /etc/dpkg/dpkg.cfg & ls /etc/dpkg/dpkg.cfg.d/ . Re-edit your question.
    • Admin
      Admin over 11 years
      for cat: # dpkg configuration file # # This file can contain default options for dpkg. All command-line # options are allowed. Values can be specified by putting them after # the option, separated by whitespace and/or an `=' sign. # # Do not enable debsig-verify by default; since the distribution is not using # embedded signatures, debsig-verify would reject all packages. no-debsig # Log status changes and actions to a file. log /var/log/dpkg.log For ls: multiarch
    • Admin
      Admin over 11 years
      Please edit your question and add the results between code tags. Cannot read anything like that.
    • Admin
      Admin over 11 years
      Please update the question with the following information: Ubuntu version, architecture (uname -m) and the oputput of cat /var/lib/dpkg/arch.
    • Admin
      Admin over 11 years
      sorr, what do you mean with 'architecture (uname -m)'? and cat /var/lib/dpkg/arch gives: No such file or directory. I don't think I have to write that down? By the way, if you want to edit, just do it.
    • Admin
      Admin over 11 years
      Open a terminal window and enter: uname -m and it will give the CPU architecture (ex: i686 for a Pentium 4).
    • Admin
      Admin over 11 years
      Is your question still unanswered? If yes please provide the contents of the file /etc/dpkg/dpkg.cfg.d/multiarch.
    • Admin
      Admin over 6 years
      I have encountered same problem, so I edited the question with wanted information
  • gertvdijk
    gertvdijk over 11 years
    As you've said in another comment this file is not being used anymore on 12.10. I assume this is just a leftover from the upgrade from 12.04 of the OP.
  • tumbleweed
    tumbleweed over 11 years
    It should have been cleaned up on upgrade
  • alhelal
    alhelal over 6 years
    then what's happened?