<PAGE>   1
                                                                    EXHIBIT 10.5




                    AMENDMENT AND WAIVER TO CREDIT AGREEMENT


     THIS AMENDMENT AND WAIVER TO CREDIT AGREEMENT (this "Amendment") is made
and entered into as of this 29th day of June, 1998 by and among MARSHALL
INDUSTRIES, a corporation organized under the laws of California ("Marshall"),
STERLING ELECTRONICS CORPORATION, a corporation organized under the laws of
Nevada ("Sterling," and together with Marshall, the "Borrower"), the Lenders who
are or may become a party to the Credit Agreement referred to below, and FIRST
UNION NATIONAL BANK, as Administrative Agent for the Lenders.

                              Statement of Purpose

     The Lenders agreed to make certain Extensions of Credit to the Borrower
pursuant to the Credit Agreement dated as of January 16, 1998 by and among the
Borrower, the Lenders and the Administrative Agent, as amended by the First
Amendment dated February 26, 1998 (as so amended and as further amended or
supplemented from time to time, the "Credit Agreement").

     The parties now desire to amend the Credit Agreement in certain respects
and waive certain provisions of the Credit Agreement on the terms and conditions
set forth below.

     NOW THEREFORE, for good and valuable consideration, the receipt and
adequacy of which are hereby acknowledged, the parties hereto agree as follows:

     1.   Effect of Amendment and Waiver. Except as expressly amended hereby,
the Credit Agreement and Loan Documents shall be and remain in full force and
effect. The waivers granted herein are specific and limited and shall not
constitute an amendment of the Credit Agreement or the Loan Documents or a
modification, acceptance or waiver of any other provision of or default under
the Credit Agreement, the Loan Documents or any other document or instrument
entered into in connection therewith or a future modification, acceptance or
waiver of the provisions set forth therein.

     2.   Capitalized Terms. All capitalized undefined terms used in this
Amendment shall have the meanings assigned thereto in the Credit Agreement.

     3.   Modification of Credit Agreement. Section 8.1(c) of the Credit
Agreement is hereby deleted in its entirety and the following Section 8.1(c)
shall be substituted in lieu thereof:

          "(c) Annual Business Plan and Financial Projections. As soon as
          practicable and in any event within thirty (30) days after the
          beginning of each Fiscal Year, a business plan of the Borrower and its
          Subsidiaries for the ensuing five (5) Fiscal Years, such plan to be
          prepared in accordance with GAAP and (i) to include for the first such
          ensuing Fiscal Year, on a quarterly basis, a quarterly operating and
          capital budget, a projected income statement, statement of cash flows
          and balance sheet, and (ii) for the next four (4) Fiscal Years
          following such first ensuing Fiscal Year, to include, on an annual
          basis, an annual operating and capital budget, a projected income
          statement, statement of cash flows and balance sheet, together with a
          report containing management's major assumptions


<PAGE>   2
          covering such projections. Such projections shall be accompanied by a
          certificate of the chief executive officer or chief financial officer
          of the Borrower to the effect that the projections are based on
          reasonable estimates and assumptions, all of which are fair in light
          of the conditions which existed at the time the projections were made,
          have been prepared on the basis of the assumptions stated therein, and
          reflect, as of the time so furnished, the reasonable estimate of the
          Borrower and its Subsidiaries of the results of the operations and
          other information projected therein, it being recognized by the
          Administrative Agent and the Lenders that such projections as to
          future events are not to be viewed as facts and that actual results
          during the period or periods covered by any such projections may
          differ from the projected results."

     4.   Waiver. The Lenders hereby agree to waive the requirement that the
Borrower deliver to the Administrative Agent and Lenders financial projections
pursuant to Sections 8.1(c) of the Credit Agreement within thirty (30) days
after the beginning of the Fiscal Year beginning June 1, 1998 and ending May
31, 1999; provided, that the Borrower shall deliver such financial projections
on or prior to July 31, 1998. The failure of the Borrower to deliver such
financial projections on or prior to July 31, 1998 shall constitute a Default
under the Credit Agreement.

     5.   Representations and Warranties/No Default. By their execution hereof,
the Borrower hereby certifies that (giving effect to this Amendment) each of
the representations and warranties set forth in the Credit Agreement and the
other Loan Documents is true and correct in all material respects as of the
date hereof as if fully set forth herein, except to the extent that such
representations and warranties expressly relate to an earlier date (in which
case such representations and warranties shall have been true and correct in
all material respects on and as of such earlier date), and that as of the date
hereof no Default or Event of Default has occurred and is continuing.

     6.   Expenses. The Borrowers shall pay all reasonable out-of-pocket
