AVRisp MKII + Mega168 + Arduino > Please choose Port before uploading

I've got a problem using this programmer ( https://www.diamex.de/dxshop/Diamex-ALL-AVR-ISP-Programmer ) with a Atmega168 connected via ISP (10Pin-Header) and Arduino using Debian.

I think it's a GUI-Problem, because:

avrdude -c avrispmkII -p m168 -P usb -e -v

will result in:

avrdude: Version 6.3
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/etc/avrdude.conf"
         User configuration file is "/home/xgaduch/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : avrispmkII
avrdude: usbdev_open(): Found AVRISP mkII, serno: 0000000000000
         AVR Part                      : ATmega168
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no        512    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     16384  128    128  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel AVR ISP mkII
         Programmer Model: AVRISP mkII
         Hardware Version: 0
         Firmware Version Master : 1.32
         Vtarget         : 5.0 V
         SCK period      : 8.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9406 (probably m168)
avrdude: safemode: hfuse reads as DD
avrdude: safemode: efuse reads as F9
avrdude: erasing chip

avrdude: safemode: hfuse reads as DD
avrdude: safemode: efuse reads as F9
avrdude: safemode: Fuses OK (E:F9, H:DD, L:FF)

avrdude done.  Thank you.

I added this Board-Package to arduino:

https://raw.githubusercontent.com/carlosefr/atmega/master/package_carlosefr_atmega_index.json

I added My Progger to "arduino-1.8.7/hardware/arduino/avr/programmers.txt" like this:

diamexallavr.name=Diamex All-AVR
diamexallavr.communication=usb
diamexallavr.protocol=stk500v2
diamexallavr.program.protocol=stk500v2
diamexallavr.program.tool=avrdude
diamexallavr.program.extra_params=-Pusb
~/.arduino15/packages/atmega/hardware/avr/1.3.1/boards.txt

reads like:

menu.cpu=Processor
menu.clock=Clock

#
# ATmega168/168p
#

atmega168.name=ATmega168/168p

#atmega168.bootloader.tool=arduino:avrdude
atmega168.bootloader.tool=avrdude
atmega168.bootloader.unlock_bits=0x3f
atmega168.bootloader.lock_bits=0x0f

#atmega168.upload.tool=arduino:avrdude
atmega168.upload.tool=avrdude
atmega168.upload.maximum_size=16384
atmega168.upload.maximum_data_size=1024
atmega168.upload.speed=19200
atmega168.upload.serial.port=usb
atmega168.build.variant=arduino:standard
atmega168.build.core=arduino:arduino
atmega168.build.board=atmega168
...........

atmega168.menu.clock.external15=External 15 MHz
atmega168.menu.clock.external15.bootloader.low_fuses=0xff
atmega168.menu.clock.external15.bootloader.high_fuses=0xdd
atmega168.menu.clock.external15.bootloader.extended_fuses=0xf9
atmega168.menu.clock.external15.build.f_cpu=15000000L
...........
~/.arduino15/packages/atmega/hardware/avr/1.3.1/plattform.txt

reads like:

name=ATmega Microcontrollers
tools.avrdude.path={runtime.tools.avrdude.path}
tools.avrdude.erase.params.verbose=-v -v -v -v
tools.avrdude.erase.params.quiet=-q -q
tools.avrdude.erase.pattern="{cmd.path}" "-C{config.path}" {erase.verbose} -p{build.mcu} -c{protocol} {program.extra_params} -e -Uefuse:w:{bootloader.extended_fuses}:m -Uhfuse:w:{bootloader.high_fuses}:m -Ulfuse:w:{bootloader.low_fuses}:m
tools.avrdude.bootloader.params.verbose=-v -v -v -v
tools.avrdude.bootloader.params.quiet=-q -q
tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params}

tools.avrdude-noefuse.path={runtime.tools.avrdude.path}
tools.avrdude-noefuse.cmd.path={runtime.ide.path}/hardware/tools/avr/bin/avrdude
tools.avrdude-noefuse.config.path={runtime.ide.path}/hardware/tools/avr/etc/avrdude.conf
tools.avrdude-noefuse.erase.params.verbose=-v -v -v -v
tools.avrdude-noefuse.erase.params.quiet=-q -q
tools.avrdude-noefuse.erase.pattern="{cmd.path}" "-C{config.path}" {erase.verbose} -p{build.mcu} -c{protocol} {program.extra_params} -e -Uhfuse:w:{bootloader.high_fuses}:m -Ulfuse:w:{bootloader.low_fuses}:m
tools.avrdude-noefuse.bootloader.params.verbose=-v -v -v -v
tools.avrdude-noefuse.bootloader.params.quiet=-q -q
tools.avrdude-noefuse.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params}

Sadly, Arduino won't upload anything because I did not (and weren't able to) choose a port for Uploading, since the Programmer is using usb as Protocol&Port (See Attachment Unbenannt.PNG):

Arduino: 1.8.7 (Linux), Board: "ATmega168/168p, External 15 MHz, ATmega168"

Der Sketch verwendet 8658 Bytes (52%) des Programmspeicherplatzes. Das Maximum sind 16384 Bytes.
Globale Variablen verwenden 713 Bytes (69%) des dynamischen Speichers, 311 Bytes für lokale Variablen verbleiben. Das Maximum sind 1024 Bytes.
Bitte wählen Sie vor dem Hochladen einen Port aus

Dieser Bericht wäre detaillierter, wenn die Option
"Ausführliche Ausgabe während der Kompilierung"
in Datei -> Voreinstellungen aktiviert wäre.

I guess, this will be a common issue, but didn't find anything helpfully. Adding the Udev-Rules to create a symlink won't show the Progger under /dev/
What to try next?

Unbenannt.PNG

This is a known bug of Arduino IDE 1.8.7:

It only occurs if you have never selected a port from the Tools > Port menu. The easiest workaround is to select any port from the Tools > Port menu. Since you're using an ISP programmer, it doesn't make any difference what device that port is for.

If the Tools > Port menu is grayed out and you don't have any device you can plug in that creates a virtual COM port then you would need to use a version of the Arduino IDE other than 1.8.7. You can use Arduino IDE 1.8.6 or if you're feeling adventurous you can use the hourly build of the Arduino IDE since the bug has already been fixed. Please note that the hourly build is intended primarily for beta testing and has not been so thoroughly tested as the production releases of the Arduino IDE.