Ubuntu installs Pacman package manager step

  

In Ubuntu system operation, Pacman is a package manager that can manage the official Arch library and its own created packages, but sometimes it will go wrong when installing Pacman. The following small series will introduce you to how Ubuntu installs Pacman.

1, wget & lsquo; ftp: //ftp.archlinux.org/other/pacman/pacman-4.1.2.tar.gz’ download package

2, tar Xvf pacman-4.1.2.tar.gz, decompression software

3, cd pacman-4.1.2/, enter the code, execute. /configure, the prompt does not have libarchive

4, execute sudo apt-get libarchive-dev install libarchive

5, execute again. /configure, execute

6, error, error

---------------------------- -------------------------------------------------- -

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] Error 1

make[2]: *** [all-recursive] Error 1

Make[1]: *** [all-recursive] Error 1

make: *** [all] Error 2

------------- -------------------------------------------------- -----------------

7, gedit lib/libalpm/be_sync.c, code files, find the code

----- --------------------------------------- -----------------------------------

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\ ”), 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\ ”), db-"treename, pkgname);

return -1;

}

else if(len PATH 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 -1;

}

return 0;

}

----------------------------------------------- --------------------------------

Amend the following

---- -------------------------------------------------- -------------------------

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\ ”), 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\ ”), 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\ ”), db-"treename, pkgname);

return -1;

}

* /

Return 0;

}

---------------------------------- ---------------------------------------------

Save, exit

8. Execute make&& make install and wait for the installation to complete.

The above is the introduction of Ubuntu Pacman installation method, usually the installation will be executed when the make error, after the error, follow the code described in this article to install, and finally execute make && make install to complete the installation.

Copyright © Windows knowledge All Rights Reserved