expenses of the Administrative Agent in connection with the preparation,
execution and delivery of this Amendment, including without limitation, the
reasonable fees and disbursements of counsel for the Administrative Agent.

     7.   Governing Law. This Amendment shall be governed by and construed in
accordance with the laws of the State of North Carolina.

     8.   Counterparts. This Amendment may be executed in separate
counterparts, each of which when executed and delivered is an original but all
of which taken together constitute one and the same instrument.

     9.   Effectiveness. This Amendment will become effective when it has been
executed by the Borrowers and Required Lenders and copies of such executed
counterparts have been delivered to the Administrative Agent.




                                       2
<PAGE>   3
     IN WITNESS WHEREOF, the parties hereto have caused this Amendment to be
duly executed as of the date and year first above written.


[CORPORATE SEAL]                        MARSHALL INDUSTRIES

                                        By: /s/ HENRY W. CHIN
                                           -------------------------------------
                                        Name: Henry W. Chin
                                        Title: Vice President, Finance and CFO


[CORPORATE SEAL]                        STERLING ELECTRONICS CORPORATION


ATTEST:


By: /s/ LINDA CHAVEZ                    By: /s/ HENRY W. CHIN
   -------------------------               -------------------------------------
Name: Linda Chavez                      Name: Henry W. Chin
Title: Controller                       Title: Vice President, Treasurer


                    [SIGNATURES CONTINUE ON FOLLOWING PAGE]



                                       3
<PAGE>   4

                                       FIRST UNION NATIONAL BANK,
                                       as Administrative Agent and Lender


                                       By: /s/ GEORGE L. WOOLSEY
                                          -------------------------------------
                                       Name: George L. Woolsey
                                            -----------------------------------
                                       Title: Vice President
                                             ----------------------------------


                                       THE BANK OF NEW YORK


                                       By: /s/ REBECCA K. LEVINE
                                          -------------------------------------
                                       Name: Rebecca K. Levine
                                            -----------------------------------
                                       Title: Vice President
                                             ----------------------------------


                                       COMERICA BANK


                                       By: /s/ EMMANUEL M. SKEVOFILEX
                                          -------------------------------------
                                       Name: Emmanuel M. Skevofilex
                                            -----------------------------------
                                       Title: Assistant Vice President
                                             ----------------------------------


                                       THE FIRST NATIONAL BANK OF CHICAGO


                                       By: /s/ MARK A. ISLEY
                                          -------------------------------------
                                       Name: Mark A. Isley
                                            -----------------------------------
                                       Title: First Vice President
                                             ----------------------------------


                                       NATIONSBANK OF TEXAS, N.A.


                                       By: /s/ GEORGE V. HAUSLER
                                          -------------------------------------
                                       Name: George V. Hausler
                                            -----------------------------------
                                       Title: Vice President
                                             ----------------------------------



                                       4
<PAGE>   5
                                        UNION BANK OF CALIFORNIA, N.A.

                                        By   /s/ ANN M. YASUDA
                                           ------------------------------

                                        Name:     Ann M. Yasuda
                                              ---------------------------
                                        Title:    Vice President
                                               --------------------------


                                        WELLS FARGO BANK, NATIONAL
                                        ASSOCIATION

                                        By      /s/ NANCY S. MARTORAND
                                            -----------------------------
                                        Name:     Nancy S. Martorand
                                              ---------------------------
                                        Title:    Vice President
                                                -------------------------

                                        BANQUE NATIONAL DE PARIS

                                        By    /s/ CLIVE BETTLES
                                           ------------------------------
                                        Name:   Clive Bettles
                                              ---------------------------
                                        Title:  Senior Vice President &
                                                Manager
                                              ---------------------------


                                        By    /s/ DEBBIE GOHN
                                           ------------------------------
                                        Name:   Debbie Gohn
                                               --------------------------
                                        Title:  Vice President
                                               --------------------------

                                        BANK OF MONTREAL

                                        By    /s/ RICHARD W. CAMM
                                           ------------------------------
                                        Name:    Richard W. Camm
                                              ---------------------------
                                        Title:   Managing Director
                                               --------------------------

                                        ABN AMRO BANK

                                        By    /s/ PAUL K. STIMPEL
                                            -----------------------------
                                        Name:     Paul K. Stimpel
                                              ---------------------------
                                        Title:    Group Vice President
                                               --------------------------

                                        By    /s/ CATHERYN N. FULLER
                                           ------------------------------
                                        Name:   Catheryn N. Fuller
                                              ---------------------------
                                        Title:  SVP
                                               --------------------------