2024年11月Ubuntu安装Pacman包管理器的步骤

发布时间:

  ⑴Ubuntu系统操作中,Pacman是一款软件包管理器,能够对官方的Arch库和自己创建的软件包进行管理,但是有时在安装Pacman的时候会出错,下面小编就给大家介绍下Ubuntu如何安装Pacman。

  ⑵,wget ‘下载软件包

  ⑶,tar xvf pacman-...tar.gz,

  ⑷,cd pacman-../,进入代码,执行。/configure,提示没有libarchive

  ⑸,执行sudo apt-get libarchive-dev安装libarchive

  ⑹,再次执行。/configure,通过

  ⑺,执行make,出错

  ⑻-------------------------------------------------------------------------------

  ⑼ libalpm_la-be_sync.lo

  ⑽be_sync.c: In function ‘_alpm_validate_filename’:

  ⑾be_sync.c:: error: ‘PATH_MAX’ undeclared (first use in this function

  ⑿be_sync.c:: error: (Each undeclared identifier is reported only once

  ⒀be_sync.c:: error: for each function it appears in.

  ⒁make[]: *** [libalpm_la-be_sync.lo] 错误

  ⒂make[]: *** [all-recursive] 错误

  ⒃make[]: *** [all-recursive] 错误

  ⒄make: *** [all] 错误

  ⒅--------------------------------------------------------------------------------

  ⒆,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[] == ‘。’ {

  ⒌errno = EINVAL;

  ⒍_alpm_log(db-》handle, ALPM_LOG_ERROR, _(“%s database is inconsistent: filename ”

  ⒎“of package %s is illegal

  ⒏”, db-》treename, pkgname;

  ⒐return -;

  ⒑} 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

  ⒕”, db-》treename, pkgname;

  ⒖return -;

  ⒗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

  ⒛”, db-》treename, pkgname;

  ①return -;

  ②return ;

  ③-------------------------------------------------------------------------------

  ④-------------------------------------------------------------------------------

  ⑤static int _alpm_validate_filename(alpm_db_t *db, const char *pkgname,

  ⑥const char *filename

  ⑦size_t len = strlen(filename;

  ⑧if(filename[] == ‘。’ {

  ⑨errno = EINVAL;

  ⑩_alpm_log(db-》handle, ALPM_LOG_ERROR, _(“%s database is inconsistent: filename ”

  Ⅰ“of package %s is illegal

  Ⅱ”, db-》treename, pkgname;

  Ⅲreturn -;

  Ⅳ} 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

  Ⅷ”, db-》treename, pkgname;

  Ⅸreturn -;

  Ⅹ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

  ㈣”, db-》treename, pkgname;

  ㈤return -;

  ㈥return ;

  ㈦-------------------------------------------------------------------------------

  ㈧,执行make&& make install,等待安装完成。

  ㈨上面就是Ubuntu安装Pacman的方法介绍了,通常安装的时候会在执行make出错,出错后按照本文介绍的代码进行安装,最后再执行make&& make install完成安装。