Ubuntu如何安裝Pacman

來源:互聯網
上載者:User

1,wget 'ftp://ftp.archlinux.org/other/pacman/pacman-4.1.2.tar.gz'下載軟體包
 2,tar xvf pacman-4.1.2.tar.gz,解壓縮軟體
 3,cd pacman-4.1.2/,進入代碼,執行./configure,提示沒有libarchive
 4,執行sudo apt-get libarchive-dev安裝libarchive
 5,再次執行./configure,通過
 6,執行make,出錯
 -------------------------------------------------------------------------------
  CC      libalpm_la-be_sync.lo
 be_sync.c: In function '_alpm_validate_filename':
 be_sync.c:499: error: 'PATH_MAX' undeclared (first use in this function)
 be_sync.c:499: error: (Each undeclared identifier is reported only once
 be_sync.c:499: error: for each function it appears in.)
 make[3]: *** [libalpm_la-be_sync.lo] 錯誤 1
 make[2]: *** [all-recursive] 錯誤 1
 make[1]: *** [all-recursive] 錯誤 1
 make: *** [all] 錯誤 2
 --------------------------------------------------------------------------------
 7,gedit lib/libalpm/be_sync.c,代碼檔案,找到代碼
 -------------------------------------------------------------------------------
 static int _alpm_validate_filename(alpm_db_t *db, const char *pkgname,
        const char *filename)
 {
    size_t len = strlen(filename);
 
    if(filename[0] == '.') {
        errno = EINVAL;
        _alpm_log(db->handle, ALPM_LOG_ERROR, _("%s database is inconsistent: filename "
                    "of package %s is illegal\n"), db->treename, pkgname);
        return -1;
    } else if(memchr(filename, '/', len) != NULL) {
        errno = EINVAL;
        _alpm_log(db->handle, ALPM_LOG_ERROR, _("%s database is inconsistent: filename "
                    "of package %s is illegal\n"), db->treename, pkgname);
        return -1;
    }
else if(len > PATH_MAX) {
 
        errno = EINVAL;
        _alpm_log(db->handle, ALPM_LOG_ERROR, _("%s database is inconsistent: filename "
                    "of package %s is too long\n"), db->treename, pkgname);
        return -1;
 
    }
    return 0;
 }
 -------------------------------------------------------------------------------
 修改如下
 -------------------------------------------------------------------------------
 static int _alpm_validate_filename(alpm_db_t *db, const char *pkgname,
        const char *filename)
 {
    size_t len = strlen(filename);
 
    if(filename[0] == '.') {
        errno = EINVAL;
        _alpm_log(db->handle, ALPM_LOG_ERROR, _("%s database is inconsistent: filename "
                    "of package %s is illegal\n"), db->treename, pkgname);
        return -1;
    } else if(memchr(filename, '/', len) != NULL) {
        errno = EINVAL;
        _alpm_log(db->handle, ALPM_LOG_ERROR, _("%s database is inconsistent: filename "
                    "of package %s is illegal\n"), db->treename, pkgname);
        return -1;
    }
/*
 else if(len > PATH_MAX) {
 
        errno = EINVAL;
        _alpm_log(db->handle, ALPM_LOG_ERROR, _("%s database is inconsistent: filename "
                    "of package %s is too long\n"), db->treename, pkgname);
        return -1;
 
    }
 */
    return 0;
 }
 -------------------------------------------------------------------------------

 儲存,退出

7,執行make&& make install,等待安裝完成。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.